max_stars_repo_path
stringlengths 3
961
| max_stars_repo_name
stringlengths 5
122
| max_stars_count
int64 0
224k
| id
stringlengths 1
8
| content
stringlengths 2
1.07M
| score
float64 -0.95
3.88
| int_score
int64 0
4
|
---|---|---|---|---|---|---|
src/art-by-city/api.js | decentldotland/weave-aggregator | 4 | 15993932 | import { querySchema, gqlTemplate } from "../utils/arweave/gql.js";
import { arweave } from "../utils/arweave/arweave.js";
async function getArtTxs() {
try {
const txs = await gqlTemplate(querySchema.artbycity.art);
return txs;
} catch (error) {
console.log(`${error.name}: ${error.message}`);
process.exit(1);
}
}
async function getArtWorkMetadata(artTxs) {
try {
const feed = [];
for (let tx of artTxs) {
const metadata = await arweave.transactions.getData(tx.id, {
decode: true,
string: true,
});
const artObj = JSON.parse(metadata);
const art = {
aid: tx.id,
title: artObj?.title,
desc: artObj?.description,
slug: artObj?.slug,
creator: artObj?.creator,
creationDate: artObj?.published,
image: `https://arweave.net/${artObj?.images?.[0]?.["preview"]}`,
};
feed.push(art);
}
return feed;
} catch (error) {
console.log(`${error.name}: ${error.message}`);
process.exit(1);
}
}
export async function getArtByCity() {
try {
const artsTxs = await getArtTxs();
const feed = await getArtWorkMetadata(artsTxs);
return feed;
} catch (error) {
console.log(`${error.name}: ${error.message}`);
process.exit(1);
}
}
| 1.296875 | 1 |
test/unit/test-md-text.js | MorganSchmiedt/markdown | 2 | 15993940 | 'use strict'
/* eslint-disable prefer-arrow-callback */
const {
parseToHtml,
test,
} = require('../test-lib.js')
test('Text', function (t) {
const input = 'My name is <NAME>'
const output = '<p>My name is <NAME></p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Paragraph', function (t) {
const input = 'Line 1\n\nLine 2'
const output = '<p>Line 1</p><p>Line 2</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Paragraph with extra newlines', function (t) {
const input = 'Line 1\n\n\n\nLine 2'
const output = '<p>Line 1</p><p>Line 2</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Line of spaces are considered empty', function (t) {
const input = 'Line 1\n \nLine 2'
const output = '<p>Line 1</p><p>Line 2</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Italic', function (t) {
const input = 'An *italic* text'
const output = '<p>An <em>italic</em> text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Bold', function (t) {
const input = 'A **bold** text'
const output = '<p>A <strong>bold</strong> text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Bold-italic', function (t) {
const input = 'A ***bold-italic*** text'
const output = '<p>A <strong><em>bold-italic</em></strong> text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Emphasis with leading space', function (t) {
const input = 'An * italic* text'
const output = '<p>An * italic* text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Emphasis with trailing space', function (t) {
const input = 'An *italic * text'
const output = '<p>An *italic * text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('2 Emphasis on the same line', function (t) {
const input = 'A *1* and a *2*.'
const output = '<p>A <em>1</em> and a <em>2</em>.</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Emphasis with wrong end tag inside: space+*', function (t) {
const input = 'An *italic *tes t* text'
const output = '<p>An <em>italic *tes t</em> text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Strikethrough', function (t) {
const input = 'A ~~strikethrough~~ text'
const output = '<p>A <s>strikethrough</s> text</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Superscript without parenthesis', function (t) {
const input = 'A formula x^2 + y^3 + z^10'
const output = '<p>A formula x<sup>2</sup> + y<sup>3</sup> + z<sup>10</sup></p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Superscript with parenthesis', function (t) {
const input = 'A formula x^(2) + y^(a - b)'
const output = '<p>A formula x<sup>2</sup> + y<sup>a - b</sup></p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
| 1.476563 | 1 |
configs/rollup.client.js | bengsfort/exit-game-simulator | 0 | 15993948 | import { commonPlugins } from "./rollup.common";
import gltf from "rollup-plugin-gltf";
export default {
input: "src/client/client.ts",
output: {
file: "build/public/client/bundle.js",
format: "iife",
sourcemap: true,
name: "ExitGame",
},
plugins: [
gltf({
inline: true,
include: ["**/*.gltf"],
}),
...commonPlugins,
],
};
| 0.474609 | 0 |
web-client/integration-tests/journey/adcViewsPractitionerOnCaseAfterPetitionerRemoved.js | codyseibert/ef-cms | 52 | 15993956 | import { partiesInformationHelper } from '../../src/presenter/computeds/partiesInformationHelper';
import { runCompute } from 'cerebral/test';
import { viewCounselHelper } from '../../src/presenter/computeds/viewCounselHelper';
import { withAppContextDecorator } from '../../src/withAppContext';
export const adcViewsPractitionerOnCaseAfterPetitionerRemoved =
cerebralTest => {
return it('adc views practitioner modal on case after petitioner has been removed during petition QC', async () => {
await cerebralTest.runSequence('gotoCaseDetailSequence', {
docketNumber: cerebralTest.docketNumber,
});
expect(cerebralTest.getState('currentPage')).toEqual(
'CaseDetailInternal',
);
const partiesInformationHelperComputed = runCompute(
withAppContextDecorator(partiesInformationHelper),
{
state: cerebralTest.getState(),
},
);
const petitioner =
partiesInformationHelperComputed.formattedPetitioners[0];
await cerebralTest.runSequence('showViewPetitionerCounselModalSequence', {
privatePractitioner: petitioner.representingPractitioners[0],
});
const viewCounselHelperComputed = runCompute(viewCounselHelper, {
state: cerebralTest.getState(),
});
expect(viewCounselHelperComputed.representingNames).toEqual([
'<NAME>',
]);
});
};
| 1.117188 | 1 |
packages/icons/src/monochrome/DocumentLayoutRight.js | ggustin93/decide-showcase-fix | 3 | 15993964 | import React from 'react';
export default function DocumentLayoutRight(props) {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width={24} height={24} {...props}>
<path className="uim-tertiary" d="M11 8H3A1 1 0 0 1 3 6h8a1 1 0 0 1 0 2zM11 12H3a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2z" />
<rect width={8} height={8} x={14} y={4} className="uim-primary" rx={1} />
<path className="uim-tertiary" d="M21 16H3a1 1 0 0 1 0-2H21a1 1 0 0 1 0 2zM13 20H3a1 1 0 0 1 0-2H13a1 1 0 0 1 0 2z" />
</svg>
);
}
| 1.234375 | 1 |
OpFlix/MOBILE/opflix/src/pages/signin.js | regiamariana/Sprint4-exerc-cios | 0 | 15993972 | import React, { Component } from 'react';
import {ParseJwt} from "../services/auth";
import jwt from 'jwt-decode';
import {
Text,
View,
TextInput,
TouchableOpacity,
AsyncStorage,
Image,
} from 'react-native';
//import console = require('console');
export default class SignIn extends Component {
constructor() {
super();
this.state = {
email: '<EMAIL>',
senha: '<PASSWORD>'
};
}
_realizarLogin = async () => {
await fetch('http://192.168.5.123:5000/api/Login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: this.state.email,
senha: this.state.senha,
}),
})
.then(resposta => resposta.json())
.then(data => this._irParaHome(data.token))
.catch(erro => console.warn(erro));
}
_irParaHome = async (tokenAReceber) => {
if (tokenAReceber != null) {
try {
// console.warn()
await AsyncStorage.setItem('@opflix:token', tokenAReceber);
if (jwt(tokenAReceber).permissao === 'ADM') {
this.props.navigation.navigate('AdmNavegacao');
} else {
this.props.navigation.navigate('MainNavigator');
}
} catch (error) {
console.warn(error)
}
}
};
render() {
return (
<View style={{backgroundColor: "black", height: "100%"}}>
{/* título */}
<View style={{position: "relative"}}>
<Image
style={{width: 300, height: 160, }}
source={{uri: 'https://docs.substance3d.com/sddoc/files/159450981/159450980/1/1496152369146/stripes.png'}}
/>
<View style={{backgroundColor: "white", width: 500, height: 100, position:"absolute", top: 30, left: 0}}>
</View>
<View style={{top: -128, alignSelf: "center"}}>
<Text style={{ color: 'maroon',fontSize: 65, alignContent: "center"}}>[Fazer Login]</Text>
</View>
</View>
{/* caixa de login */}
<View>
<Image
style={{width: 350, height: 260, position: "relative", alignSelf: "center"}}
source={{uri: 'https://docs.substance3d.com/sddoc/files/159450981/159450980/1/1496152369146/stripes.png'}}
/>
<View style={{backgroundColor: "white", width: 340, height: 250, position:"absolute", left: 30}}>
</View>
<TextInput placeholder="email"
onChangeText={email => this.setState({ email })}
value={this.state.email}
style={{position: "absolute",fontSize: 30, alignSelf: "center", width: 300}}
underlineColorAndroid = "black"
/>
<TextInput placeholder="senha"
onChangeText={senha => this.setState({ senha })}
value={this.state.senha}
underlineColorAndroid = "black"
style={{position: "absolute", fontSize: 30, bottom: 120, alignSelf: "center", width: 300}}
/>
<TouchableOpacity onPress={this._realizarLogin}
underlineColorAndroid = "black"
style={{position: "absolute", bottom: 50, alignSelf: "center", borderColor: "black"}}>
<Text style={{fontSize: 25, }}>Login</Text>
</TouchableOpacity>
</View>
</View>
)
}
} | 1.609375 | 2 |
gulpfile.js | bmehler/youtubeApp | 0 | 15993980 | var gulp = require('gulp')
, nodemon = require('gulp-nodemon')
, Server = require('karma').Server
, jshint = require('gulp-jshint')
, sass = require('gulp-sass');
gulp.task('start', function () {
nodemon({
script: 'server.js'
, ext: 'html'
})
.on('restart', function () {
console.log('restarted!')
})
});
gulp.task('test', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js',
}, done).start();
});
gulp.task('lint', function () {
return gulp.src('public/module/video/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
});
gulp.task('build-css', function() {
return gulp.src('public/source/scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('public/assets/stylesheets'));
});
gulp.task('watch', function() {
gulp.watch('public/module/video/**/*.js', ['lint']);
gulp.watch('public/source/scss/**/*.scss', ['build-css']);
});
| 1.101563 | 1 |
src/components/timeline/timeline-item/timeline-header.js | mysky528/ReactJS-AdminLTE | 2 | 15993988 | define (
[
'react'
],
function (React) {
var TimelineHeader = React.createClass({
render: function(){
return (
<h3 className="timeline-header">
<a href={this.props.url} target="_blank">{this.props.title}</a>
{this.props.content}
{this.props.children}
</h3>
)
}
});
return TimelineHeader
}
) | 1.164063 | 1 |
src/data/projects.js | browne0/react-gatsby-portfolio | 8 | 15993996 | // Spotter
import spotterLogo from '../images/logos/spotter.png';
import spotter1 from '../images/screenshots/spotter.jpg';
import spotter2 from '../images/screenshots/spotter1.jpg';
import spotter3 from '../images/screenshots/spotter2.png';
import spotter4 from '../images/project_gifs/spotter-info.gif';
import spotter5 from '../images/project_gifs/spotter-slide-in.gif';
// Mixmax
import mixmaxLogo from '../images/logos/mixmax_logo.png';
import mixmax1 from '../images/project_gifs/mixmax_typeahead.gif';
import mixmax2 from '../images/project_gifs/mixmax_resolver.gif';
import mixmax3 from '../images/screenshots/mixmax_final.png';
// Bee's Design
import beesdesignLogo from '../images/logos/beesdesign_logo.png';
import beesdesign1 from '../images/screenshots/beesdesign.png';
import beesdesign2 from '../images/screenshots/beesdesign2.png';
import beesdesign3 from '../images/screenshots/beesdesign3.png';
import beesdesign4 from '../images/screenshots/beesdesign4.png';
// Facts of Today
import factsOfTodayLogo from '../images/logos/factsoftoday_logo.png';
import factsoftoday1 from '../images/project_gifs/factsoftoday.gif';
// myChef
import mychef1 from '../images/screenshots/mychef.jpg';
// Old Portfolio
import oldPortfolioLogo from '../images/logos/old_portfolio_logo.png';
import oldportfolio1 from '../images/screenshots/old_portfolio.jpg';
import oldportfolio2 from '../images/screenshots/old_portfolio_halfandhalf.png';
import oldportfolio3 from '../images/project_gifs/oldportfolio_halfandhalf.gif';
export default [
{
name: 'Spotter',
description:
'A landing page crafted for an Indiana based startup called Spotter.',
technologies: ['HTML5/CSS3', 'JavaScript', 'jQuery', 'PHP'],
big_picture: true,
image_urls: {
logo: spotterLogo,
screenshots: [spotter1, spotter2, spotter3, spotter4, spotter5],
},
github_url: 'https://github.com/browne0/Spotter',
path: '/spotter',
background_color: '#074b88',
},
{
name: 'Spotify Mixmax Integration',
description:
'A Spotify Mixmax slash command that allows you to search for a track, artist, or album to embed in an email.',
technologies: ['NodeJS', 'HTML5/CSS3'],
big_picture: false,
image_urls: {
logo: mixmaxLogo,
screenshots: [mixmax1, mixmax2, mixmax3],
},
github_url: 'https://github.com/browne0/spotify-mixmax-slash-command',
background_color: '#2F2462',
path: '/mixmax',
},
{
name: "<NAME>",
description:
'A freelance web development company I started when I was seventeen.',
technologies: ['HTML5/CSS3', 'jQuery', 'PHP'],
big_picture: false,
image_urls: {
logo: beesdesignLogo,
screenshots: [beesdesign1, beesdesign2, beesdesign3, beesdesign4],
},
github_url: '',
background_color: '#21512A',
path: '/beesdesign',
},
{
name: 'Facts of Today',
description:
'An iOS app that given a date, returns different information that happened on the same day in history.',
technologies: ['Swift', 'Objective-C', 'Photoshop'],
big_picture: false,
image_urls: {
logo: factsOfTodayLogo,
screenshots: [
factsoftoday1,
'http://is3.mzstatic.com/image/thumb/Purple30/v4/fa/e8/95/fae895bd-287e-3a62-0050-828ac31a348f/source/392x696bb.jpg',
'http://is4.mzstatic.com/image/thumb/Purple18/v4/b6/80/b0/b680b058-c5ec-98b0-d47d-252b72eba4e9/source/392x696bb.jpg',
'https://github.com/browne0/FactsOfToday/blob/master/wireframe.png?raw=true',
'https://github.com/browne0/FactsOfToday/raw/master/factsoftoday-demo.gif',
'https://github.com/browne0/FactsOfToday/raw/master/factsoftoday-demo-66%25.gif',
'https://github.com/browne0/FactsOfToday/raw/master/factsOfToday-demo2.gif',
'http://is5.mzstatic.com/image/thumb/Purple20/v4/7a/50/ef/7a50efab-e4f9-dcfd-dfd8-0302c2c3b383/source/392x696bb.jpg',
'http://is2.mzstatic.com/image/thumb/Purple30/v4/c0/89/88/c089881f-c065-d6ef-9ff2-32d15f07a304/source/392x696bb.jpg',
],
},
github_url: 'https://github.com/browne0/FactsOfToday',
live_url:
'https://itunes.apple.com/us/app/facts-of-today/id1118574083?mt=8',
background_color: '#fff',
color: '#5599D7',
path: '/factsoftoday',
},
{
name: 'myChef',
description:
'A web application that matches you with local chefs in the nearby area to receive a personalized home cooked meal.',
technologies: ['HTML5/CSS3', 'JavaScript', 'jQuery', 'PHP/MySQL'],
big_picture: true,
image_urls: {
screenshots: [mychef1],
},
github_url: 'https://github.com/browne0/myChef',
path: '/mychef',
background_color: '#e75967',
},
{
name: 'Post Grad Portfolio',
description:
'A website used to display my completed projects during college.',
technologies: ['HTML5/CSS3', 'AngularJS', 'jQuery'],
big_picture: false,
image_urls: {
logo: oldPortfolioLogo,
screenshots: [oldportfolio1, oldportfolio2, oldportfolio3],
},
github_url: 'https://github.com/browne0/browne0.github.io',
live_url: 'https://browne0.github.io',
path: '/old-portfolio',
background_color: '#333',
color: 'rgb(194, 77, 1)',
},
];
| 0.90625 | 1 |
tests/tools/import.js | Cyrik/ApplicationFrame | 4 | 15994004 | /* eslint-env mocha */
const expect = require('chai').expect;
const Import = function(path) {
const module = { value: null, };
it('should import the module', () => {
module.value = require(path);
expect(module.value).to.be.not.undefined;
expect(module.value).to.be.not.null;
});
return module;
};
module.exports = Import;
| 1.078125 | 1 |
app/main.js | erickpinos/Solsensus | 2 | 15994012 | import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import {
BrowserRouter as Router,
Redirect,
Route,
Link,
Switch
} from 'react-router-dom'
import { store, history } from './store'
import App from './App'
import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme.js'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
import getMuiTheme from 'material-ui/styles/getMuiTheme'
import { AppDrawer, Toolbar , Dashboard, SimpleTable, GridListWidget, Login, Home, Status, Charts, Analytics, Settings } from './components/index'
const muiTheme = getMuiTheme(lightBaseTheme.js);
render(
<Router history={history}>
<Provider store={store}>
<MuiThemeProvider muiTheme={muiTheme}>
<App />
</MuiThemeProvider>
</Provider>
</Router>,
document.getElementById('app')
);
| 1.265625 | 1 |
src/services/graphql/schema.js | janat08/electrical-system | 21 | 15994020 | const typeDefinitions = `
enum LoadType {
FIXTURE
OUTLET
}
type User {
_id: String! # Indicadive of MongoDB , use id if you'd like to use SQL
firstName: String
lastName: String
username: String!
buildings: [Building] # User has many Buildings
}
type Building {
_id: String!
createdAt: String
name: String!
address1: String
address2: String
city: String
state: String
panels: [Panel] # Building has many Panels, even though there's probably only one.
rooms: [Room] # Building has many Rooms
}
type Panel {
_id: String!
createdAt: String
name: String!
rating: Int!
slots: Int!
image: Image # Panel has one Image
breakers: [Breaker] # Panel has many Breakers
}
type Room {
_id: String!
createdAt: String
label: String!
loads: [Load]
}
type Image {
_id: String!
createdAt: String
url: String!
}
type Breaker {
_id: String!
createdAt: String
label: String!
description: String
rating: Int!
loads: [Load] # Breaker has many Loads , IE lights and outlets
}
type Load {
_id: String!
createdAt: String
label: String!
type: String!
image: Image # Load has one Image
switches: [Toggle] # Load may have many Toggles , single or 2 way
}
type Toggle { # Can't call this switch
_id: String!
createdAt: String
label: String!
image: Image # Toggle has one Image
}
# types for mutations
type AuthPayload {
token: String # JSON Web Token
data: User
}
# the schema allows the following queries:
type RootQuery {
viewer: User
buildings: [Building]
building(id: String!): Building
rooms(buildingId: String): [Room]
room(id: String!): Room
panels(buildingId: String!): [Panel]
panel(id: String!): Panel
breakers(panelId: String!): [Breaker]
breaker(id: String!): Breaker
roomLoads(roomId: String!): [Load]
breakerLoads(breakerId: String!): [Load]
toggles(loadId: String!): [Toggle]
toggle(id: String!): Toggle
}
# this schema allows the following mutations:
type RootMutation {
signUp (
username: String!
password: <PASSWORD>!
firstName: String
lastName: String
): User
logIn (
username: String!
password: <PASSWORD>!
): AuthPayload
createBuilding (
name: String!
address1: String
address2: String
city: String
state: String
): Building
updateBuilding (
_id: String!
name: String!
address1: String
address2: String
city: String
state: String
): Building
deleteBuilding (
_id: String!
): Building
createRoom (
label: String!
): Room
updateRoom (
_id: String!
label: String!
): Room
deleteRoom (
_id: String!
): Room
createPanel (
buildingId: String!
name: String!
rating: Int!
slots: Int!
): Panel
updatePanel (
_id: String!
buildingId: String!
name: String!
rating: Int!
slots: Int!
): Panel
deletePanel (
_id: String!
): Panel
createBreaker (
panelId: String!
label: String!
description: String
rating: Int!
): Breaker
updateBreaker (
_id: String!
panelId: String!
label: String!
description: String
rating: Int!
): Breaker
deleteBreaker (
_id: String!
): Breaker
createLoad (
breakerId: String!
roomId: String!
label: String!
type: String!
): Load
updateLoad (
_id: String!
breakerId: String!
roomId: String!
label: String!
type: String!
): Load
deleteLoad (
_id: String!
): Load
createToggle (
loadId: String!
text: String!
): Toggle
updateToggle (
_id: String!
loadId: String!
text: String!
): Toggle
deleteToggle (
_id: String!
): Toggle
}
# we need to tell the server which types represent the root query
# and root mutation types. We call them RootQuery and RootMutation by convention.
schema {
query: RootQuery
mutation: RootMutation
}
`;
export default [typeDefinitions]
| 1.710938 | 2 |
misc/deprecated-api-docs/modern/modern/src/grid/plugin/PagingToolbar.js | CelestialSystem/ext-angular | 39 | 15994028 | /**
* @class Ext.grid.plugin.PagingToolbar
* @extend Ext.plugin.Abstract
* @alias plugin.pagingtoolbar
* @alias plugin.gridpagingtoolbar
*
* The Paging Toolbar is a specialized toolbar that is
* bound to a `Ext.data.Store` and provides automatic paging control.
*
* @example packages=[extangular]
* import { Component } from '@angular/core'
* declare var Ext: any;
*
* Ext.require('Ext.grid.plugin.PagingToolbar');
* @Component({
* selector: 'app-root-1',
* styles: [`
* `],
* template: `
* <container #item>
* <grid #item
* [height]="'180px'"
* [store]="this.store"
* [plugins]="['pagingtoolbar']"
* >
* <column #item
* text="First Name"
* dataIndex="fname"
* flex="1"
* ></column>
* <column #item
* text="Last Name"
* dataIndex="lname"
* flex="1"
* ></column>
* <column #item
* text="Talent"
* dataIndex="talent"
* flex="1"
* >
* </column>
* </grid>
* </container>
* `
* })
* export class AppComponent {
* store = new Ext.data.Store({
* pageSize: 3,
* data: [
* { 'fname': 'Barry', 'lname': 'Allen', 'talent': 'Speedster'},
* { 'fname': 'Oliver', 'lname': 'Queen', 'talent': 'Archery'},
* { 'fname': 'Kara', 'lname': 'Zor-El', 'talent': 'All'},
* { 'fname': 'Helena', 'lname': 'Bertinelli', 'talent': 'Weapons Expert'},
* { 'fname': 'Hal', 'lname': 'Jordan', 'talent': 'Willpower' }
* ]
* });
* }
*/
| 1.585938 | 2 |
backend/src/api/v1/utils/sendEmail.js | SamuelOjes/authmern | 0 | 15994036 | import nodeMailer from 'nodemailer'
const sendEmail = async (options) => {
// This is the Nodemailer Transporter
const transporter = nodeMailer.createTransport({
service: process.env.EMAIL_SERVICE,
auth: {
user: process.env.SMTP_USERNAME,
pass: process.env.SMTP_PASSWORD,
},
})
// This is the Message Format
const message = {
from: `${process.env.FROM_NAME} <${process.env.FROM_EMAIL}>`,
to: options.email,
subject: options.subject,
html: options.message,
}
await transporter.sendMail(message, (err, info) => {
if (err) {
console.log(err)
} else {
console.log('Message sent: %s', info.messageId)
}
})
}
export default sendEmail
| 1.25 | 1 |
routes/api/commons.js | s1mran/gappy-node | 0 | 15994044 | let express = require("express");
const request = require('request');
const router = express.Router();
const User = require("../../models/User");
const auth = require("../../middleware/auth");
router.get("/ifsc/:code", auth, async (req, res) => {
if (!req.user._id)
res.status(401).send("User unauthorized")
var code = req.params.code;
if (!code)
res.status(400).send('Invalid ifsc code')
request({
url: "https://ifsc.razorpay.com/" + code,
method: "GET"
}, function (error, response, body) {
if (error)
res.status(400).send(error);
if (response)
res.status(200).send(response);
});
})
router.get("/ticker/:symbol", auth, (req, res) => {
if (!req.user._id)
res.status(401).send("User unauthorized")
var symbol = req.params.symbol;
if (!symbol)
res.status(400).send('Invalid currency symbol')
request({
url: "https://api.wazirx.com/sapi/v1/ticker/24hr?symbol=" + symbol,
method: "GET"
}, function (error, response, body) {
if (error)
res.status(400).send(error);
if (response)
res.status(200).send(response);
});
})
module.exports = router; | 1.203125 | 1 |
client/src/utils/firebase.js | ipetrov22/schooly-v2 | 0 | 15994052 | import firebase from 'firebase/app';
import 'firebase/auth';
const firebaseConfig = {
apiKey: "<KEY>",
authDomain: "schooly-v2.firebaseapp.com",
projectId: "schooly-v2",
storageBucket: "schooly-v2.appspot.com",
messagingSenderId: "50682381008",
appId: "1:50682381008:web:aa2b3f61b1bbfc3f6a94d5"
};
firebase.initializeApp(firebaseConfig);
export default firebase; | 0.734375 | 1 |
L6/dox_doc/html/search/functions_4.js | Wittline/Python_scripts | 1 | 15994060 | var searchData=
[
['test_5fget_5fperformance_5fdata_52',['test_get_performance_data',['../class_lab5_1_1_my__tests.html#ad465e9d085cab83f5c29e99b81df4bd0',1,'Lab5::My_tests']]],
['test_5fheap_5fsort_53',['test_heap_sort',['../class_lab5_1_1_my__tests.html#a5b778ce840930ec49023124e95f176fb',1,'Lab5::My_tests']]],
['test_5fmerge_5fsort_54',['test_merge_sort',['../class_lab5_1_1_my__tests.html#a63a8d30d1a8969119c8d7616b3628838',1,'Lab5::My_tests']]],
['test_5fquick_5fsort_55',['test_quick_sort',['../class_lab5_1_1_my__tests.html#aa7c00d58225785c74fcd8363dcdfec83',1,'Lab5::My_tests']]],
['test_5fset_5finput_5fdata_56',['test_set_input_data',['../class_lab5_1_1_my__tests.html#a9894cbd92a95b3d2b7dfcea61bef9df3',1,'Lab5::My_tests']]],
['test_5fset_5foutput_5fdata_57',['test_set_output_data',['../class_lab5_1_1_my__tests.html#a5722784932fb0e61a885bb2d59b146a7',1,'Lab5::My_tests']]]
];
| 0.390625 | 0 |
src/Generator/TES5/NVNM.js | matortheeternal/esp.json | 9 | 15994068 | let {
addDef, uint32, opts, bytes, size,
ckFormId, int16, struct, union, float,
sortKey, array, prefix, def, format,
flags, uint16, conflictType, sorted, subrecord
} = require('../helpers');
module.exports = () => {
addDef('NVNM',
subrecord('NVNM', struct('Geometry', [
opts(uint32('Version'), {
"defaultNativeValue": 12
}),
opts(size(4, bytes('Magic')), {
"defaultEditValue": "3C A0 E9 A5"
}),
ckFormId('Parent Worldspace', ['WRLD', 'NULL']),
union('Parent', 'NVNMParentDecider', [
struct('Coordinates', [
int16('Grid Y'),
int16('Grid X')
]),
ckFormId('Parent Cell', ['CELL'])
]),
opts(prefix(4, array('Vertices',
sortKey([0, 1, 2], struct('Vertex', [
float('X'),
float('Y'),
float('Z')
]))
)), {
"notAlignable": 1
}),
opts(prefix(4, array('Triangles',
struct('Triangle', [
opts(format(int16('Vertex 0'), def('VertexToStr0')), {
"linksToCallback": "VertexLinksTo"
}),
opts(format(int16('Vertex 1'), def('VertexToStr1')), {
"linksToCallback": "VertexLinksTo"
}),
opts(format(int16('Vertex 2'), def('VertexToStr2')), {
"linksToCallback": "VertexLinksTo"
}),
opts(format(int16('Edge 0-1'), def('EdgeToStr0')), {
"linksToCallback": "EdgeLinksTo0"
}),
opts(format(int16('Edge 1-2'), def('EdgeToStr1')), {
"linksToCallback": "EdgeLinksTo1"
}),
opts(format(int16('Edge 2-0'), def('EdgeToStr2')), {
"linksToCallback": "EdgeLinksTo2"
}),
format(uint16('Flags'), flags({
0: 'Edge 0-1 link',
1: 'Edge 1-2 link',
2: 'Edge 2-0 link',
3: 'Deleted',
4: 'No Large Creatures',
5: 'Overlapping',
6: 'Preferred',
7: '',
8: 'Unknown 9',
9: 'Water',
10: 'Door',
11: 'Found',
12: 'Unknown 13',
13: '',
14: '',
15: ''
})),
format(uint16('Cover Flags'), flags({
0: 'Edge 0-1 Cover Value 1/4',
1: 'Edge 0-1 Cover Value 2/4',
2: 'Edge 0-1 Cover Value 3/4',
3: 'Edge 0-1 Cover Value 4/4',
4: 'Edge 0-1 Left',
5: 'Edge 0-1 Right',
6: 'Edge 1-2 Cover Value 1/4',
7: 'Edge 1-2 Cover Value 2/4',
8: 'Edge 1-2 Cover Value 3/4',
9: 'Edge 1-2 Cover Value 4/4',
10: 'Edge 1-2 Left',
11: 'Edge 1-2 Right',
12: 'Unknown 13',
13: 'Unknown 14',
14: 'Unknown 15',
15: 'Unknown 16'
}))
])
)), {
"notAlignable": 1
}),
opts(conflictType('Ignore', prefix(4, array('Edge Links',
conflictType('Ignore', struct('Edge Link', [
conflictType('Ignore', size(4, bytes('Unknown'))),
conflictType('Ignore', ckFormId('Mesh', ['NAVM'])),
conflictType('Ignore', int16('Triangle'))
]))
))), {
"notAlignable": 1
}),
prefix(4, sorted(array('Door Triangles',
sortKey([0, 2], struct('Door Triangle', [
opts(int16('Triangle before door'), {
"linksToCallback": "TriangleLinksTo"
}),
size(4, bytes('Unknown')),
ckFormId('Door', ['REFR'])
]))
))),
opts(prefix(4, array('Cover Triangles',
opts(int16('Triangle'), {
"linksToCallback": "TriangleLinksTo"
})
)), {
"notAlignable": 1
}),
uint32('NavMeshGrid Divisor'),
float('Max X Distance'),
float('Max Y Distance'),
float('Min X'),
float('Min Y'),
float('Min Z'),
float('Max X'),
float('Max Y'),
float('Max Z'),
opts(array('NavMeshGrid',
opts(prefix(4, array('NavMeshGridCell',
opts(int16('Triangle'), {
"linksToCallback": "TriangleLinksTo"
})
)), {
"notAlignable": 1
})
), {
"notAlignable": 1
})
]))
);
}; | 1.351563 | 1 |
Generator.js | sumnerevans/js-utils | 2 | 15994076 | /**
* Creates a generator that yields elements between the start and the stop
* with the given step.
*
* @example array.range(10) => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
* @example array.range(3, 10) => [3, 4, 5, 6, 7, 8, 9]
* @example array.range(3, 10, 2) => [3, 5, 7, 9]
*
* @param {int} begin the beginning of the range, or if this is the only
* parameter, then the end of the range
* @param {int} end the end of the range (not inclusive)
* @param {int} step the step to increment by
*
* @returns {generator} a generator for the range
*/
const range = function*(begin, end, step) {
const start = typeof end === 'undefined' ? 0 : begin;
const stop = end || begin;
const increment = step || 1;
for (let i = start; i < stop; i = i + increment) {
yield i;
}
};
module.exports = {
range: range,
};
| 3.21875 | 3 |
styleguide.config.js | wwwebman/react-implicit-auth | 1 | 15994084 | const path = require('path');
const { name: packageName, version, description } = require('./package.json');
const { theme, styles } = require('./styleguide/styles');
module.exports = {
title: description,
pagePerSection: true,
version,
theme,
styles,
skipComponentsWithoutExample: true,
sections: [
{
components: 'src/**/*.{jsx,tsx,ts,js}',
content: 'README.md',
exampleMode: 'expand',
pagePerSection: true,
sectionDepth: 1,
usageMode: 'expand',
},
],
styleguideDir: './docs',
styleguideComponents: {
StyleGuideRenderer: path.join(
__dirname,
'styleguide/rsg/StyleGuideRenderer',
),
},
getComponentPathLine(p) {
let componentName = path.basename(p).split('.')[0];
if (componentName === 'Methods') {
return '';
}
return `import { ${componentName} } from '${packageName}';`;
},
propsParser: require('react-docgen-typescript').withCustomConfig(
'./tsconfig.json',
).parse,
webpackConfig: {
module: {
rules: [
{
test: /\.(t|j)sx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: {
[packageName]: path.resolve(__dirname, 'src'),
},
},
devtool: 'source-map',
devServer: {
compress: true,
https: true,
},
},
};
| 1.257813 | 1 |
app/scripts/contentscript.js | Jibbarth/Yabb | 0 | 15994092 | // Enable chromereload by uncommenting this line:
//import 'chromereload/devonly'
import elementReady from 'element-ready';
const dom = require('./dom-browse.js');
const hljs = require('highlight.js');
init();
function init()
{
elementReady('.diff-container').then(() => {
highlight();
});
}
/**
* Check when dom change to reapply highlight
*/
function checkChange()
{
elementReady('#pr-tab-content').then(() => {
// Configuration of the observer:
const config = { childList: true, subtree: true };
// Create an observer instance
const observer = new MutationObserver(function (mutations) {
var diff = document.querySelector('.diff-container');
if (null != diff) {
this.disconnect();
highlight();
}
});
const target = document.querySelector('#pr-tab-content');
observer.observe(target, config);
});
}
/**
* Apply highlight on dom
*/
function highlight()
{
var diffContainer = document.querySelectorAll('.diff-container');
diffContainer.forEach(function(diff, index) {
var diffLineBlock = diff.querySelectorAll('.udiff-line');
diffLineBlock.forEach(function(block, i) {
cleanBlock(block);
});
});
checkChange();
}
/**
* Clean a block, guess language, init highlight
*
* @param {HTMLElement} block
*/
function cleanBlock(block){
var language = guessLanguage(block);
var sourceBlock = block.querySelector('pre.source');
if (null != sourceBlock) {
// Don't highlight on patch
if (language == 'patch') {
return;
}
sourceBlock.classList.add(language);
hljs.highlightBlock(sourceBlock);
}
}
/**
* Guess language of htmlElement by finding parents container with filename
* and retrieving extension
*
* @param {HTMLElement} block
*/
function guessLanguage(block)
{
var parent = dom.getParent(block, '.bb-udiff');
var language = parent.dataset.identifier.split('.').pop();
if (language == 'phtml') {
language = 'php';
}
return language;
}
| 1.65625 | 2 |
frontend/components/workspace/chat_item_container.js | Jathrone/Slick | 4 | 15994100 | import { connect } from "react-redux";
import ChatItem from "./chat_item";
import { getUserFromMessage } from "../../reducers/users_selector";
import { openChatItemModal } from "../../actions/chat_item_modal_actions";
const mapStateToProps = (state, ownProps) => {
return {
sender: getUserFromMessage(state, ownProps.message)
}
};
const mapDispatchToProps = (dispatch) => ({
openChatItemModal: (messageId) => dispatch(openChatItemModal(messageId))
})
export default connect(mapStateToProps, mapDispatchToProps)(ChatItem); | 1.117188 | 1 |
server/api/user/user.model.js | leej42/venue-rpi | 0 | 15994108 | 'use strict';
import crypto from 'crypto';
var mongoose = require('bluebird').promisifyAll(require('mongoose'));
import {Schema} from 'mongoose';
import async from 'async';
import Section from '../section/section.model';
import Course from '../course/course.model';
import SectionCtrl from '../section/section.controller';
import SectionEvent from '../sectionevent/sectionevent.model';
const authTypes = ['github', 'twitter', 'facebook', 'google'];
var UserSchema = new Schema({
lastName: String,
firstName: String,
email: {
type: String,
lowercase: true,
select: false
},
role: {
type: String,
default: 'user'
},
isInstructor: Boolean,
password: {
type: String,
select: false
},
provider: {
type: String,
select: false
},
salt: {
type: String,
select: false
},
facebook: {},
twitter: {},
google: {},
github: {}
});
/**
* Virtuals
*/
// Public profile information
UserSchema
.virtual('profile')
.get(function() {
return {
'lastName': this.lastName,
'firstName': this.firstName,
'role': this.role,
'sections': this.sections,
'isInstructor': this.isInstructor,
'_id': this._id
};
});
UserSchema
.virtual('isStudent')
.get(function() {
return !this.isInstructor;
})
.set(function(isStudent){
this.isInstructor = !isStudent;
});
// Non-sensitive info we'll be putting in the token
UserSchema
.virtual('token')
.get(function() {
return {
'_id': this._id,
'role': this.role
};
});
/**
* Validations
*/
// Validate empty email
UserSchema
.path('email')
.validate(function(email) {
if (authTypes.indexOf(this.provider) !== -1) {
return true;
}
return email.length;
}, 'Email cannot be blank');
// Validate empty password
UserSchema
.path('password')
.validate(function(password) {
if (authTypes.indexOf(this.provider) !== -1) {
return true;
}
return password.length;
}, 'Password cannot be blank');
// Validate email is not taken
UserSchema
.path('email')
.validate(function(value, respond) {
var self = this;
return this.constructor.findOneAsync({ email: value })
.then(function(user) {
if (user) {
if (self.id === user.id) {
return respond(true);
}
return respond(false);
}
return respond(true);
})
.catch(function(err) {
throw err;
});
}, 'The specified email address is already in use.');
var validatePresenceOf = function(value) {
return value && value.length;
};
/**
* Pre-save hook
*/
UserSchema
.pre('save', function(next) {
// Handle new/update passwords
if (!this.isModified('password')) {
return next();
}
if (!validatePresenceOf(this.password) && authTypes.indexOf(this.provider) === -1) {
next(new Error('Invalid password'));
}
// Make salt with a callback
this.makeSalt((saltErr, salt) => {
if (saltErr) {
next(saltErr);
}
this.salt = salt;
this.encryptPassword(this.password, (encryptErr, hashedPassword) => {
if (encryptErr) {
next(encryptErr);
}
this.password = <PASSWORD>;
next();
});
});
});
/**
* Methods
*/
UserSchema.methods = {
/**
* Authenticate - check if the passwords are the same
*
* @param {String} password
* @param {Function} callback
* @return {Boolean}
* @api public
*/
authenticate(password, callback) {
if (!callback) {
return this.password === this.encryptPassword(password);
}
this.encryptPassword(password, (err, pwdGen) => {
if (err) {
return callback(err);
}
if (this.password === <PASSWORD>Gen) {
callback(null, true);
} else {
callback(null, false);
}
});
},
/**
* Make salt
*
* @param {Number} byteSize Optional salt byte size, default to 16
* @param {Function} callback
* @return {String}
* @api public
*/
makeSalt(byteSize, callback) {
var defaultByteSize = 16;
if (typeof arguments[0] === 'function') {
callback = arguments[0];
byteSize = defaultByteSize;
} else if (typeof arguments[1] === 'function') {
callback = arguments[1];
}
if (!byteSize) {
byteSize = defaultByteSize;
}
if (!callback) {
return crypto.randomBytes(byteSize).toString('base64');
}
return crypto.randomBytes(byteSize, (err, salt) => {
if (err) {
callback(err);
} else {
callback(null, salt.toString('base64'));
}
});
},
/**
* Encrypt password
*
* @param {String} password
* @param {Function} callback
* @return {String}
* @api public
*/
encryptPassword(password, callback) {
if (!password || !this.salt) {
return null;
}
var defaultIterations = 10000;
var defaultKeyLength = 64;
var salt = new Buffer(this.salt, 'base64');
if (!callback) {
return crypto.pbkdf2Sync(password, salt, defaultIterations, defaultKeyLength)
.toString('base64');
}
return crypto.pbkdf2(password, salt, defaultIterations, defaultKeyLength, (err, key) => {
if (err) {
callback(err);
} else {
callback(null, key.toString('base64'));
}
});
},
getSectionsAsync(opts){
var sections = [];
if (this.isInstructor){
var query = Section.find({instructors: mongoose.Types.ObjectId(this._id) });
}
else{
var query = Section.find({ students : mongoose.Types.ObjectId(this._id)});
}
query = SectionCtrl.getSectionsExtra(query,opts);
return query.lean().execAsync();
},
//withEventSectionNumbers
getEventsAsync(opts){
var events = [];
return this.getSectionsAsync().then((sections) => {
var query = SectionEvent.find({section : {$in: sections}})
.populate('info');
if (opts.withEventSections){
query.populate({
path: 'section',
populate: {
path: 'course',
model: 'Course'
}
});
}
return query.lean().execAsync()
.then((sectionEventsArray)=>{
var events = {};
sectionEventsArray.forEach((sectionEvent)=>{
if(events[sectionEvent.info._id]){
events[sectionEvent.info._id].sectionEvents.push(sectionEvent);
}
else{
events[sectionEvent.info._id] = sectionEvent.info;
events[sectionEvent.info._id].sectionEvents = [sectionEvent];
}
delete sectionEvent.info;
})
return events;
});
})
},
getSectionEventsAsync(opts){
var events = [];
return this.getSectionsAsync().then((sections) => {
var query = SectionEvent.find({section : {$in: sections}})
.populate('info');
if (opts.withEventSections){
query.populate({
path: 'section',
populate: {
path: 'course',
model: 'Course'
}
});
}
return query.execAsync();
})
},
getCoursesAsync(opts){
return this.getSectionsAsync({withSectionsCourse: true})
.then((sections) => {
var courses = {}
sections.forEach((section)=>{
if(courses[section.course._id]){
courses[section.course._id].sections.push(section);
}
else{
courses[section.course._id] = section.course;
courses[section.course._id].sections = [section];
}
delete section.course;
})
return courses;
});
}
};
export default mongoose.model('User', UserSchema);
| 1.585938 | 2 |
src/store/modules/user.js | miyukoarc/rebuild-cy | 0 | 15994116 | import {
getMyInfo,
getUserList,
getAllUserList,
getDetail,
getUserListSelect,
postUserUpdate,
userMaintain,
listSelectAll
} from '@/api/user'
import {
getToken,
setToken,
removeToken
} from '@/utils/auth'
import {
resetRouter
} from '@/router'
const getDefaultState = () => {
return {
token: getToken(),
name: '',
roleCode: '',
roleName: '',
avatar: '',
userId: '',
uuid: '',
/**
* 所有员工列表 无分页
*/
userListAll: [], //user/listAll
listSelect: [],
/**
* 员工列表 有分页
*/
userList: [],
loading: false,
currentRowUserList: {},
currentRowUsers: [],
userPage: {
total: 0,
pageNumber: 0,
pageSize: 0
},
/**
* show off userdetail
*/
userDetail: {}
}
}
const state = getDefaultState()
const mutations = {
TOGGLE_LOADING(state, payload) {
state.loading = payload
},
RESET_STATE: (state) => {
Object.assign(state, getDefaultState())
},
SET_USERINFO: (state, payload) => {
const {
name,
avatar,
roleCode,
roleName,
userId,
uuid
} = payload
state.name = name
state.avatar = avatar
state.roleCode = roleCode
state.roleName = roleName
state.userId = userId
state.uuid = uuid
},
/**
* 保存无分页员工列表
* @param {*} state
* @param {*} payload
*/
SAVE_USERLISTALL(state, payload) {
state.userListAll = payload
},
/**
* 保存员工列表 有分页
* @param {*} state
* @param {*} payload
*/
SAVE_USERLIST(state, payload) {
state.userList = payload
},
SAVE_CURRENTROW(state, payload) {
state.currentRowUserList = payload
},
// 用于批量分配角色和部门
SAVE_CURRENTROWS(state, payload) {
state.currentRowUsers = payload
},
SET_USERPAGE(state, payload) {
const {
pageNumber,
pageSize,
total
} = payload
state.userPage.total = total
state.userPage.pageNumber = pageNumber
state.userPage.pageSize = pageSize
},
/**
* 保存user详细byID
*/
SAVE_SHOWOFFUSER(state, payload) {
state.userDetail = payload
},
/**
* 保存员工列表 无分页(筛选)
*/
SAVE_LISTSELECT(state, payload) {
state.listSelect = payload
}
}
const actions = {
getMyInfo({
commit
}) {
return new Promise((resolve, reject) => {
getMyInfo().then((res) => {
if (!!res.name) {
commit('SET_USERINFO', res)
resolve(res)
} else {
reject()
}
}).catch(err => {
console.error(err)
reject(err)
})
})
},
// remove token
resetToken({
commit
}) {
return new Promise(resolve => {
removeToken() // must remove token first
commit('RESET_STATE')
resolve()
})
},
/**
* 所有员工列表无分页
* @param {*} param0
* @param {*} payload
*/
getAllUserList({
commit
}, payload) {
return new Promise((resolve, reject) => {
getAllUserList(payload).then(res => {
commit('SAVE_USERLISTALL', res.items)
// console.log(res)
resolve(res.items)
}).catch(err => {
reject(err)
})
})
},
/**
* 员工列表 有分页
* @param {*} param0
* @param {object} payload
*/
getUserList({
commit
}, payload) {
commit('TOGGLE_LOADING', true)
return new Promise((resolve, reject) => {
getUserList(payload).then(res => {
commit('SAVE_USERLIST', res.items)
commit('SET_USERPAGE', res)
commit('TOGGLE_LOADING', false)
resolve()
}).catch(err => {
commit('TOGGLE_LOADING', false)
reject(err)
})
})
},
/**
* 获取user详细
* @param {*} param0
* @param {*} payload
*/
getDetail({
commit
}, payload) {
return new Promise((resolve, reject) => {
getDetail(payload).then(res => {
commit('SAVE_SHOWOFFUSER', res)
resolve(res)
}).catch(err => {
reject(err)
})
})
},
/**
* 员工列表 筛选
* @param {*} param0
* @param {*} payload
*/
getUserListSelect({
commit
}, payload) {
return new Promise((resolve, reject) => {
getUserListSelect(payload).then(res => {
commit('SAVE_LISTSELECT', res)
resolve()
}).catch(err => {
reject(err)
})
})
},
user_update({}, payload) {
return new Promise((resolve, reject) => {
postUserUpdate(payload).then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
})
},
postUserUpdate({
commit
}, payload) {
return new Promise((resolve, reject) => {
postUserUpdate(payload).then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
})
},
userMaintain({
commit
}, payload) {
return new Promise((resolve, reject) => {
userMaintain(payload).then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
})
},
listSelectAll({
commit
}, payload) {
return new Promise((resolve, reject) => {
listSelectAll(payload).then(res => {
resolve(res.items)
}).catch(err => {
reject(err)
})
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
| 1.304688 | 1 |
src/main.js | ANF-Studios/Termello | 25 | 15994124 | const { app, BrowserWindow, Menu } = require("electron");
const path = require('path');
const glasstron = require("glasstron");
if (require('electron-squirrel-startup')) {
app.quit();
}
let mainWindow;
let menu = new Menu();
function createWindow() {
mainWindow = new glasstron.BrowserWindow({
autoHideMenuBar: true,
height: 500,
width: 945,
frame: false,
transparent: true,
blur: true,
blurType: "blurbehind",
blurGnomeSigma: 100,
blurCornerRadius: 20,
icon: path.join(__dirname, 'Icons/Terminal.ico'),
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
experimentalFeatures: true
}
});
mainWindow.webContents.once("did-finish-load", function(){
mainWindow.webContents.send("create-titlebar");
})
mainWindow.setMenu(menu);
mainWindow.loadFile("src/pages/index.html");
mainWindow.on("closed", function() {
mainWindow = null;
app.quit();
});
}
app.on("ready", createWindow);
app.on("window-all-closed", function() {
if (process.platform !== "darwin") {
app.quit();
}
});
app.on("activate", function() {
if (mainWindow === null) {
createWindow();
}
});
| 1.453125 | 1 |
app/scripts/game/models/GameModel.js | Mellyn/maxit | 0 | 15994132 | /**
* GameModel.js
*
* @author <NAME> <<EMAIL>>
* @since 0.6.0
*
* @license For the full copyright and license information, please view the LICENSE file that was distributed with
* this source code.
*/
(function () {
var injectList = [];
/**
* @memberof maxit.game
* @ngdoc factory
* @returns {Game}
* @constructor
*/
var GameModel = function () {
/**
*
* @param _gameBoard
* @constructor
*/
var Game = function (_gameBoard) {
var self = this;
var gameBoard = angular.copy(_gameBoard);
self.getUIGameData = function () {
return {
tiles: gameBoard.getBoardTiles(),
gameSize: gameBoard.getFieldSize()
}
};
self.getBoard = function () {
return gameBoard;
};
};
return Game;
};
GameModel.$inject = injectList;
angular.module('maxit.game').factory('GameModel', GameModel);
}());
| 1.179688 | 1 |
front/src/app.services.js | strubix/uno | 0 | 15994140 | import angular from 'angular';
import AuthService from './services/auth.service'
import SocketService from './services/socket.service'
const services = 'app.services';
angular.module(services, [])
.service('AuthService', AuthService)
.service('SocketService', SocketService)
;
export default services; | 0.279297 | 0 |
src/client/service-worker.js | edrlab/webpub-protect | 0 | 15994148 | const _cacheBuster = '__CACHE_BUSTER__';
self.addEventListener('install', (evt) => {
console.log('_SW install', evt);
evt.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', (evt) => {
console.log('_SW activate', evt);
self.clients
.matchAll({
includeUncontrolled: true,
})
.then((clientList) => {
var urls = clientList.map((client) => {
return client.url;
});
console.log('_SW clients:', urls);
});
evt.waitUntil(self.clients.claim());
});
self.addEventListener('message', (evt) => {
console.log('_SW message', evt.data);
evt.source.postMessage('_SW says hello! ==> ' + evt.data);
});
self.addEventListener('fetch', (evt) => {
console.log('_SW fetch', evt.request);
if (evt.request.method != 'GET') {
return;
}
const url = new URL(evt.request.url);
if (
!url.pathname.endsWith('.png') &&
!url.pathname.endsWith('.jpg') &&
!url.pathname.endsWith('.jpeg') &&
!url.pathname.endsWith('.gif')
) {
console.log('_SW fetch bypass: ', url.pathname);
return;
}
console.log('_SW fetch intercept: ', url.pathname);
let req = evt.request.clone();
if (url.pathname.endsWith('edrlab.png')) {
url.pathname = url.pathname.replace('/edrlab.png', '/edrlab_ok.png');
req = new Request(url.toString(), {
method: req.method,
headers: req.headers,
mode: 'same-origin', // otherwise, 'navigate'
credentials: req.credentials, // cookies, etc.
redirect: 'manual', // req.redirect
cache: req.cache,
referrer: req.referrer,
});
console.log('_SW fetch intercept IMAGE: ', url.pathname, url.toString());
}
evt.respondWith(
fetch(req).then((response) => {
return response;
}),
);
// if (event.request.url.includes('/version')) {
// event.respondWith(new Response(version, {
// headers: {
// 'content-type': 'text/plain'
// }
// }));
// }
});
// self.addEventListener('fetch', (event) => {
// event.waitUntil(async () => {
// if (!event.clientId) return;
// const client = await clients.get(event.clientId);
// if (!client) return;
// client.postMessage({
// msg: 'Hey I just got a fetch from you!',
// url: event.request.url,
// });
// });
// });
| 1.203125 | 1 |
geomapaz.js | jkopera/geologic-map-of-arizona | 6 | 15994156 | // Wrapping this in a function allows me to worry less about "polluting the global namespace"
(function () {
// ## Make an object in the global namespace that will house any variables I want to be global
this.geomapaz = {};
// ## Make some private variables:
// - Urls for tile sets
var urls = {
geologicMap: 'http://a.tiles.usgin.org/geo-map-az/tiles.json',
terrainBase: 'azgs.gg2fma89',
roadsAndLabels: 'azgs.gg2gcchk'
},
// - An interaction layer that utilizes UTFGrids
gridLayer = L.mapbox.gridLayer(urls.geologicMap),
// - The map itself, with the terrain as a base layer
map = this.geomapaz.map = L.mapbox.map('map', urls.terrainBase, {
center: [34.1618,-111.6211],
maxBounds: L.latLngBounds([[29.96818929679422,-126.13671875],[38.34395908944491,-97.226318359375]]),
zoom: 7,
maxZoom: 12,
minZoom: 5
});
// ## Add other layers to the map
// - Tiles for the Geologic Map
L.mapbox.tileLayer(urls.geologicMap).addTo(map);
// - Tiles for roads and labels as an overlay
L.mapbox.tileLayer(urls.roadsAndLabels).addTo(map);
// ## Put togther map interactions:
// - Add the grid layer to the map
gridLayer.addTo(map);
// - Add a control to display information from the grid layer
map.addControl(L.mapbox.gridControl(gridLayer, {
sanitizer: function (stuff) { return stuff; }
}));
// ## Show/Hide the Legend
var showLegend = this.geomapaz.showLegend = function (label) {
if (!$('#wrapper').hasClass('legend-showing')) $('#wrapper').addClass('legend-showing');
if (label) {
label = label
.replace('{', 'Cz')
.replace(':', 'Pe')
.replace('}', 'Mz')
.replace('^', 'Tr')
.replace('|', 'Pz')
.replace('*', 'Pn')
.replace('_', 'C')
.replace('=', 'pC')
.replace('<', 'Pr')
.replace('`', 'Y3')
.replace('~', 'Y2');
var currentPosition = $('#legend').scrollTop(),
unitPosition = $('#' + label + '-label').position().top;
$('#legend').scrollTop(currentPosition + unitPosition);
}
};
var hideLegend = this.geomapaz.hideLegend = function () {
$('#wrapper').removeClass('legend-showing');
};
var toggleLineLegend = this.geomapaz.toggleLineLegend = function () {
if ($('#left-legend').hasClass('shown')) {
$('#left-legend').removeClass('shown');
$('#line-legend-triangle').removeClass('left-triangle');
$('#line-legend-triangle').addClass('right-triangle');
} else {
$('#left-legend').addClass('shown');
$('#line-legend-triangle').removeClass('right-triangle');
$('#line-legend-triangle').addClass('left-triangle');
}
}
}).call(this); | 1.46875 | 1 |
src/components/folio/Folio.js | dacrands/port-blog | 0 | 15994164 | import React from 'react'
import ToViewIt from './ToViewIt'
import BergenStem from './BergenStem'
import Blog from './Blog'
import TimesApp from './TimesApp'
// import CardFive from './CardFive'
const Folio = () => (
<section className="folio">
<div className="container">
<header className="folio__header">
<h1>Portfolio</h1>
</header>
<div className="folio__cards">
<ToViewIt />
<BergenStem />
<TimesApp />
<Blog />
{/* <CardFive /> */}
</div>
</div>
</section>
)
export default Folio | 0.925781 | 1 |
tests/reducers/productsReducer.test.js | wombolo/andela-store-manager-frontend | 0 | 15994172 | import productsReducer from '../../src/reducers/productsReducer';
import localStorage from '../__mocks__/localStorageMock';
import {ACTION_TYPES}from '../../src/actions/action-types';
const {
GET_ALL_PRODUCTS, ADD_TO_CART,CART_UPDATED, GET_SINGLE_PRODUCTS,
REMOVE_FROM_CART
} = ACTION_TYPES;
// import mockData from '../__mocks__/mockData';
let newCart = [];
localStorage.setItem('userCart', newCart);
const initialState = {
products:[],
singleProduct:'',
isLoading: true,
cart: newCart
};
const products = {
singleProduct: {
id: 2, title: "Things fall apart", image: "default_pix.png", description: "Book written by <NAME>", price: "42.00", quantity: 3, status: "active",
}
};
describe('Products Reducer', () => {
it('should return the initial state', () => {
expect(productsReducer(undefined, {})).toEqual(initialState);
});
it('should handle GET_ALL_PRODUCTS', () => {
const action = {
type: GET_ALL_PRODUCTS,
payload: products.singleProduct
};
const newState = productsReducer(initialState, action);
expect(newState).toEqual({products: products.singleProduct, singleProduct: '', isLoading: false, cart: newCart});
});
it('should handle GET_SINGLE_PRODUCTS', () => {
const action = {
type: GET_SINGLE_PRODUCTS,
payload: products.singleProduct
};
const newState = productsReducer(initialState, action);
expect(newState.singleProduct).toEqual( products.singleProduct);
});
it('should handle ADD_TO_CART', () => {
const action = {
type: ADD_TO_CART,
payload: products.singleProduct
};
const newState = productsReducer(initialState, action);
expect(newState.cart).toEqual([products.singleProduct]);
});
it('should handle ADD_TO_CART multiple', () => {
const action = {
type: ADD_TO_CART,
payload: products.singleProduct
};
const newState = productsReducer(initialState, action);
expect(newState.cart).toEqual([products.singleProduct]);
});
it('should handle REMOVE_FROM_CART', () => {
const action = {
type: REMOVE_FROM_CART,
payload: products.singleProduct
};
const newState = productsReducer(initialState, action);
expect(newState.cart).toEqual(products.singleProduct);
});
it('should handle CART_UPDATED', () => {
const action = {
type: CART_UPDATED,
};
const newState = productsReducer(initialState, action);
expect(newState.numberInCart).toEqual(1);
});
});
| 1.898438 | 2 |
examples/test-site/dist/ResponseHandler.js | bruno-bert/bodiless-js | 0 | 15994180 | "use strict";
/**
* Copyright © 2019 Johnson & Johnson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
// eslint-disable-next-line arrow-body-style
var isResponseSuccessful = function (res) {
return res.status === 200 || res.status === 201;
};
var handle = function (promise) { return promise
.then(function (res) {
if (!isResponseSuccessful(res)) {
return {
response: false,
message: 'An unknown error has occured.',
};
}
return {
response: true,
message: 'Success!',
};
})
.catch(function (err) {
// Use back-end crafted error message if available.
if (err.response && err.response.data) {
return {
response: false,
message: err.response.data,
};
}
return {
response: false,
message: err.message,
};
}); };
exports.default = handle;
//# sourceMappingURL=ResponseHandler.js.map | 1.375 | 1 |
js/scripts/create-folders.js | ramomar/uniswag-chrome | 0 | 15994188 | /*
Note that this script will run in an iframe with the url
{http, https}://deimos.dgi.uanl.mx/cgi-bin/wspd_cgi.sh/control.p*
*/
const Lang = {
exportButtonText: 'Crear carpetas en Drive',
buttonQuestion: '¿Cómo se va a llamar la carpeta en donde se crearán las carpetas de tus materias?'
};
const Endpoints = {
dev: 'http://localhost:8080/folders',
prod: 'https://uniswag.herokuapp.com/folders'
};
const Scraping = (function () {
function isShortNameCell(index) {
return index % 2 === 0;
}
function extractParentFolderName(parentFolderNameSource) {
function makeParentFolderName(str) {
const components = str.replace(' ', '').split(/-|\s/);
return components[0].substr(0, 3) + '-' +
components[1].substr(0, 3) + ' ' +
components[2];
}
const nameSource =
[].slice.call(parentFolderNameSource).map(e => e.innerHTML)[0];
return makeParentFolderName(nameSource);
}
function extractSubjects(subjectsSource) {
return [].slice.call(subjectsSource)
.filter((e, idx) => isShortNameCell(idx))
.map(e => e.innerHTML);
}
return {
extractSubjects,
extractParentFolderName
};
}());
const Serialization = (function () {
function makeInputFromSubject(subject) {
return $('<input>', {
type: 'hidden',
name: 'subjects',
value: subject
});
}
function makeInputFromParentFolderName(parentFolderName) {
return $('<input>', {
type: 'hidden',
name: 'parentFolderName',
value: parentFolderName
});
}
function makeForm(subjects, parentFolderName, url) {
const form = $('<form>', {
action: url,
method: 'POST',
target: '_blank'
});
form.append(makeInputFromParentFolderName(parentFolderName));
subjects
.map(makeInputFromSubject)
.forEach(s => form.append(s));
return form;
}
return {
makeForm
};
})();
const UI = (function () {
function makeExportButton(onClick) {
return $('<input>', {
type: 'button',
value: Lang.exportButtonText,
class: 'export-btn',
click: onClick
});
}
function placeButton(onClick) {
const btn = makeExportButton(onClick);
const container = $('<td>');
container.append(btn);
$('#id_rpPnlEst td').prepend(container);
}
function askForParentFolderName(defaultParentFolderName) {
return window.prompt(Lang.buttonQuestion, defaultParentFolderName);
}
return {
placeButton,
askForParentFolderName
};
}());
const Heuristics = (function () {
function isScheduleFrame() {
return [].slice.call($('.rpTtlSub'))
.some(e => e.innerHTML.includes('Consulta de Horario'));
}
return {
isScheduleFrame
};
})();
if (Heuristics.isScheduleFrame()) {
UI.placeButton(() => {
const isDev = localStorage.getItem('dev') === 'dev';
const url = isDev ? Endpoints.dev : Endpoints.prod;
const subjectsSource =
document.querySelectorAll('[align=left][valign=MIDDLE]');
const parentFolderNameSource = document.getElementsByClassName('rpSdLbVlr');
const subjects =
Scraping.extractSubjects(subjectsSource);
const defaultParentFolderName =
Scraping.extractParentFolderName(parentFolderNameSource);
const parentFolderName =
UI.askForParentFolderName(defaultParentFolderName);
const form =
Serialization.makeForm(subjects, parentFolderName, url);
if (parentFolderName) {
if (isDev) {
console.log(subjects);
subjects.forEach(console.log);
form.serializeArray().forEach(console.log);
}
form.appendTo('body');
form.submit();
}
});
}
| 1.351563 | 1 |
src/viewModels/ProfessionalProfileViewModel.js | APA2000/-PortfolioApp.Web | 0 | 15994196 | import { computed, makeObservable } from "mobx";
import { ProfessionalProfileRepository } from "../repositories";
export class ProfessionalProfileViewModel {
/**
* @param {Object} param
* @param {ProfessionalProfileRepository} param.professionalProfileRepository
*/
constructor({ professionalProfileRepository }) {
this.__professionalProfileRepository = professionalProfileRepository;
makeObservable(this, {
description: computed,
descriptionParagrapsh: computed
})
}
/**
* Fetch professional profile data from web api.
*
* @param {boolean} force
*/
fetchData = (force = false) => {
this.__professionalProfileRepository.fetchData(force);
}
get description() {
return this.__professionalProfileRepository.description;
}
get descriptionParagrapsh() {
return this.__professionalProfileRepository.description.paragraphs;
}
get dataIsFetched() {
return this.__professionalProfileRepository.dataIsFetched;
}
} | 1.375 | 1 |
Exercises/W04D02_Exercise_03_Express/models/todo.js | Roger-Takeshita/Software_Engineer | 2 | 15994204 | const todos = [
{ todo: 'Feed Dogs', done: true }, // id: 'a1' },
{ todo: 'Learn Express', done: false }, // id: 'a2' },
{ todo: 'Buy Milk', done: false } // id: 'a3' }
];
function getAll() {
return todos;
}
function getOne(id) {
return todos[id];
// return todos.find(todo => todo.id === id);
}
function create(todo) {
// todos.push(todo);
todos.push({ todo, done: false });
}
function deleteOne(id) {
todos.splice(id, 1);
}
function update(id, todo) {
todos[id] = todo;
}
module.exports = {
getAll,
getOne,
create,
deleteOne,
update
};
| 1.289063 | 1 |
tool/lib/vue_api.js | liuguangw/pdf-builder | 8 | 15994212 | const buildFn = require("./build");
function vueApi(vueIo, socket, projectList, currentProject) {
console.log("vue api connected");
let successResponse = (eventName, data) => {
socket.emit(eventName, {
code: 0,
data: data,
message: null
});
};
let errorResponse = (eventName, errorMessage) => {
socket.emit(eventName, {
code: -1,
data: null,
message: errorMessage
});
};
socket.on('app list_project', _ => {
let resultList = [];
for (let itemIndex in projectList) {
let projectInfo = projectList[itemIndex];
let metaInfo = projectInfo.moduleInfo.bookMetaInfo();
resultList.push({
dir: projectInfo.pathInfo.dirShort,
full_path: projectInfo.pathInfo.dirFull,
name: metaInfo.title,
source: metaInfo.fetchScriptSource,
page_url: metaInfo.fetchPage
});
}
socket.emit('app list_project', resultList);
});
socket.on('app select_project', projectDir => {
let evtName = 'app select_project';
let tmpProject = null;
for (let itemIndex in projectList) {
let projectInfo = projectList[itemIndex];
if (projectInfo.pathInfo.dirShort === projectDir) {
tmpProject = projectInfo;
}
}
if (tmpProject !== null) {
currentProject.info = tmpProject;
successResponse(evtName, projectDir);
} else {
errorResponse(evtName, "不存在project: " + projectDir);
}
});
socket.on("app build", () => {
if (currentProject.info !== null) {
let addMessageFn = (appMessage) => {
socket.emit("app message", appMessage);
};
let addErrorFn = (errMessage) => {
socket.emit("app error", errMessage);
};
let buildCompleteFn = () => {
socket.emit("app build_complete");
};
let buildInfo = currentProject.info.moduleInfo.bookMetaInfo();
buildFn(buildInfo, addMessageFn, addErrorFn, buildCompleteFn);
}
});
socket.on('disconnect', () => {
console.log("vue api disconnected");
});
}
module.exports = vueApi; | 1.265625 | 1 |
api/models/User.js | sergiolepore/hexo-plugin-api | 0 | 15994220 |
var bcrypt = require('bcrypt');
/**
* User.js
*
* @module :: Model
* @description :: Describes a user.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
schema: true,
attributes: {
/**
* Username.
*
* @type String
* @example CoolCoder123
*/
username: {
type: 'string',
required: true,
unique: true
},
/**
* User email.
*
* @type String
*/
email: {
type: 'string',
email: true,
required: true,
unique: true
},
/**
* Encrypted user password
*
* @type String
*/
password: {
type: 'string',
required: true,
minLength: 6
},
/**
* Github profile URL.
*
* @type String
* @example https://github.com/coolcoder123
*/
githubProfile: 'string',
/**
* npm profile URL.
*
* @type String
* @example https://www.npmjs.org/~coolcoder123
*/
npmProfile: 'string',
/**
* User website URL.
*
* @type String
* @example http://www.coolcoder123.com/
*/
website: 'string',
/**
* User donations URL.
*
* @type String
* @example "https://www.gittip.com/coolcoder123/"
*/
donationsUrl: 'string',
/**
* User plugins.
*
* @see Plugin
*/
plugins: {
collection: 'Plugin',
via: 'user'
},
/**
* TOken used to validate a reset password operation
*
* @type {String}
*/
resetToken: 'string',
/**
* Record/instance method used to serialize an User object to JSON.
*
* @see http://sailsjs.org/#/documentation/concepts/ORM/Models.html?q=attribute-methods-(ie-record%2Finstance-methods)
*/
toJSON: function() {
var obj = this.toObject();
delete obj.email;
delete obj.password;
delete obj.resetToken;
return obj;
}
},
beforeCreate: function(values, next) {
var password = values.password;
bcrypt.hash(password, 10, function(err, encryptedPassword) {
if (err)
return next(err);
values.password = <PASSWORD>;
next();
});
},
beforeUpdate: function(values, next) {
var password = values.password;
if (!password)
return next();
bcrypt.hash(password, 10, function(err, encryptedPassword) {
if (err)
return next(err);
values.password = <PASSWORD>;
next();
});
}
};
| 1.9375 | 2 |
src/containers/App/selectors.js | FottyM/kr_portfolios | 0 | 15994228 | import { createSelector } from 'reselect'
import decode from 'jwt-decode'
const stateToken = state => state.login.access_token
const localToken = () => {
try {
const token = localStorage.getItem('access_token')
return token
} catch (error) {
return null
}
}
export const tokenSelector = createSelector(
stateToken, localToken,
(stateToken, localToken) => stateToken ? stateToken : localToken
)
export const userIdSelector = createSelector(
tokenSelector, (token) => {
const { user_id } = decode(token)
return user_id ? user_id : null
}
)
| 1.304688 | 1 |
hk/0668_d.js | daodao10/chart | 1 | 15994236 | var data=[['20000103',0.5668],
['20000104',0.5962],
['20000107',0.5447],
['20000111',0.5741],
['20000112',0.5594],
['20000113',0.5741],
['20000114',0.5741],
['20000117',0.5741],
['20000118',0.5741],
['20000120',0.5741],
['20000121',0.6404],
['20000124',0.6477],
['20000126',0.6624],
['20000127',0.6477],
['20000128',0.6477],
['20000203',0.6551],
['20000208',0.6551],
['20000209',0.6624],
['20000210',0.6624],
['20000214',0.6698],
['20000215',0.6624],
['20000216',0.6624],
['20000217',0.6772],
['20000218',0.6698],
['20000221',0.6772],
['20000222',0.6845],
['20000223',0.6992],
['20000224',0.7728],
['20000225',0.7434],
['20000228',0.6919],
['20000229',0.6992],
['20000302',0.7066],
['20000303',0.736],
['20000306',0.7213],
['20000307',0.7287],
['20000308',0.7213],
['20000309',0.7213],
['20000310',0.7066],
['20000313',0.736],
['20000314',0.714],
['20000315',0.7066],
['20000321',0.7728],
['20000322',0.7508],
['20000323',0.7581],
['20000324',0.7581],
['20000327',0.7655],
['20000328',0.736],
['20000329',0.714],
['20000330',0.7066],
['20000403',0.6992],
['20000405',0.6772],
['20000406',0.6845],
['20000414',0.6845],
['20000419',0.6404],
['20000420',0.6551],
['20000505',0.6772],
['20000508',0.6477],
['20000515',0.6477],
['20000516',0.6477],
['20000517',0.6256],
['20000518',0.6256],
['20000523',0.6404],
['20000524',0.6256],
['20000525',0.633],
['20000526',0.6256],
['20000529',0.6404],
['20000530',0.6551],
['20000531',0.6698],
['20000605',0.6698],
['20000607',0.6698],
['20000608',0.6698],
['20000613',0.6698],
['20000614',0.6624],
['20000615',0.6698],
['20000619',0.6727],
['20000622',0.6772],
['20000628',0.6772],
['20000630',0.6698],
['20000703',0.6698],
['20000704',0.6698],
['20000706',0.6698],
['20000707',0.6698],
['20000710',0.6772],
['20000711',0.6698],
['20000713',0.6477],
['20000714',0.6404],
['20000719',0.6256],
['20000720',0.6256],
['20000728',0.6109],
['20000803',0.6036],
['20000808',0.6256],
['20000809',0.633],
['20000810',0.6624],
['20000811',0.6624],
['20000814',0.6698],
['20000822',0.6551],
['20000823',0.6477],
['20000828',0.6477],
['20000901',0.6624],
['20000904',0.6992],
['20000905',0.6992],
['20000906',0.6992],
['20000907',0.6845],
['20000908',0.6992],
['20000912',0.6698],
['20000914',0.6404],
['20000915',0.6404],
['20000918',0.6109],
['20000922',0.6404],
['20000926',0.6183],
['20001005',0.633],
['20001009',0.633],
['20001010',0.6389],
['20001011',0.6183],
['20001012',0.6183],
['20001013',0.6256],
['20001016',0.6256],
['20001017',0.6183],
['20001018',0.6477],
['20001024',0.6477],
['20001027',0.6698],
['20001030',0.6698],
['20001031',0.6698],
['20001101',0.6624],
['20001102',0.6551],
['20001103',0.6772],
['20001106',0.7066],
['20001107',0.6772],
['20001108',0.6624],
['20001109',0.552],
['20001110',0.552],
['20001113',0.552],
['20001114',0.5668],
['20001115',0.552],
['20001116',0.552],
['20001120',0.5815],
['20001121',0.53],
['20001122',0.5447],
['20001123',0.5447],
['20001124',0.53],
['20001127',0.5152],
['20001128',0.4932],
['20001129',0.4858],
['20001130',0.4711],
['20001204',0.449],
['20001205',0.4711],
['20001207',0.4711],
['20001208',0.4711],
['20001211',0.4784],
['20001215',0.5005],
['20001218',0.4784],
['20001220',0.4784],
['20001222',0.4784],
['20010109',0.4784],
['20010110',0.4784],
['20010111',0.4784],
['20010112',0.4932],
['20010118',0.4932],
['20010119',0.5005],
['20010130',0.4564],
['20010131',0.4475],
['20010201',0.449],
['20010208',0.4564],
['20010212',0.4564],
['20010213',0.4564],
['20010219',0.4637],
['20010221',0.4784],
['20010222',0.4784],
['20010227',0.4784],
['20010228',0.4637],
['20010301',0.4564],
['20010302',0.4564],
['20010305',0.449],
['20010306',0.4637],
['20010307',0.4784],
['20010313',0.4564],
['20010315',0.4637],
['20010316',0.4637],
['20010319',0.4637],
['20010321',0.4564],
['20010322',0.449],
['20010323',0.4416],
['20010402',0.4564],
['20010403',0.449],
['20010406',0.4564],
['20010409',0.4637],
['20010410',0.4637],
['20010417',0.4637],
['20010418',0.4637],
['20010423',0.4637],
['20010425',0.4637],
['20010426',0.4784],
['20010427',0.4784],
['20010502',0.4637],
['20010503',0.4711],
['20010504',0.4784],
['20010507',0.4858],
['20010509',0.4784],
['20010510',0.4784],
['20010511',0.4784],
['20010514',0.4784],
['20010515',0.4784],
['20010516',0.5005],
['20010517',0.5079],
['20010518',0.5079],
['20010521',0.5152],
['20010522',0.53],
['20010523',0.5373],
['20010524',0.5373],
['20010525',0.5079],
['20010528',0.5373],
['20010529',0.53],
['20010530',0.552],
['20010601',0.552],
['20010606',0.5447],
['20010608',0.5447],
['20010611',0.5447],
['20010612',0.552],
['20010613',0.552],
['20010614',0.552],
['20010615',0.552],
['20010618',0.552],
['20010619',0.5447],
['20010620',0.552],
['20010621',0.552],
['20010622',0.552],
['20010628',0.5226],
['20010629',0.552],
['20010705',0.552],
['20010709',0.552],
['20010712',0.5152],
['20010713',0.5005],
['20010716',0.5079],
['20010718',0.5668],
['20010720',0.4858],
['20010724',0.5005],
['20010726',0.4784],
['20010730',0.4784],
['20010801',0.4932],
['20010803',0.4858],
['20010806',0.4784],
['20010807',0.4784],
['20010810',0.4858],
['20010815',0.4858],
['20010816',0.4711],
['20010821',0.4784],
['20010823',0.449],
['20010824',0.4343],
['20010827',0.449],
['20010830',0.4564],
['20010903',0.4048],
['20010911',0.3901],
['20010912',0.4416],
['20010914',0.53],
['20010925',0.4048],
['20011004',0.3975],
['20011008',0.368],
['20011009',0.3975],
['20011105',0.4269],
['20011109',0.4048],
['20011218',0.4122],
['20020103',0.3754],
['20020108',0.368],
['20020110',0.368],
['20020114',0.3827],
['20020116',0.3607],
['20020122',0.368],
['20020124',0.368],
['20020204',0.3754],
['20020205',0.3901],
['20020218',0.3901],
['20020225',0.3901],
['20020226',0.3901],
['20020227',0.3901],
['20020228',0.3901],
['20020304',0.3901],
['20020307',0.3901],
['20020312',0.4122],
['20020313',0.4195],
['20020315',0.4269],
['20020321',0.449],
['20020328',0.449],
['20020402',0.449],
['20020409',0.4416],
['20020411',0.4416],
['20020412',0.4416],
['20020417',0.449],
['20020422',0.4564],
['20020425',0.4564],
['20020426',0.449],
['20020430',0.4564],
['20020503',0.4564],
['20020507',0.4564],
['20020508',0.4564],
['20020509',0.4637],
['20020510',0.4637],
['20020513',0.4564],
['20020514',0.4637],
['20020515',0.4858],
['20020516',0.4858],
['20020517',0.4858],
['20020521',0.5079],
['20020522',0.5079],
['20020524',0.4932],
['20020529',0.4932],
['20020531',0.5005],
['20020603',0.4932],
['20020605',0.5005],
['20020611',0.4858],
['20020613',0.5005],
['20020614',0.4932],
['20020617',0.5005],
['20020618',0.4784],
['20020619',0.4784],
['20020620',0.4784],
['20020621',0.4784],
['20020625',0.4784],
['20020627',0.4932],
['20020628',0.4932],
['20020703',0.4784],
['20020704',0.4637],
['20020711',0.4564],
['20020712',0.4784],
['20020715',0.4784],
['20020729',0.4784],
['20020801',0.4048],
['20020805',0.4048],
['20020808',0.368],
['20020904',0.4048],
['20020930',0.4048],
['20021002',0.3901],
['20021016',0.3901],
['20021017',0.3901],
['20021018',0.3975],
['20021031',0.3975],
['20021106',0.3312],
['20021107',0.3901],
['20021113',0.3827],
['20021115',0.3754],
['20021122',0.3754],
['20021127',0.368],
['20021128',0.3607],
['20021129',0.3607],
['20021202',0.3607],
['20021203',0.3386],
['20021205',0.3312],
['20021206',0.3165],
['20021209',0.3165],
['20021211',0.3202],
['20021213',0.3423],
['20021217',0.3533],
['20021218',0.3386],
['20021219',0.3386],
['20021220',0.368],
['20021223',0.3533],
['20021224',0.3386],
['20030113',0.3459],
['20030123',0.3312],
['20030127',0.3312],
['20030128',0.3312],
['20030205',0.368],
['20030206',0.3459],
['20030217',0.3533],
['20030218',0.3459],
['20030224',0.3533],
['20030225',0.3459],
['20030226',0.3533],
['20030228',0.357],
['20030313',0.3607],
['20030317',0.3643],
['20030319',0.368],
['20030321',0.3754],
['20030327',0.368],
['20030401',0.4122],
['20030402',0.368],
['20030409',0.3607],
['20030410',0.3496],
['20030411',0.3496],
['20030422',0.3386],
['20030423',0.3165],
['20030424',0.3091],
['20030425',0.2944],
['20030429',0.265],
['20030430',0.265],
['20030502',0.2834],
['20030505',0.2907],
['20030506',0.2944],
['20030507',0.3312],
['20030509',0.3312],
['20030512',0.3312],
['20030514',0.3312],
['20030516',0.368],
['20030522',0.3239],
['20030526',0.3165],
['20030529',0.3423],
['20030609',0.3239],
['20030611',0.3349],
['20030613',0.3349],
['20030619',0.3165],
['20030626',0.368],
['20030627',0.3901],
['20030707',0.3607],
['20030711',0.3349],
['20030714',0.368],
['20030717',0.3312],
['20030718',0.3312],
['20030722',0.368],
['20030729',0.3459],
['20030730',0.3496],
['20030731',0.3975],
['20030801',0.3975],
['20030804',0.4048],
['20030811',0.3975],
['20030812',0.5226],
['20030813',0.5447],
['20030814',0.5447],
['20030822',0.5005],
['20030825',0.5005],
['20030828',0.4122],
['20030829',0.4269],
['20030901',0.4858],
['20030903',0.5152],
['20030904',0.53],
['20030905',0.5226],
['20030908',0.5226],
['20030916',0.5152],
['20030917',0.3754],
['20030919',0.4416],
['20030922',0.4416],
['20030924',0.4343],
['20031003',0.4932],
['20031007',0.5005],
['20031008',0.552],
['20031009',0.552],
['20031010',0.552],
['20031013',0.552],
['20031014',0.552],
['20031015',0.552],
['20031016',0.5373],
['20031017',0.5594],
['20031020',0.552],
['20031021',0.5741],
['20031022',0.5962],
['20031024',0.5888],
['20031028',0.5447],
['20031029',0.5226],
['20031030',0.5152],
['20031103',0.5741],
['20031104',0.5741],
['20031105',0.4416],
['20031106',0.5741],
['20031107',0.5741],
['20031110',0.53],
['20031111',0.53],
['20031112',0.5226],
['20031113',0.53],
['20031114',0.53],
['20031117',0.5741],
['20031118',0.53],
['20031119',0.53],
['20031121',0.53],
['20031125',0.53],
['20031126',0.53],
['20031127',0.5447],
['20031202',0.53],
['20031203',0.5447],
['20031204',0.552],
['20031205',0.53],
['20031208',0.552],
['20031209',0.5447],
['20031210',0.5447],
['20031211',0.5594],
['20031212',0.5815],
['20031215',0.552],
['20031216',0.5888],
['20031217',0.6036],
['20031218',0.6183],
['20031219',0.6404],
['20031222',0.6477],
['20031223',0.6477],
['20031229',0.6477],
['20040105',0.5962],
['20040106',0.633],
['20040107',0.6477],
['20040108',0.6551],
['20040109',0.6624],
['20040112',0.633],
['20040113',0.6036],
['20040114',0.6036],
['20040115',0.6036],
['20040116',0.6036],
['20040119',0.6109],
['20040120',0.6036],
['20040121',0.6256],
['20040126',0.6624],
['20040127',0.6698],
['20040128',0.6624],
['20040129',0.633],
['20040130',0.633],
['20040202',0.6772],
['20040203',0.6772],
['20040204',0.6845],
['20040205',0.633],
['20040206',0.6404],
['20040209',0.6551],
['20040210',0.6845],
['20040211',0.6845],
['20040212',0.6698],
['20040213',0.6772],
['20040216',0.6845],
['20040217',0.6845],
['20040218',0.6845],
['20040219',0.6698],
['20040220',0.6551],
['20040223',0.6477],
['20040224',0.6477],
['20040226',0.6551],
['20040227',0.6404],
['20040301',0.6404],
['20040302',0.633],
['20040303',0.5962],
['20040304',0.5962],
['20040305',0.633],
['20040308',0.6036],
['20040309',0.5962],
['20040310',0.5962],
['20040311',0.5962],
['20040312',0.5741],
['20040315',0.5962],
['20040317',0.5962],
['20040318',0.5962],
['20040319',0.5962],
['20040322',0.5888],
['20040323',0.5888],
['20040324',0.5741],
['20040325',0.5815],
['20040326',0.5962],
['20040329',0.5962],
['20040330',0.5962],
['20040331',0.5962],
['20040401',0.6109],
['20040402',0.5962],
['20040406',0.633],
['20040407',0.6624],
['20040408',0.6992],
['20040413',0.6992],
['20040414',0.6992],
['20040415',0.6624],
['20040416',0.6919],
['20040419',0.6698],
['20040420',0.6772],
['20040421',0.6772],
['20040504',0.6551],
['20040506',0.5888],
['20040510',0.6551],
['20040511',0.6551],
['20040512',0.6477],
['20040513',0.633],
['20040518',0.6256],
['20040527',0.6256],
['20040531',0.6477],
['20040601',0.633],
['20040603',0.6477],
['20040609',0.6992],
['20040610',0.6992],
['20040611',0.6992],
['20040614',0.6992],
['20040615',0.6992],
['20040616',0.6992],
['20040617',0.6845],
['20040618',0.6845],
['20040621',0.714],
['20040623',0.714],
['20040624',0.6919],
['20040625',0.7213],
['20040628',0.714],
['20040629',0.714],
['20040630',0.7213],
['20040702',0.6992],
['20040705',0.6919],
['20040708',0.736],
['20040709',0.6992],
['20040712',0.7066],
['20040713',0.714],
['20040714',0.7066],
['20040715',0.7287],
['20040716',0.7434],
['20040719',0.8097],
['20040720',0.7802],
['20040721',0.7949],
['20040722',0.8097],
['20040726',0.8097],
['20040728',0.817],
['20040729',0.8097],
['20040730',0.7949],
['20040802',0.7802],
['20040803',0.7876],
['20040804',0.7802],
['20040805',0.8097],
['20040806',0.7876],
['20040811',0.7876],
['20040812',0.8023],
['20040813',0.8097],
['20040816',0.7802],
['20040818',0.7876],
['20040823',0.7876],
['20040825',0.8097],
['20040826',0.817],
['20040827',0.8244],
['20040830',0.8244],
['20040831',0.8317],
['20040901',0.8097],
['20040902',0.8097],
['20040903',0.8244],
['20040906',0.8097],
['20040908',0.7728],
['20040910',0.7728],
['20040913',0.7949],
['20040917',0.8097],
['20040921',0.7876],
['20040922',0.817],
['20040923',0.8097],
['20040924',0.8023],
['20040927',0.8317],
['20040928',0.8391],
['20040930',0.8465],
['20041005',0.8833],
['20041006',0.8759],
['20041007',0.8833],
['20041008',0.8759],
['20041011',0.8685],
['20041012',0.8906],
['20041013',0.898],
['20041014',0.8906],
['20041015',0.8833],
['20041019',0.8685],
['20041020',0.8612],
['20041021',0.8685],
['20041025',0.8612],
['20041026',0.8612],
['20041027',0.8612],
['20041028',0.8906],
['20041029',0.8906],
['20041101',0.8906],
['20041102',0.8906],
['20041103',0.8906],
['20041104',0.8906],
['20041105',0.8906],
['20041108',0.8833],
['20041109',0.8833],
['20041110',0.8906],
['20041112',0.8906],
['20041115',0.898],
['20041116',0.8906],
['20041117',0.898],
['20041118',0.9127],
['20041119',0.9127],
['20041123',0.9127],
['20041124',0.9274],
['20041126',0.9569],
['20041129',0.9716],
['20041130',0.9789],
['20041201',0.9937],
['20041202',0.9789],
['20041203',0.9863],
['20041206',0.9937],
['20041207',0.9863],
['20041208',0.9937],
['20041209',0.9937],
['20041210',0.8833],
['20041213',0.8685],
['20041214',0.8833],
['20041215',0.8906],
['20041216',0.8906],
['20041217',0.9127],
['20041220',0.9053],
['20041221',0.9053],
['20041222',0.9201],
['20041223',0.9201],
['20041224',0.9201],
['20041228',0.9201],
['20041229',0.9421],
['20041230',0.9421],
['20041231',0.9421],
['20050103',0.9716],
['20050104',0.9569],
['20050105',0.9569],
['20050106',0.9201],
['20050107',0.8906],
['20050110',0.8906],
['20050111',0.8906],
['20050113',0.8833],
['20050114',0.898],
['20050117',0.8833],
['20050119',0.9127],
['20050120',0.9127],
['20050121',0.9348],
['20050124',0.9348],
['20050125',0.9569],
['20050126',1.0084],
['20050127',0.9937],
['20050128',1.0231],
['20050131',1.0157],
['20050201',1.0157],
['20050202',1.0084],
['20050203',1.082],
['20050204',1.0893],
['20050207',1.0893],
['20050208',1.1041],
['20050215',1.1041],
['20050216',1.1041],
['20050217',1.1041],
['20050218',1.1114],
['20050221',1.1041],
['20050223',1.0746],
['20050224',1.1041],
['20050225',1.1261],
['20050228',1.1261],
['20050301',1.1261],
['20050302',1.1335],
['20050303',1.1703],
['20050304',1.1703],
['20050307',1.185],
['20050308',1.2586],
['20050309',1.2513],
['20050310',1.2366],
['20050311',1.2292],
['20050314',1.2292],
['20050315',1.2292],
['20050316',1.2292],
['20050317',1.2292],
['20050318',1.2292],
['20050321',1.1629],
['20050322',1.2292],
['20050323',1.2366],
['20050324',1.2366],
['20050329',1.2292],
['20050330',1.2329],
['20050331',1.266],
['20050401',1.2586],
['20050406',1.266],
['20050407',1.2366],
['20050408',1.2366],
['20050412',1.2292],
['20050413',1.2292],
['20050414',1.2513],
['20050415',1.2292],
['20050418',1.2292],
['20050419',1.1777],
['20050420',1.1777],
['20050421',1.1777],
['20050428',1.2071],
['20050503',1.1998],
['20050504',1.1924],
['20050506',1.1629],
['20050509',1.185],
['20050517',1.1041],
['20050518',1.1041],
['20050520',1.1409],
['20050525',1.1188],
['20050526',1.1188],
['20050527',1.1261],
['20050601',1.1114],
['20050602',1.1114],
['20050603',1.1114],
['20050606',1.1041],
['20050607',1.0893],
['20050608',1.0893],
['20050609',1.1114],
['20050610',1.0893],
['20050613',1.1114],
['20050614',1.1041],
['20050616',1.1041],
['20050617',1.0967],
['20050620',1.1041],
['20050621',1.082],
['20050623',1.0967],
['20050627',1.1188],
['20050628',1.1041],
['20050704',1.0673],
['20050705',1.0746],
['20050706',1.1041],
['20050707',1.0893],
['20050708',1.0967],
['20050711',1.1041],
['20050712',1.1188],
['20050713',1.1482],
['20050714',1.1261],
['20050715',1.0525],
['20050718',1.0967],
['20050719',1.0967],
['20050720',1.1188],
['20050721',1.1261],
['20050722',1.1335],
['20050725',1.1335],
['20050726',1.1188],
['20050727',1.1482],
['20050728',1.1114],
['20050729',1.1041],
['20050801',1.1041],
['20050802',1.1041],
['20050803',1.1041],
['20050804',1.1777],
['20050805',1.1409],
['20050808',1.1409],
['20050809',1.1409],
['20050810',1.1409],
['20050811',1.1629],
['20050812',1.1261],
['20050816',1.1335],
['20050817',1.1335],
['20050818',1.1114],
['20050819',1.1114],
['20050824',1.1188],
['20050825',1.1114],
['20050829',1.1335],
['20050830',1.1188],
['20050831',1.1335],
['20050902',1.0893],
['20050905',1.082],
['20050906',1.0746],
['20050907',1.0746],
['20050908',1.1114],
['20050909',1.1114],
['20050913',1.1041],
['20050914',1.0967],
['20050920',1.0967],
['20050921',1.0967],
['20050927',1.0967],
['20050930',1.0967],
['20051006',0.9716],
['20051007',0.9716],
['20051010',0.9789],
['20051012',0.9789],
['20051014',0.9789],
['20051020',0.9495],
['20051021',0.9053],
['20051024',0.8759],
['20051025',0.8538],
['20051026',0.7581],
['20051027',0.8023],
['20051031',0.8097],
['20051103',0.8465],
['20051110',0.8833],
['20051121',0.8759],
['20051122',0.817],
['20051128',0.9201],
['20051202',0.9569],
['20051222',0.9569],
['20051223',0.9716],
['20051229',1.0231],
['20051230',1.0452],
['20060113',0.9127],
['20060116',0.9127],
['20060117',0.898],
['20060119',0.898],
['20060123',0.9642],
['20060124',0.9569],
['20060125',0.9201],
['20060126',0.9569],
['20060127',0.9569],
['20060201',0.9789],
['20060202',0.9642],
['20060203',0.9495],
['20060206',0.8833],
['20060207',0.9789],
['20060208',0.9937],
['20060224',0.9495],
['20060227',0.9642],
['20060228',0.9569],
['20060303',0.9569],
['20060306',0.9569],
['20060307',1.0157],
['20060308',1.0452],
['20060310',1.0231],
['20060314',1.0452],
['20060315',1.0378],
['20060322',0.9789],
['20060327',0.9789],
['20060328',0.9789],
['20060329',0.9642],
['20060403',0.9716],
['20060404',0.9716],
['20060406',0.9127],
['20060407',0.9937],
['20060410',0.9937],
['20060411',0.9937],
['20060412',0.9569],
['20060413',0.9569],
['20060420',0.9716],
['20060427',0.9201],
['20060428',1.0452],
['20060502',0.9937],
['20060503',0.9789],
['20060504',0.9789],
['20060508',1.0305],
['20060509',1.0305],
['20060515',0.9937],
['20060516',0.9937],
['20060517',0.9937],
['20060519',0.9937],
['20060522',0.9937],
['20060523',0.8538],
['20060524',0.8833],
['20060525',0.9274],
['20060530',0.9495],
['20060606',0.8833],
['20060614',0.9421],
['20060616',0.9421],
['20060622',0.9274],
['20060628',1.0378],
['20060629',0.9789],
['20060630',0.9569],
['20060703',0.9716],
['20060707',0.9642],
['20060710',0.9642],
['20060712',0.9421],
['20060719',0.9201],
['20060720',0.9569],
['20060721',0.9789],
['20060724',1.001],
['20060725',1.0378],
['20060726',1.0157],
['20060727',1.0305],
['20060728',1.0305],
['20060731',1.0378],
['20060801',1.0378],
['20060802',1.0599],
['20060804',1.0378],
['20060807',1.0378],
['20060808',1.0378],
['20060810',1.0525],
['20060811',1.0378],
['20060815',1.0378],
['20060818',1.0378],
['20060821',1.0378],
['20060823',1.0378],
['20060824',1.0378],
['20060829',1.0673],
['20060831',1.0378],
['20060904',1.0378],
['20060906',1.0305],
['20060907',1.0452],
['20060908',1.0305],
['20060912',1.0525],
['20060913',0.9716],
['20060914',0.9789],
['20060915',0.9789],
['20060920',0.9716],
['20060921',0.9716],
['20060922',0.9716],
['20060926',0.9789],
['20060929',0.9716],
['20061004',0.9789],
['20061016',0.9716],
['20061018',0.9716],
['20061024',1.0305],
['20061025',1.0305],
['20061102',1.0157],
['20061106',1.0231],
['20061107',1.0231],
['20061108',1.0452],
['20061109',1.0305],
['20061110',1.0599],
['20061121',1.3249],
['20061122',1.347],
['20061123',1.3396],
['20061124',1.3543],
['20061127',1.3617],
['20061128',1.347],
['20061129',1.347],
['20061130',1.3396],
['20061201',1.347],
['20061204',1.347],
['20061205',1.3543],
['20061206',1.3617],
['20061208',1.347],
['20061211',1.3617],
['20061212',1.347],
['20061213',1.347],
['20061214',1.347],
['20061215',1.3543],
['20061218',1.2586],
['20061219',1.1409],
['20061220',1.2145],
['20061221',1.2145],
['20061222',1.2145],
['20061227',1.2145],
['20061228',1.2513],
['20061229',1.2292],
['20070102',1.2292],
['20070103',1.2513],
['20070104',1.2513],
['20070105',1.2513],
['20070108',1.2513],
['20070109',1.2513],
['20070110',1.2513],
['20070111',1.2513],
['20070112',1.2513],
['20070115',1.2881],
['20070116',1.2954],
['20070117',1.3028],
['20070119',1.2513],
['20070122',1.2807],
['20070123',1.266],
['20070124',1.2513],
['20070125',1.2513],
['20070126',1.2513],
['20070129',1.2586],
['20070130',1.3249],
['20070131',1.3175],
['20070202',1.2586],
['20070205',1.3175],
['20070206',1.2954],
['20070207',1.3764],
['20070208',1.369],
['20070209',1.4279],
['20070212',1.3985],
['20070213',1.4279],
['20070214',1.4132],
['20070215',1.3617],
['20070216',1.3617],
['20070221',1.3617],
['20070222',1.3617],
['20070223',1.3249],
['20070227',1.3617],
['20070228',1.3617],
['20070302',1.2954],
['20070305',1.2954],
['20070306',1.3249],
['20070307',1.2439],
['20070309',1.2881],
['20070312',1.2881],
['20070314',1.3617],
['20070315',1.3617],
['20070316',1.3838],
['20070319',1.4206],
['20070320',1.4206],
['20070321',1.4353],
['20070322',1.4647],
['20070323',1.5457],
['20070326',1.4058],
['20070327',0.8538],
['20070328',0.8538],
['20070329',0.8465],
['20070330',0.8391],
['20070402',0.8097],
['20070403',0.7949],
['20070404',0.7581],
['20070410',0.7949],
['20070411',0.8097],
['20070412',0.817],
['20070413',0.7802],
['20070416',0.7876],
['20070417',0.7728],
['20070418',0.7655],
['20070419',0.7655],
['20070420',0.7508],
['20070423',0.7508],
['20070424',0.7508],
['20070425',0.7508],
['20070426',0.7581],
['20070427',0.7508],
['20070430',0.7508],
['20070502',0.7508],
['20070503',0.7581],
['20070504',0.7581],
['20070507',0.7581],
['20070508',0.7508],
['20070509',0.7434],
['20070510',0.7728],
['20070511',0.7434],
['20070514',0.7434],
['20070515',0.7434],
['20070516',0.7434],
['20070517',0.7655],
['20070518',0.7728],
['20070521',0.7655],
['20070522',0.7581],
['20070523',0.8097],
['20070525',0.8023],
['20070528',1.0673],
['20070529',1.0157],
['20070530',0.9642],
['20070531',0.9495],
['20070601',0.9863],
['20070604',0.9569],
['20070605',0.9348],
['20070606',0.9569],
['20070607',0.9569],
['20070608',0.9569],
['20070611',1.0893],
['20070612',1.0525],
['20070613',1.0452],
['20070614',1.0673],
['20070615',1.0893],
['20070618',1.1335],
['20070620',1.0893],
['20070621',1.0599],
['20070622',1.0673],
['20070625',1.0893],
['20070626',1.0893],
['20070627',1.082],
['20070628',1.0673],
['20070629',1.001],
['20070703',0.9569],
['20070704',0.9789],
['20070705',0.9789],
['20070706',0.9642],
['20070709',0.9789],
['20070710',0.9716],
['20070711',0.9642],
['20070712',0.9569],
['20070713',0.9495],
['20070716',0.9569],
['20070717',0.9569],
['20070718',0.9495],
['20070719',0.9569],
['20070720',0.9495],
['20070723',0.9569],
['20070724',0.9642],
['20070725',0.9569],
['20070726',0.9569],
['20070727',0.9348],
['20070730',0.9348],
['20070731',0.9495],
['20070801',0.9274],
['20070802',0.9201],
['20070803',0.9201],
['20070806',0.9127],
['20070807',0.8685],
['20070808',0.8833],
['20070809',0.8833],
['20070810',0.8317],
['20070813',0.8317],
['20070814',0.8391],
['20070815',0.817],
['20070816',0.7728],
['20070817',0.7802],
['20070820',0.8612],
['20070821',0.8833],
['20070822',0.8833],
['20070823',0.898],
['20070824',0.9201],
['20070827',0.8833],
['20070828',0.8391],
['20070829',0.8097],
['20070830',0.8097],
['20070831',0.8097],
['20070903',0.8097],
['20070904',0.7876],
['20070905',0.8023],
['20070906',0.7949],
['20070907',0.7949],
['20070910',0.7802],
['20070911',0.7728],
['20070912',0.7728],
['20070913',0.7581],
['20070914',0.7581],
['20070917',0.7508],
['20070918',0.7508],
['20070919',0.7581],
['20070920',0.7581],
['20070921',0.7655],
['20070924',0.7581],
['20070925',0.7728],
['20070927',0.8023],
['20070928',0.7876],
['20071002',0.7728],
['20071003',0.7728],
['20071004',0.8023],
['20071005',0.8023],
['20071008',0.8023],
['20071009',0.7876],
['20071010',0.8023],
['20071011',0.7876],
['20071012',0.7802],
['20071015',0.8023],
['20071016',0.7728],
['20071017',0.7876],
['20071018',0.7802],
['20071022',0.7655],
['20071023',0.7655],
['20071024',0.7508],
['20071025',0.7581],
['20071026',0.7581],
['20071029',0.7655],
['20071030',0.7581],
['20071031',0.7581],
['20071101',0.7728],
['20071102',0.7508],
['20071105',0.7508],
['20071106',0.7728],
['20071107',0.7655],
['20071108',0.7728],
['20071109',0.7581],
['20071112',0.7581],
['20071113',0.7508],
['20071114',0.7581],
['20071115',0.7655],
['20071116',0.7434],
['20071119',0.7655],
['20071120',0.736],
['20071121',0.736],
['20071122',0.7213],
['20071123',0.7287],
['20071126',0.7287],
['20071127',0.7287],
['20071128',0.7213],
['20071129',0.7287],
['20071130',0.736],
['20071203',0.7434],
['20071204',0.7581],
['20071205',0.7655],
['20071206',0.7581],
['20071207',0.7581],
['20071210',0.7508],
['20071211',0.7581],
['20071212',0.7581],
['20071213',0.7508],
['20071214',0.7581],
['20071217',0.7434],
['20071218',0.7213],
['20071219',0.7434],
['20071220',0.7213],
['20071221',0.7213],
['20071224',0.7287],
['20071227',0.736],
['20071228',0.736],
['20071231',0.7213],
['20080102',0.736],
['20080103',0.736],
['20080104',0.736],
['20080107',0.7213],
['20080108',0.736],
['20080109',0.736],
['20080110',0.736],
['20080111',0.7434],
['20080114',0.7434],
['20080115',0.7287],
['20080116',0.7287],
['20080117',0.7213],
['20080118',0.736],
['20080121',0.736],
['20080122',0.6624],
['20080123',0.6772],
['20080124',0.7287],
['20080125',0.7287],
['20080128',0.6992],
['20080129',0.6992],
['20080130',0.6992],
['20080131',0.6992],
['20080201',0.714],
['20080204',0.714],
['20080205',0.6992],
['20080206',0.736],
['20080211',0.6992],
['20080213',0.7213],
['20080214',0.6992],
['20080215',0.6992],
['20080218',0.7213],
['20080219',0.7287],
['20080220',0.736],
['20080221',0.7213],
['20080222',0.736],
['20080226',0.7287],
['20080227',0.714],
['20080228',0.7066],
['20080229',0.7213],
['20080304',0.6992],
['20080305',0.714],
['20080306',0.7066],
['20080307',0.6992],
['20080310',0.6992],
['20080311',0.6992],
['20080312',0.7213],
['20080317',0.6992],
['20080318',0.6845],
['20080319',0.6992],
['20080325',0.6992],
['20080326',0.6992],
['20080327',0.7066],
['20080328',0.6992],
['20080331',0.7066],
['20080401',0.6992],
['20080402',0.6992],
['20080403',0.6992],
['20080407',0.6992],
['20080408',0.6992],
['20080410',0.7066],
['20080414',0.6992],
['20080415',0.6992],
['20080416',0.6992],
['20080418',0.6624],
['20080421',0.6698],
['20080422',0.6477],
['20080423',0.6624],
['20080424',0.6624],
['20080425',0.6919],
['20080428',0.6551],
['20080429',0.6624],
['20080430',0.6624],
['20080502',0.6772],
['20080505',0.6772],
['20080506',0.6698],
['20080507',0.6624],
['20080508',0.6624],
['20080509',0.6624],
['20080513',0.6772],
['20080515',0.6698],
['20080516',0.6772],
['20080520',0.6624],
['20080521',0.6624],
['20080522',0.6477],
['20080523',0.6624],
['20080526',0.6624],
['20080527',0.6624],
['20080528',0.6624],
['20080529',0.6551],
['20080530',0.6698],
['20080602',0.6698],
['20080604',0.6624],
['20080605',0.6624],
['20080606',0.6624],
['20080610',0.6477],
['20080625',0.633],
['20080626',0.633],
['20080627',0.6183],
['20080630',0.6183],
['20080704',0.6109],
['20080707',0.6109],
['20080709',0.6109],
['20080714',0.6109],
['20080715',0.5888],
['20080716',0.5888],
['20080718',0.5888],
['20080721',0.5888],
['20080722',0.5668],
['20080725',0.5815],
['20080728',0.5741],
['20080729',0.5741],
['20080730',0.5888],
['20080731',0.5888],
['20080804',0.5668],
['20080805',0.5594],
['20080808',0.552],
['20080811',0.552],
['20080812',0.5594],
['20080813',0.5594],
['20080814',0.5888],
['20080815',0.5594],
['20080818',0.5594],
['20080820',0.552],
['20080821',0.552],
['20080825',0.552],
['20080826',0.5447],
['20080827',0.53],
['20080829',0.5152],
['20080901',0.53],
['20080902',0.5152],
['20080904',0.5079],
['20080909',0.4637],
['20080912',0.4637],
['20080917',0.4784],
['20080918',0.4784],
['20080919',0.4784],
['20080924',0.4784],
['20080925',0.4784],
['20080926',0.4637],
['20080929',0.4784],
['20080930',0.4784],
['20081002',0.4564],
['20081006',0.4269],
['20081008',0.4711],
['20081009',0.4711],
['20081010',0.449],
['20081013',0.4343],
['20081014',0.4416],
['20081015',0.4416],
['20081020',0.3975],
['20081021',0.4416],
['20081022',0.4195],
['20081023',0.4122],
['20081024',0.4048],
['20081027',0.3386],
['20081028',0.3312],
['20081029',0.3423],
['20081030',0.368],
['20081031',0.3533],
['20081103',0.357],
['20081104',0.3312],
['20081105',0.3386],
['20081110',0.368],
['20081112',0.368],
['20081113',0.368],
['20081114',0.3754],
['20081117',0.3202],
['20081120',0.3312],
['20081126',0.3128],
['20081203',0.368],
['20081205',0.357],
['20081208',0.3533],
['20081210',0.3423],
['20081211',0.368],
['20081215',0.3312],
['20081217',0.3386],
['20081219',0.2944],
['20081222',0.2981],
['20081229',0.2944],
['20081230',0.3091],
['20090105',0.3165],
['20090106',0.3386],
['20090107',0.3165],
['20090109',0.3165],
['20090113',0.3312],
['20090116',0.368],
['20090122',0.3239],
['20090129',0.2944],
['20090202',0.2981],
['20090209',0.2981],
['20090210',0.3202],
['20090213',0.3312],
['20090216',0.3459],
['20090217',0.368],
['20090218',0.3827],
['20090220',0.3754],
['20090223',0.3827],
['20090224',0.4195],
['20090225',0.368],
['20090226',0.3827],
['20090227',0.368],
['20090302',0.368],
['20090303',0.3607],
['20090304',0.368],
['20090305',0.368],
['20090306',0.4195],
['20090309',0.4195],
['20090310',0.3975],
['20090312',0.3901],
['20090313',0.368],
['20090316',0.3643],
['20090317',0.3496],
['20090318',0.3496],
['20090319',0.3827],
['20090320',0.3754],
['20090323',0.3496],
['20090324',0.368],
['20090325',0.3754],
['20090326',0.368],
['20090327',0.3533],
['20090330',0.368],
['20090331',0.3607],
['20090401',0.3496],
['20090402',0.3533],
['20090403',0.368],
['20090406',0.368],
['20090407',0.3643],
['20090408',0.368],
['20090507',0.714],
['20090508',0.6845],
['20090511',0.6698],
['20090512',0.6551],
['20090513',0.6624],
['20090514',0.6551],
['20090515',0.6551],
['20090518',0.6698],
['20090519',0.6624],
['20090520',0.6624],
['20090521',0.6624],
['20090522',0.6624],
['20090525',0.6698],
['20090526',0.6624],
['20090527',0.6624],
['20090529',0.6772],
['20090601',0.6919],
['20090602',0.6845],
['20090603',0.6919],
['20090604',0.6845],
['20090605',0.6992],
['20090608',0.714],
['20090609',0.7066],
['20090610',0.7802],
['20090611',0.8317],
['20090612',0.8317],
['20090615',0.9201],
['20090616',1.1482],
['20090617',1.4206],
['20090618',1.2807],
['20090619',1.2881],
['20090622',1.2513],
['20090623',1.266],
['20090624',1.2218],
['20090625',1.2218],
['20090626',1.2366],
['20090629',1.2218],
['20090630',1.0893],
['20090702',1.1998],
['20090703',1.1777],
['20090706',1.185],
['20090707',1.185],
['20090708',1.2292],
['20090709',1.2292],
['20090710',1.2734],
['20090713',1.3617],
['20090714',1.3764],
['20090715',1.3322],
['20090716',1.3322],
['20090717',1.369],
['20090720',1.3838],
['20090721',1.347],
['20090722',1.3764],
['20090723',1.3911],
['20090724',1.347],
['20090727',1.3028],
['20090728',1.3028],
['20090729',1.3322],
['20090730',1.3175],
['20090731',1.369],
['20090803',1.3764],
['20090804',1.4426],
['20090805',1.4574],
['20090806',1.4279],
['20090807',1.3911],
['20090810',1.3617],
['20090811',1.3985],
['20090812',1.3838],
['20090813',1.369],
['20090814',1.369],
['20090817',1.3249],
['20090818',1.3396],
['20090819',1.3249],
['20090820',1.3249],
['20090821',1.3102],
['20090824',1.3249],
['20090825',1.3249],
['20090826',1.3249],
['20090827',1.3396],
['20090828',1.2807],
['20090831',1.2513],
['20090901',1.2439],
['20090902',1.3396],
['20090903',1.3102],
['20090904',1.2881],
['20090907',1.3249],
['20090908',1.2807],
['20090909',1.3249],
['20090910',1.2881],
['20090911',1.3985],
['20090914',1.3617],
['20090915',1.3617],
['20090916',1.3543],
['20090917',1.3543],
['20090918',1.3543],
['20090921',1.4647],
['20090922',1.4721],
['20090923',1.4794],
['20090924',1.4794],
['20090925',1.4868],
['20090928',1.4426],
['20090929',1.45],
['20090930',1.47],
['20091002',1.42],
['20091005',1.38],
['20091006',1.45],
['20091007',1.46],
['20091008',1.45],
['20091009',1.6],
['20091012',1.58],
['20091013',1.53],
['20091014',1.63],
['20091015',1.68],
['20091016',1.83],
['20091019',1.94],
['20091020',1.91],
['20091021',2],
['20091022',2.28],
['20091023',2.32],
['20091027',2.3],
['20091028',2.26],
['20091029',2.14],
['20091030',2.15],
['20091102',2.1],
['20091103',2.11],
['20091104',2.16],
['20091105',2.1],
['20091106',1.83],
['20091109',1.83],
['20091110',1.77],
['20091111',2.3],
['20091112',2.28],
['20091113',2.25],
['20091116',2.16],
['20091117',2.2],
['20091118',2.17],
['20091119',2.19],
['20091120',2.08],
['20091123',2.1],
['20091124',2.14],
['20091125',2.09],
['20091126',2.05],
['20091127',2.02],
['20091130',2.01],
['20091201',1.95],
['20091202',1.9],
['20091203',1.9],
['20091204',1.88],
['20091207',1.82],
['20091208',1.77],
['20091209',1.81],
['20091210',1.79],
['20091211',1.75],
['20091214',1.81],
['20091215',1.72],
['20091216',1.81],
['20091217',1.74],
['20091218',1.74],
['20091221',1.79],
['20091222',1.77],
['20091223',1.79],
['20091224',1.76],
['20091228',1.7],
['20091229',1.72],
['20091230',1.7],
['20091231',1.7],
['20100104',1.7],
['20100105',1.62],
['20100106',1.7],
['20100107',1.67],
['20100108',1.64],
['20100111',1.68],
['20100112',1.65],
['20100113',1.65],
['20100114',1.64],
['20100115',1.64],
['20100118',1.62],
['20100119',1.62],
['20100120',1.6],
['20100121',1.5],
['20100122',1.47],
['20100125',1.49],
['20100126',1.54],
['20100127',1.5],
['20100128',1.5],
['20100129',1.5],
['20100201',1.5],
['20100202',1.5],
['20100203',1.5],
['20100204',1.5],
['20100205',1.49],
['20100208',1.48],
['20100209',1.52],
['20100210',1.55],
['20100211',1.58],
['20100212',1.65],
['20100217',1.6],
['20100218',1.6],
['20100219',1.6],
['20100222',1.6],
['20100223',1.67],
['20100224',1.63],
['20100225',1.68],
['20100226',1.64],
['20100301',1.67],
['20100302',1.68],
['20100303',1.67],
['20100304',1.65],
['20100305',1.92],
['20100308',2.25],
['20100309',2],
['20100310',1.99],
['20100311',1.97],
['20100312',2],
['20100315',1.94],
['20100316',1.92],
['20100317',1.98],
['20100318',2.08],
['20100319',2.08],
['20100322',2],
['20100323',1.98],
['20100324',1.99],
['20100325',2.1],
['20100326',2.05],
['20100329',2.09],
['20100330',2.01],
['20100331',2.04],
['20100401',2.03],
['20100407',2.06],
['20100408',2.19],
['20100409',2.23],
['20100412',2.17],
['20100413',2.19],
['20100414',2.2],
['20100415',2.15],
['20100416',2.18],
['20100419',2.15],
['20100420',2.1],
['20100421',2.1],
['20100422',2.09],
['20100423',2.13],
['20100426',2.14],
['20100427',2.14],
['20100428',2.1],
['20100429',2.09],
['20100430',2.05],
['20100503',2.01],
['20100504',2.05],
['20100505',2.01],
['20100506',2.01],
['20100507',1.94],
['20100510',1.93],
['20100511',1.91],
['20100512',1.81],
['20100513',1.8],
['20100514',1.8],
['20100517',1.78],
['20100518',1.75],
['20100519',1.6],
['20100520',1.5],
['20100524',1.6],
['20100525',1.6],
['20100526',1.62],
['20100527',1.7],
['20100528',1.6],
['20100531',1.6],
['20100601',1.67],
['20100602',1.69],
['20100603',1.68],
['20100604',1.68],
['20100607',1.62],
['20100608',1.64],
['20100610',1.61],
['20100611',1.61],
['20100614',1.75],
['20100615',1.63],
['20100617',1.61],
['20100618',1.58],
['20100621',1.6],
['20100622',1.55],
['20100623',1.55],
['20100624',1.54],
['20100625',1.55],
['20100628',1.58],
['20100629',1.54],
['20100630',1.54],
['20100702',1.53],
['20100705',1.53],
['20100707',1.53],
['20100708',1.53],
['20100709',1.53],
['20100712',1.53],
['20100713',1.54],
['20100714',1.55],
['20100716',1.39],
['20100719',1.59],
['20100720',1.55],
['20100721',1.57],
['20100722',1.6],
['20100723',1.59],
['20100726',1.61],
['20100727',1.62],
['20100728',1.63],
['20100729',1.64],
['20100802',1.64],
['20100803',1.61],
['20100804',1.6],
['20100805',1.55],
['20100806',1.57],
['20100809',1.53],
['20100810',1.53],
['20100811',1.53],
['20100813',1.48],
['20100816',1.5],
['20100817',1.52],
['20100818',1.59],
['20100819',1.87],
['20100820',1.8],
['20100823',1.85],
['20100825',1.75],
['20100826',1.73],
['20100827',1.7],
['20100830',1.73],
['20100831',1.65],
['20100901',1.76],
['20100902',1.8],
['20100903',1.83],
['20100906',1.72],
['20100907',1.71],
['20100909',1.68],
['20100910',1.7],
['20100913',1.66],
['20100914',1.7],
['20100915',1.65],
['20100917',1.8],
['20100920',1.81],
['20100921',1.65],
['20100922',1.68],
['20100924',1.72],
['20100927',1.69],
['20100928',1.65],
['20100929',1.67],
['20100930',1.65],
['20101004',1.6],
['20101005',1.65],
['20101007',1.63],
['20101008',1.68],
['20101011',1.68],
['20101012',1.61],
['20101013',1.61],
['20101014',1.61],
['20101015',1.61],
['20101018',1.66],
['20101019',1.68],
['20101020',1.63],
['20101021',1.63],
['20101022',1.68],
['20101025',1.67],
['20101026',1.67],
['20101027',1.78],
['20101028',1.75],
['20101029',1.75],
['20101101',1.75],
['20101102',1.7],
['20101103',1.69],
['20101104',1.71],
['20101105',1.64],
['20101108',1.64],
['20101110',1.64],
['20101112',1.65],
['20101115',1.64],
['20101116',1.65],
['20101117',1.65],
['20101119',1.7],
['20101122',1.65],
['20101123',1.64],
['20101125',1.65],
['20101126',1.63],
['20101129',1.68],
['20101201',1.5],
['20101202',1.51],
['20101203',1.51],
['20101206',1.55],
['20101207',1.62],
['20101208',1.6],
['20101209',1.6],
['20101210',1.58],
['20101213',1.55],
['20101214',1.5],
['20101215',1.5],
['20101216',1.61],
['20101217',1.55],
['20101220',1.6],
['20101221',1.74],
['20101224',1.57],
['20101228',1.57],
['20110104',1.72],
['20110105',1.7],
['20110106',1.72],
['20110107',1.7],
['20110110',1.7],
['20110111',1.7],
['20110112',1.6],
['20110113',1.65],
['20110117',1.69],
['20110118',1.65],
['20110119',1.69],
['20110120',1.61],
['20110125',1.61],
['20110126',1.6],
['20110127',1.58],
['20110128',1.59],
['20110209',1.59],
['20110211',1.55],
['20110215',1.7],
['20110216',1.7],
['20110217',1.72],
['20110218',1.74],
['20110221',1.77],
['20110223',1.71],
['20110224',1.7],
['20110301',1.69],
['20110302',1.69],
['20110309',1.66],
['20110310',1.66],
['20110311',1.68],
['20110314',1.7],
['20110315',1.65],
['20110316',1.64],
['20110317',1.55],
['20110323',1.69],
['20110325',1.55],
['20110330',1.56],
['20110406',1.56],
['20110407',1.7],
['20110408',1.58],
['20110411',1.57],
['20110412',1.59],
['20110413',1.62],
['20110415',1.62],
['20110418',1.6],
['20110419',1.6],
['20110421',1.65],
['20110426',1.65],
['20110428',1.68],
['20110503',1.65],
['20110504',1.63],
['20110506',1.68],
['20110511',1.68],
['20110512',1.55],
['20110513',1.63],
['20110516',1.65],
['20110518',1.59],
['20110520',1.6],
['20110523',1.65],
['20110524',1.55],
['20110525',1.6],
['20110607',1.6],
['20110608',1.6],
['20110609',1.6],
['20110610',1.6],
['20110613',1.6],
['20110614',1.6],
['20110615',1.6],
['20110616',1.6],
['20110620',1.6],
['20110621',1.46],
['20110622',1.51],
['20110623',1.5],
['20110624',1.5],
['20110627',1.5],
['20110628',1.5],
['20110629',1.5],
['20110630',1.5],
['20110704',1.59],
['20110705',1.53],
['20110706',1.53],
['20110707',1.5],
['20110708',1.5],
['20110711',1.5],
['20110712',1.5],
['20110714',1.39],
['20110715',1.49],
['20110719',1.48],
['20110721',1.48],
['20110725',1.5],
['20110726',1.5],
['20110727',1.52],
['20110801',1.51],
['20110809',1.5],
['20110810',1.5],
['20110818',1.46],
['20110819',1.5],
['20110822',1.48],
['20110826',1.5],
['20110831',1.48],
['20110901',1.3],
['20110902',1.4],
['20110905',1.4],
['20110906',1.4],
['20110909',1.26],
['20110914',1.25],
['20110915',1.2],
['20110916',1.18],
['20110919',1.17],
['20110920',1.17],
['20110921',1.17],
['20110922',1.16],
['20110923',1.04],
['20110926',0.9],
['20110927',0.9],
['20110928',0.9],
['20110930',1],
['20111003',1.17],
['20111004',1.15],
['20111006',1.15],
['20111007',1.15],
['20111010',1.18],
['20111011',1.18],
['20111012',1.15],
['20111013',1.15],
['20111014',1.1],
['20111017',1.15],
['20111018',1.15],
['20111019',1.18],
['20111020',1.5],
['20111021',1.45],
['20111026',1.5],
['20111031',1.49],
['20111107',1.3],
['20111111',1.49],
['20111118',1.1],
['20111121',1.15],
['20111129',1.12],
['20111130',1.13],
['20111201',1.15],
['20111205',1.02],
['20111206',1],
['20111207',1.01],
['20111208',1.04],
['20111214',1],
['20111215',1.05],
['20111216',1.05],
['20111223',1.04],
['20111228',1.1],
['20111230',1.1],
['20120103',1.1],
['20120109',1.03],
['20120126',1.1],
['20120131',1.05],
['20120209',1.28],
['20120210',1.11],
['20120220',1.16],
['20120221',1.14],
['20120222',1.14],
['20120223',1.14],
['20120227',1.05],
['20120228',1.2],
['20120302',1.19],
['20120306',1.19],
['20120307',1.23],
['20120309',1.1],
['20120314',1.04],
['20120328',1.01],
['20120410',1.01],
['20120419',0.9],
['20120420',0.99],
['20120427',1],
['20120508',1.1],
['20120509',1.08],
['20120510',1.1],
['20120516',1.12],
['20120518',1.12],
['20120523',1.12],
['20120525',1.1],
['20120531',1.2],
['20120604',1.11],
['20120607',1.2],
['20120612',1.13],
['20120614',1.13],
['20120615',1.13],
['20120618',1.13],
['20120620',1.13],
['20120622',0.95],
['20120625',1.1],
['20120627',1.1],
['20120629',1.11],
['20120704',1.14],
['20120706',1.2],
['20120712',0.99],
['20120713',0.99],
['20120716',0.97],
['20120717',1],
['20120718',1.02],
['20120719',1.05],
['20120720',1],
['20120723',0.95],
['20120724',0.94],
['20120725',0.92],
['20120726',0.91],
['20120727',0.9],
['20120730',0.9],
['20120731',0.91],
['20120801',0.9],
['20120802',0.89],
['20120803',0.89],
['20120806',1],
['20120807',1.01],
['20120808',1.05],
['20120809',0.97],
['20120810',0.96],
['20120813',0.69],
['20120814',0.65],
['20120815',0.69],
['20120816',0.67],
['20120817',0.64],
['20120820',0.66],
['20120821',0.68],
['20120822',0.75],
['20120823',0.75],
['20120824',0.76],
['20120827',0.77],
['20120828',0.82],
['20120829',0.85],
['20120830',0.87],
['20120831',0.94],
['20120903',0.94],
['20120904',0.94],
['20120905',0.94],
['20120906',0.93],
['20120907',1],
['20120910',1],
['20120911',1],
['20120912',1.03],
['20120913',1.01],
['20120914',1.05],
['20120917',1.05],
['20120918',1.03],
['20120919',1.01],
['20120920',1.02],
['20120921',1.01],
['20120924',1],
['20120925',0.96],
['20120926',0.98],
['20120927',0.99],
['20120928',0.98],
['20121003',0.95],
['20121004',0.9],
['20121005',0.9],
['20121008',0.91],
['20121009',0.91],
['20121010',0.91],
['20121011',0.92],
['20121012',0.9],
['20121015',0.9],
['20121016',0.93],
['20121017',0.94],
['20121018',0.85],
['20121019',0.85],
['20121022',0.89],
['20121024',0.89],
['20121025',0.93],
['20121026',0.95],
['20121029',1.03],
['20121030',1.02],
['20121031',0.99],
['20121101',0.98],
['20121102',0.96],
['20121105',1.01],
['20121106',0.99],
['20121107',0.95],
['20121108',0.94],
['20121109',0.99],
['20121112',0.91],
['20121113',0.96],
['20121114',0.94],
['20121115',0.95],
['20121116',0.95],
['20121119',0.95],
['20121120',0.94],
['20121121',0.94],
['20121122',0.95],
['20121123',0.95],
['20121126',0.95],
['20121127',0.94],
['20121128',0.96],
['20121129',0.95],
['20121130',0.94],
['20121203',0.96],
['20121204',0.96],
['20121205',0.95],
['20121206',0.94],
['20121207',0.89],
['20121210',0.9],
['20121211',0.92],
['20121212',0.93],
['20121213',0.94],
['20121214',0.93],
['20121217',0.93],
['20121218',0.93],
['20121219',0.91],
['20121220',0.88],
['20121221',0.92],
['20121224',0.9],
['20121227',0.89],
['20121228',0.89],
['20121231',0.88],
['20130102',0.87],
['20130103',0.87],
['20130104',0.86],
['20130107',0.86],
['20130108',0.88],
['20130109',0.89],
['20130110',0.9],
['20130111',0.94],
['20130114',0.93],
['20130115',0.96],
['20130117',0.93],
['20130118',0.93],
['20130121',0.96],
['20130130',0.85],
['20130131',0.89],
['20130201',0.89],
['20130215',0.85],
['20130218',0.85],
['20130220',0.9],
['20130304',0.87],
['20130305',0.89],
['20130306',0.83],
['20130307',0.87],
['20130308',0.88],
['20130311',0.91],
['20130312',0.93],
['20130313',0.9],
['20130314',0.81],
['20130315',0.83],
['20130318',0.9],
['20130319',0.89],
['20130320',0.89],
['20130321',0.87],
['20130322',0.82],
['20130325',0.85],
['20130326',0.85],
['20130327',0.89],
['20130328',0.86],
['20130402',0.86],
['20130403',0.87],
['20130405',0.85],
['20130408',0.85],
['20130409',0.85],
['20130410',0.85],
['20130411',0.84],
['20130412',0.82],
['20130415',0.76],
['20130416',0.83],
['20130417',0.8],
['20130418',0.81],
['20130419',0.87],
['20130422',0.86],
['20130423',0.85],
['20130424',0.84],
['20130425',0.85],
['20130426',0.8],
['20130429',0.83],
['20130430',0.82],
['20130502',0.82],
['20130503',0.84],
['20130506',0.82],
['20130507',0.87],
['20130508',0.89],
['20130509',0.87],
['20130510',0.86],
['20130513',0.85],
['20130514',0.85],
['20130515',0.82],
['20130516',0.81],
['20130520',0.81],
['20130521',0.81],
['20130522',0.84],
['20130523',0.81],
['20130524',0.77],
['20130527',0.82],
['20130528',0.79],
['20130529',0.79],
['20130530',0.81],
['20130531',0.83],
['20130603',0.82],
['20130604',0.87],
['20130605',0.84],
['20130606',0.85],
['20130607',0.83],
['20130610',0.8],
['20130611',0.82],
['20130613',0.82],
['20130614',0.8],
['20130617',0.8],
['20130618',0.81],
['20130619',0.84],
['20130620',0.85],
['20130621',0.85],
['20130624',0.87],
['20130625',0.83],
['20130626',0.85],
['20130627',0.84],
['20130628',0.83],
['20130702',0.77],
['20130703',0.8],
['20130704',0.81],
['20130705',0.8],
['20130708',0.87],
['20130709',0.8],
['20130710',0.81],
['20130711',0.8],
['20130712',0.82],
['20130715',0.81],
['20130716',0.79],
['20130717',0.77],
['20130718',0.83],
['20130719',0.86],
['20130722',0.83],
['20130723',0.84],
['20130724',0.84],
['20130725',0.84],
['20130726',0.79],
['20130729',0.79],
['20130730',0.79],
['20130731',0.78],
['20130801',0.79],
['20130802',0.79],
['20130805',0.8],
['20130806',0.8],
['20130807',0.79],
['20130808',0.8],
['20130809',0.83],
['20130812',0.83],
['20130813',0.83],
['20130815',0.82],
['20130816',0.82],
['20130819',0.87],
['20130820',0.85],
['20130821',0.84],
['20130822',0.84],
['20130823',0.84],
['20130826',0.86],
['20130827',0.85],
['20130828',0.86],
['20130829',0.84],
['20130830',0.72],
['20130902',0.7],
['20130903',0.73],
['20130904',0.74],
['20130905',0.74],
['20130906',0.76],
['20130909',0.74],
['20130910',0.74],
['20130911',0.75],
['20130912',0.89],
['20130913',0.78],
['20130916',0.84],
['20130917',0.83],
['20130918',0.82],
['20130919',0.81],
['20130923',0.77],
['20130924',0.79],
['20130925',0.77],
['20130926',0.76],
['20130927',0.75],
['20130930',0.73],
['20131003',0.79],
['20131004',0.76],
['20131007',0.74],
['20131008',0.73],
['20131009',0.75],
['20131010',0.76],
['20131011',0.75],
['20131015',0.74],
['20131016',0.76],
['20131017',0.75],
['20131018',0.74],
['20131021',0.73],
['20131022',0.72],
['20131023',0.86],
['20131024',0.85],
['20131025',0.86],
['20131028',0.87],
['20131029',0.83],
['20131030',0.85],
['20131031',0.83],
['20131101',0.83],
['20131104',0.81],
['20131105',0.77],
['20131106',0.91],
['20131107',0.85],
['20131108',0.84],
['20131111',0.84],
['20131112',0.77],
['20131113',0.84],
['20131114',0.8],
['20131115',0.82],
['20131118',0.8],
['20131119',0.8],
['20131120',0.78],
['20131121',0.7],
['20131122',0.7],
['20131125',0.74],
['20131126',0.71],
['20131127',0.71],
['20131128',0.7],
['20131129',0.79],
['20131202',0.74],
['20131203',0.76],
['20131204',0.73],
['20131205',0.72],
['20131206',0.73],
['20131209',0.73],
['20131210',0.72],
['20131211',0.72],
['20131212',0.72],
['20131213',0.72],
['20131216',0.72],
['20131217',0.74],
['20131218',0.73],
['20131219',0.72],
['20131220',0.69],
['20131223',0.68],
['20131224',0.7],
['20131227',0.7],
['20131230',0.7],
['20131231',0.68],
['20140102',0.7],
['20140103',0.7],
['20140106',0.7],
['20140107',0.7],
['20140108',0.7],
['20140109',0.7],
['20140110',0.69],
['20140113',0.73],
['20140114',0.7],
['20140115',0.7],
['20140116',0.7],
['20140117',0.71],
['20140120',0.7],
['20140121',0.72],
['20140122',0.72],
['20140123',0.71],
['20140124',0.71],
['20140127',0.7],
['20140128',0.7],
['20140129',0.7],
['20140130',0.71],
['20140204',0.72],
['20140205',0.72],
['20140206',0.72],
['20140207',0.71],
['20140210',0.71],
['20140211',0.7],
['20140212',0.7],
['20140213',0.7],
['20140214',0.71],
['20140217',0.7],
['20140218',0.7],
['20140219',0.7],
['20140220',0.7],
['20140221',0.7],
['20140224',0.7],
['20140225',0.7],
['20140226',0.7],
['20140227',0.69],
['20140228',0.69],
['20140303',0.71],
['20140304',0.72],
['20140305',0.72],
['20140306',0.72],
['20140307',0.72],
['20140310',0.73],
['20140311',0.72],
['20140312',0.67],
['20140313',0.7],
['20140314',0.72],
['20140317',0.72],
['20140318',0.7],
['20140319',0.7],
['20140320',0.7],
['20140321',0.7],
['20140324',0.7],
['20140325',0.7],
['20140326',0.7],
['20140327',0.7],
['20140328',0.7],
['20140331',0.7],
['20140401',0.7],
['20140402',0.67],
['20140403',0.69],
['20140404',0.69],
['20140408',0.69],
['20140409',0.7],
['20140410',0.7],
['20140411',0.69],
['20140414',0.7],
['20140415',0.7],
['20140416',0.7],
['20140417',0.71],
['20140422',0.7],
['20140423',0.7],
['20140424',0.7],
['20140425',0.7],
['20140428',0.7],
['20140429',0.69],
['20140430',0.69],
['20140502',0.69],
['20140505',0.7],
['20140507',0.68],
['20140508',0.68],
['20140509',0.68],
['20140512',0.69],
['20140513',0.68],
['20140514',0.69],
['20140515',0.72],
['20140516',0.72],
['20140519',0.7],
['20140520',0.71],
['20140521',0.71],
['20140522',0.71],
['20140523',0.7],
['20140526',0.71],
['20140527',0.7],
['20140528',0.7],
['20140529',0.7],
['20140530',0.7],
['20140603',0.7],
['20140604',0.72],
['20140605',0.71],
['20140606',0.7],
['20140609',0.71],
['20140610',0.7],
['20140611',0.71],
['20140612',0.7],
['20140613',0.7],
['20140616',0.72],
['20140617',0.72],
['20140618',0.72],
['20140619',0.72],
['20140620',0.71],
['20140623',0.71],
['20140624',0.71],
['20140625',0.72],
['20140626',0.71],
['20140627',0.71],
['20140630',0.72],
['20140702',0.71],
['20140703',0.7],
['20140704',0.7],
['20140707',0.69],
['20140708',0.69],
['20140709',0.68],
['20140710',0.68],
['20140711',0.69],
['20140714',0.69],
['20140715',0.69],
['20140716',0.68],
['20140717',0.67],
['20140718',0.7],
['20140721',0.68],
['20140722',0.7],
['20140723',0.7],
['20140724',0.71],
['20140725',0.71],
['20140728',0.7],
['20140729',0.7],
['20140730',0.71],
['20140731',0.7],
['20140801',0.69],
['20140804',0.69],
['20140805',0.69],
['20140806',0.69],
['20140807',0.69],
['20140808',0.69],
['20140811',0.68],
['20140812',0.66],
['20140813',0.68],
['20140814',0.7],
['20140815',0.71],
['20140818',0.69],
['20140819',0.69],
['20140820',0.69],
['20140821',0.68],
['20140822',0.67],
['20140825',0.68],
['20140826',0.68],
['20140827',0.68],
['20140828',0.68],
['20140829',0.68],
['20140901',0.68],
['20140902',0.68],
['20140903',0.68],
['20140904',0.68],
['20140905',0.68],
['20140908',0.67],
['20140910',0.67],
['20140911',0.66],
['20140912',0.67],
['20140915',0.67],
['20140916',0.67],
['20140917',0.66],
['20140918',0.65],
['20140919',0.65],
['20140922',0.65],
['20140923',0.65],
['20140924',0.65],
['20140925',0.65],
['20140926',0.68],
['20140929',0.67],
['20140930',0.68],
['20141003',0.68],
['20141006',0.69],
['20141007',0.69],
['20141008',0.68],
['20141009',0.69],
['20141010',0.66],
['20141013',0.66],
['20141014',0.65],
['20141015',0.68],
['20141016',0.67],
['20141017',0.67],
['20141020',0.68],
['20141021',0.67],
['20141022',0.66],
['20141023',0.66],
['20141024',0.65],
['20141027',0.61],
['20141028',0.66],
['20141029',0.66],
['20141030',0.66],
['20141031',0.66],
['20141103',0.67],
['20141104',0.67],
['20141105',0.67],
['20141106',0.67],
['20141107',0.67],
['20141110',0.7],
['20141111',0.69],
['20141112',0.69],
['20141113',0.68],
['20141114',0.67],
['20141117',0.67],
['20141118',0.67],
['20141119',0.67],
['20141120',0.67],
['20141121',0.66],
['20141124',0.67],
['20141125',0.67],
['20141126',0.67],
['20141127',0.67],
['20141128',0.67],
['20141201',0.68],
['20141202',0.68],
['20141203',0.67],
['20141204',0.68],
['20141205',0.69],
['20141208',0.68],
['20141209',0.67],
['20141210',0.67],
['20141211',0.68],
['20141212',0.67],
['20141215',0.67],
['20141216',0.68],
['20141217',0.68],
['20141218',0.68],
['20141219',0.68],
['20141222',0.67],
['20141223',0.67],
['20141224',0.67],
['20141229',0.67],
['20141230',0.67],
['20141231',0.67],
['20150102',0.69],
['20150105',0.68],
['20150106',0.67],
['20150107',0.65],
['20150108',0.65],
['20150109',0.64],
['20150112',0.65],
['20150113',0.65],
['20150114',0.65],
['20150115',0.65],
['20150116',0.6],
['20150119',0.61],
['20150120',0.6],
['20150121',0.6],
['20150122',0.56],
['20150123',0.56],
['20150126',0.56],
['20150127',0.62],
['20150128',0.6],
['20150129',0.6],
['20150130',0.61],
['20150202',0.6],
['20150203',0.62],
['20150204',0.6],
['20150205',0.6],
['20150206',0.6],
['20150209',0.6],
['20150210',0.6],
['20150211',0.6],
['20150212',0.6],
['20150213',0.6],
['20150216',0.59],
['20150217',0.6],
['20150218',0.61],
['20150223',0.55],
['20150224',0.58],
['20150225',0.57],
['20150226',0.58],
['20150227',0.58],
['20150302',0.59],
['20150303',0.59],
['20150304',0.61],
['20150305',0.64],
['20150306',0.6],
['20150309',0.57],
['20150310',0.61],
['20150311',0.6],
['20150312',0.6],
['20150313',0.6],
['20150316',0.57],
['20150317',0.57],
['20150318',0.55],
['20150319',0.55],
['20150320',0.53],
['20150323',0.53],
['20150324',0.52],
['20150325',0.58],
['20150326',0.6],
['20150327',0.58],
['20150330',0.58],
['20150331',0.6],
['20150401',0.6],
['20150402',0.6],
['20150408',0.59],
['20150409',0.58],
['20150410',0.6],
['20150413',0.59],
['20150414',0.59],
['20150415',0.58],
['20150416',0.58],
['20150417',0.58],
['20150420',0.56],
['20150421',0.57],
['20150422',0.58],
['20150423',0.6],
['20150424',0.6],
['20150427',0.59],
['20150428',0.58],
['20150429',0.59],
['20150430',0.61],
['20150504',0.69],
['20150505',0.7],
['20150506',0.7],
['20150507',0.66],
['20150508',0.64],
['20150511',0.64],
['20150512',0.63],
['20150513',0.62],
['20150514',0.62],
['20150515',0.59],
['20150518',0.62],
['20150519',0.6],
['20150520',0.6],
['20150521',0.59],
['20150522',0.63],
['20150526',0.63],
['20150527',0.62],
['20150528',0.8],
['20150529',0.82],
['20150601',0.8],
['20150602',0.81],
['20150603',0.8],
['20150604',0.76],
['20150605',0.79],
['20150608',0.77],
['20150609',0.85],
['20150610',0.78],
['20150611',0.81],
['20150612',0.8],
['20150615',0.8],
['20150616',0.81],
['20150617',0.82],
['20150618',0.79],
['20150619',0.78],
['20150622',0.75],
['20150623',0.75],
['20150624',0.85],
['20150625',0.78],
['20150626',0.84],
['20150629',0.76],
['20150630',0.8],
['20150702',0.77],
['20150703',0.69],
['20150706',0.59],
['20150707',0.58],
['20150708',0.55],
['20150709',0.7],
['20150710',0.69],
['20150713',0.68],
['20150714',0.63],
['20150715',0.62],
['20150716',0.66],
['20150717',0.67],
['20150720',0.67],
['20150721',0.65],
['20150722',0.64],
['20150723',0.6],
['20150724',0.62],
['20150727',0.6],
['20150728',0.6],
['20150729',0.6],
['20150730',0.6],
['20150731',0.59],
['20150803',0.59],
['20150804',0.56],
['20150805',0.59],
['20150806',0.63],
['20150807',0.57],
['20150810',0.56],
['20150811',0.6],
['20150812',0.58],
['20150813',0.54],
['20150814',0.54],
['20150817',0.53],
['20150818',0.46],
['20150819',0.46],
['20150820',0.42],
['20150821',0.39],
['20150824',0.32],
['20150825',0.39],
['20150826',0.38],
['20150827',0.395],
['20150828',0.4],
['20150831',0.42],
['20150901',0.405],
['20150902',0.4],
['20150904',0.42],
['20150907',0.43],
['20150908',0.46],
['20150909',0.45],
['20150910',0.45],
['20150911',0.445],
['20150914',0.445],
['20150915',0.445],
['20150916',0.445],
['20150917',0.445],
['20150918',0.44],
['20150921',0.445],
['20150922',0.47],
['20150923',0.46],
['20150924',0.46],
['20150925',0.45],
['20150929',0.425],
['20150930',0.41],
['20151002',0.41],
['20151005',0.41],
['20151006',0.43],
['20151007',0.43],
['20151008',0.43],
['20151009',0.46],
['20151012',0.45],
['20151013',0.45],
['20151014',0.405],
['20151015',0.425],
['20151016',0.44],
['20151019',0.44],
['20151020',0.43],
['20151022',0.44],
['20151023',0.42],
['20151026',0.42],
['20151027',0.42],
['20151028',0.47],
['20151029',0.435],
['20151030',0.435],
['20151102',0.435],
['20151103',0.43],
['20151104',0.425],
['20151105',0.47],
['20151106',0.46],
['20151109',0.46],
['20151110',0.45],
['20151111',0.48],
['20151112',0.45],
['20151113',0.45],
['20151116',0.43],
['20151117',0.42],
['20151118',0.42],
['20151119',0.42],
['20151120',0.42],
['20151123',0.42],
['20151124',0.42],
['20151125',0.42],
['20151126',0.42],
['20151127',0.42],
['20151130',0.42],
['20151201',0.42],
['20151202',0.42],
['20151203',0.42],
['20151204',0.4],
['20151207',0.415],
['20151208',0.41],
['20151209',0.41],
['20151210',0.4],
['20151211',0.375],
['20151214',0.375],
['20151215',0.375],
['20151216',0.375],
['20151217',0.375],
['20151218',0.375],
['20151221',0.375],
['20151222',0.375],
['20151223',0.375],
['20151224',0.375],
['20151228',0.375],
['20151229',0.375],
['20151230',0.375],
['20151231',0.375],
['20160104',0.375],
['20160105',0.375],
['20160106',0.375],
['20160107',0.375],
['20160108',0.37],
['20160111',0.33],
['20160112',0.34],
['20160113',0.32],
['20160114',0.32],
['20160115',0.32],
['20160118',0.32],
['20160119',0.32],
['20160120',0.32],
['20160121',0.31],
['20160122',0.28],
['20160125',0.33],
['20160126',0.33],
['20160127',0.33],
['20160128',0.33],
['20160129',0.33],
['20160201',0.31],
['20160202',0.31],
['20160203',0.31],
['20160204',0.335],
['20160205',0.335],
['20160211',0.335],
['20160212',0.335],
['20160215',0.3],
['20160216',0.295],
['20160217',0.275],
['20160218',0.31],
['20160219',0.32],
['20160222',0.365],
['20160223',0.36],
['20160224',0.36],
['20160225',0.375],
['20160226',0.375],
['20160229',0.39],
['20160301',0.39],
['20160302',0.41],
['20160303',0.4],
['20160304',0.4],
['20160307',0.4],
['20160308',0.4],
['20160309',0.4],
['20160310',0.4],
['20160311',0.4],
['20160314',0.39],
['20160315',0.39],
['20160316',0.39],
['20160317',0.39],
['20160318',0.38],
['20160321',0.38],
['20160322',0.38],
['20160323',0.38],
['20160324',0.38],
['20160329',0.36],
['20160330',0.36],
['20160331',0.42],
['20160401',0.41],
['20160405',0.4],
['20160406',0.4],
['20160407',0.41],
['20160408',0.36],
['20160411',0.36],
['20160412',0.36],
['20160413',0.34],
['20160414',0.36],
['20160415',0.36],
['20160418',0.34],
['20160419',0.35],
['20160420',0.35],
['20160421',0.35],
['20160422',0.35],
['20160425',0.345],
['20160426',0.35],
['20160427',0.35],
['20160428',0.35],
['20160429',0.41],
['20160503',0.41],
['20160504',0.41],
['20160505',0.41],
['20160506',0.385],
['20160509',0.355],
['20160510',0.36],
['20160511',0.36],
['20160512',0.36],
['20160513',0.36],
['20160516',0.36],
['20160517',0.35],
['20160518',0.35],
['20160519',0.35],
['20160520',0.33],
['20160523',0.33],
['20160524',0.33],
['20160525',0.33],
['20160526',0.32],
['20160527',0.32],
['20160530',0.32],
['20160531',0.32],
['20160601',0.32],
['20160602',0.32],
['20160603',0.32],
['20160606',0.32],
['20160607',0.36],
['20160608',0.36],
['20160610',0.375],
['20160613',0.37],
['20160614',0.37],
['20160615',0.35],
['20160616',0.35],
['20160617',0.35],
['20160620',0.35],
['20160621',0.325],
['20160622',0.325],
['20160623',0.325],
['20160624',0.32],
['20160627',0.32],
['20160628',0.325],
['20160629',0.325],
['20160630',0.325],
['20160704',0.325],
['20160705',0.325],
['20160706',0.325],
['20160707',0.31],
['20160708',0.31],
['20160711',0.315],
['20160712',0.315],
['20160713',0.315],
['20160714',0.31],
['20160715',0.35],
['20160718',0.355],
['20160719',0.355],
['20160720',0.355],
['20160721',0.355],
['20160722',0.355],
['20160725',0.395],
['20160726',0.395],
['20160727',0.395],
['20160728',0.395],
['20160729',0.395],
['20160801',0.4],
['20160803',0.355],
['20160804',0.355],
['20160805',0.355],
['20160808',0.355],
['20160809',0.355],
['20160810',0.355],
['20160811',0.355],
['20160812',0.355],
['20160815',0.355],
['20160816',0.355],
['20160817',0.4],
['20160818',0.345],
['20160819',0.345],
['20160822',0.345],
['20160823',0.365],
['20160824',0.375],
['20160825',0.375],
['20160826',0.375],
['20160829',0.385],
['20160830',0.385],
['20160831',0.385],
['20160901',0.385],
['20160902',0.345],
['20160905',0.345],
['20160906',0.345],
['20160907',0.345],
['20160908',0.345],
['20160909',0.345],
['20160912',0.345],
['20160913',0.345],
['20160914',0.345],
['20160915',0.365],
['20160919',0.365],
['20160920',0.365],
['20160921',0.365],
['20160922',0.41],
['20160923',0.39],
['20160926',0.37],
['20160927',0.37],
['20160928',0.36],
['20160929',0.39],
['20160930',0.35],
['20161003',0.39],
['20161004',0.36],
['20161005',0.38],
['20161006',0.38],
['20161007',0.365],
['20161011',0.385],
['20161012',0.385],
['20161013',0.38],
['20161014',0.4],
['20161017',0.4],
['20161018',0.42],
['20161019',0.39],
['20161020',0.39],
['20161024',0.365],
['20161025',0.355],
['20161026',0.355],
['20161027',0.36],
['20161028',0.36],
['20161031',0.36],
['20161101',0.385],
['20161102',0.385],
['20161103',0.385],
['20161104',0.385],
['20161107',0.375],
['20161108',0.38],
['20161109',0.38],
['20161110',0.395],
['20161111',0.395],
['20161114',0.385],
['20161115',0.385],
['20161116',0.385],
['20161117',0.37],
['20161118',0.37],
['20161121',0.36],
['20161122',0.39],
['20161123',0.38],
['20161124',0.38],
['20161125',0.38],
['20161128',0.365],
['20161129',0.355],
['20161130',0.395],
['20161201',0.395],
['20161202',0.395],
['20161205',0.37],
['20161206',0.37],
['20161207',0.385],
['20161208',0.38],
['20161209',0.38],
['20161212',0.38],
['20161213',0.38],
['20161214',0.38],
['20161215',0.38],
['20161216',0.38],
['20161219',0.385],
['20161220',0.385],
['20161221',0.385],
['20161222',0.405],
['20161223',0.405],
['20161228',0.405],
['20161229',0.405],
['20161230',0.4],
['20170103',0.4],
['20170104',0.39],
['20170105',0.39],
['20170106',0.405],
['20170109',0.38],
['20170110',0.38],
['20170111',0.37],
['20170112',0.37],
['20170113',0.37],
['20170116',0.365],
['20170117',0.365],
['20170118',0.37],
['20170119',0.37],
['20170120',0.365],
['20170123',0.365],
['20170124',0.365],
['20170125',0.365],
['20170126',0.36],
['20170127',0.37],
['20170201',0.36],
['20170202',0.375],
['20170203',0.375],
['20170206',0.36],
['20170207',0.39],
['20170208',0.39],
['20170209',0.39],
['20170210',0.375],
['20170213',0.37],
['20170214',0.37],
['20170215',0.38],
['20170216',0.38],
['20170217',0.38],
['20170220',0.38],
['20170221',0.365],
['20170222',0.37],
['20170223',0.37],
['20170224',0.37],
['20170227',0.37],
['20170228',0.37],
['20170301',0.37],
['20170302',0.385],
['20170303',0.36],
['20170306',0.375],
['20170307',0.375],
['20170308',0.375],
['20170309',0.375],
['20170310',0.375],
['20170313',0.375],
['20170314',0.375],
['20170315',0.375],
['20170316',0.375],
['20170317',0.37],
['20170320',0.37],
['20170321',0.39],
['20170322',0.39],
['20170323',0.39],
['20170324',0.39],
['20170327',0.39],
['20170328',0.41],
['20170329',0.4],
['20170330',0.375],
['20170331',0.375],
['20170403',0.375],
['20170405',0.38],
['20170406',0.355],
['20170407',0.395],
['20170410',0.395],
['20170411',0.385],
['20170412',0.385],
['20170413',0.385],
['20170418',0.385],
['20170419',0.385],
['20170420',0.385],
['20170421',0.385],
['20170424',0.385],
['20170425',0.385],
['20170426',0.36],
['20170427',0.355],
['20170428',0.41],
['20170502',0.41],
['20170504',0.41],
['20170505',0.395],
['20170508',0.395],
['20170509',0.38],
['20170510',0.38],
['20170511',0.37],
['20170512',0.37],
['20170515',0.395],
['20170516',0.42],
['20170517',0.39],
['20170518',0.39],
['20170519',0.38],
['20170522',0.375],
['20170523',0.37],
['20170524',0.37],
['20170525',0.37],
['20170526',0.37],
['20170529',0.37],
['20170531',0.37],
['20170601',0.37],
['20170602',0.37],
['20170605',0.37],
['20170606',0.395],
['20170607',0.385],
['20170608',0.37],
['20170609',0.36],
['20170612',0.375],
['20170613',0.365],
['20170614',0.365],
['20170615',0.365],
['20170616',0.35],
['20170619',0.34],
['20170620',0.355],
['20170621',0.355],
['20170622',0.355],
['20170623',0.355],
['20170626',0.355],
['20170627',0.355],
['20170628',0.355],
['20170629',0.355],
['20170630',0.355],
['20170703',0.355],
['20170704',0.355],
['20170705',0.355],
['20170706',0.355],
['20170707',0.355],
['20170710',0.355],
['20170711',0.355],
['20170712',0.355],
['20170713',0.355],
['20170714',0.355],
['20170717',0.355],
['20170718',0.355],
['20170719',0.355],
['20170720',0.355],
['20170721',0.355],
['20170724',0.355],
['20170725',0.355],
['20170726',0.37],
['20170727',0.37],
['20170728',0.355],
['20170731',0.355],
['20170801',0.355],
['20170802',0.355],
['20170803',0.355],
['20170804',0.37],
['20170807',0.37],
['20170808',0.37],
['20170809',0.37],
['20170810',0.37],
['20170811',0.375],
['20170814',0.375],
['20170815',0.38],
['20170816',0.38],
['20170817',0.38],
['20170818',0.38],
['20170821',0.375],
['20170822',0.355],
['20170824',0.355],
['20170825',0.38],
['20170828',0.36],
['20170829',0.36],
['20170830',0.38],
['20170831',0.36],
['20170901',0.36],
['20170904',0.355],
['20170905',0.355],
['20170906',0.355],
['20170907',0.355],
['20170908',0.355],
['20170911',0.355],
['20170912',0.355],
['20170913',0.355],
['20170914',0.36],
['20170915',0.36],
['20170918',0.36],
['20170919',0.38],
['20170920',0.365],
['20170921',0.365],
['20170922',0.365],
['20170925',0.355],
['20170926',0.355],
['20170927',0.355],
['20170928',0.355],
['20170929',0.355],
['20171003',0.355],
['20171004',0.355],
['20171006',0.355],
['20171009',0.375],
['20171010',0.375],
['20171011',0.375],
['20171012',0.37],
['20171013',0.37],
['20171016',0.365],
['20171017',0.355],
['20171018',0.355],
['20171019',0.355],
['20171020',0.355],
['20171023',0.355],
['20171024',0.355],
['20171025',0.355],
['20171026',0.36],
['20171027',0.355],
['20171030',0.355],
['20171031',0.375],
['20171101',0.375],
['20171102',0.375],
['20171103',0.375],
['20171106',0.375],
['20171107',0.385],
['20171108',0.37],
['20171109',0.4],
['20171110',0.39],
['20171113',0.39],
['20171114',0.4],
['20171115',0.405],
['20171116',0.39],
['20171117',0.74],
['20171120',1.3],
['20171121',0.95],
['20171122',0.89],
['20171123',0.89],
['20171124',1],
['20171127',0.95],
['20171128',0.93],
['20171129',0.93],
['20171130',1.05],
['20171201',1.17],
['20171204',1.15],
['20171205',1.03],
['20171206',1.08],
['20171207',1.07],
['20171208',1.07],
['20171211',0.78],
['20171212',0.7],
['20171213',0.83],
['20171214',0.86],
['20171215',0.82],
['20171218',0.79],
['20171219',0.75],
['20171220',0.72],
['20171221',0.69],
['20171222',0.7],
['20171227',0.73],
['20171228',0.72],
['20171229',0.7],
['20180102',0.68],
['20180103',0.69],
['20180104',0.69],
['20180105',0.68],
['20180108',0.68],
['20180109',0.69],
['20180110',0.69],
['20180111',0.67],
['20180112',0.67],
['20180115',0.62],
['20180116',0.6],
['20180117',0.6],
['20180118',0.57],
['20180119',0.56],
['20180122',0.59],
['20180123',0.59],
['20180124',0.58],
['20180125',0.55],
['20180126',0.56],
['20180129',0.55],
['20180130',0.53],
['20180131',0.53],
['20180201',0.53],
['20180202',0.53],
['20180205',0.52],
['20180206',0.465],
['20180207',0.465],
['20180208',0.48],
['20180209',0.43],
['20180212',0.445],
['20180213',0.425],
['20180214',0.435],
['20180215',0.435],
['20180220',0.445],
['20180221',0.455],
['20180222',0.45],
['20180223',0.68],
['20180226',0.63],
['20180227',0.68],
['20180228',0.66],
['20180301',0.65],
['20180302',0.65],
['20180305',0.65],
['20180306',0.58],
['20180307',0.52],
['20180308',0.61],
['20180309',0.58],
['20180312',0.56],
['20180313',0.54],
['20180314',0.54],
['20180315',0.52],
['20180316',0.5],
['20180319',0.51],
['20180320',0.48],
['20180321',0.485],
['20180322',0.485],
['20180323',0.475],
['20180326',0.475],
['20180327',0.5],
['20180328',0.475],
['20180329',0.5],
['20180403',0.485],
['20180404',0.5],
['20180406',0.5],
['20180409',0.53],
['20180410',0.51],
['20180411',0.48],
['20180412',0.485],
['20180413',0.46],
['20180416',0.49],
['20180417',0.49],
['20180418',0.485],
['20180419',0.46],
['20180420',0.455],
['20180423',0.485],
['20180424',0.48],
['20180425',0.455],
['20180426',0.465],
['20180427',0.48],
['20180430',0.48],
['20180502',0.48],
['20180503',0.48],
['20180504',0.48],
['20180507',0.45],
['20180508',0.45],
['20180509',0.455],
['20180510',0.46],
['20180511',0.49],
['20180514',0.49],
['20180515',0.51],
['20180516',0.53],
['20180517',0.51],
['20180518',0.51],
['20180521',0.53],
['20180523',0.53],
['20180524',0.475],
['20180525',0.475],
['20180528',0.475],
['20180529',0.53],
['20180530',0.49],
['20180531',0.49],
['20180601',0.48],
['20180604',0.48],
['20180605',0.485],
['20180606',0.485],
['20180607',0.485],
['20180608',0.485],
['20180611',0.54],
['20180612',0.54],
['20180613',0.52],
['20180614',0.52],
['20180615',0.485],
['20180619',0.445],
['20180620',0.445],
['20180621',0.445],
['20180622',0.45],
['20180625',0.45],
['20180626',0.44],
['20180627',0.43],
['20180628',0.43],
['20180629',0.43],
['20180703',0.43],
['20180704',0.435],
['20180705',0.435],
['20180706',0.435],
['20180709',0.435],
['20180710',0.43],
['20180711',0.42],
['20180712',0.425],
['20180713',0.43],
['20180716',0.43],
['20180717',0.43],
['20180718',0.46],
['20180719',0.46],
['20180720',0.48],
['20180723',0.46],
['20180724',0.5],
['20180725',0.54],
['20180726',0.54],
['20180727',0.495],
['20180730',0.495],
['20180731',0.51],
['20180801',0.53],
['20180802',0.54],
['20180803',0.57],
['20180806',0.57],
['20180807',0.57],
['20180808',0.58],
['20180809',0.57],
['20180810',0.57],
['20180813',0.61],
['20180814',0.66],
['20180815',0.63],
['20180816',0.65],
['20180817',0.69],
['20180820',0.68],
['20180821',0.65],
['20180822',0.64],
['20180823',0.64],
['20180824',0.65],
['20180827',0.65],
['20180828',0.65],
['20180829',0.65],
['20180830',0.62],
['20180831',0.62],
['20180903',0.62],
['20180904',0.65],
['20180905',0.65],
['20180906',0.69],
['20180907',0.66],
['20180910',0.66],
['20180911',0.66],
['20180912',0.65],
['20180913',0.65],
['20180914',0.65],
['20180917',0.64],
['20180918',0.64],
['20180919',0.64],
['20180920',0.64],
['20180921',0.64],
['20180924',0.64],
['20180926',0.65],
['20180927',0.64],
['20180928',0.56],
['20181002',0.56],
['20181003',0.56],
['20181004',0.56],
['20181005',0.56],
['20181008',0.59],
['20181009',0.52],
['20181010',0.52],
['20181011',0.53],
['20181012',0.53],
['20181015',0.53],
['20181016',0.53],
['20181018',0.53],
['20181019',0.53],
['20181022',0.52],
['20181023',0.51],
['20181024',0.47],
['20181025',0.465],
['20181026',0.44],
['20181029',0.46],
['20181030',0.46],
['20181031',0.41],
['20181101',0.41],
['20181102',0.39],
['20181105',0.39],
['20181106',0.39],
['20181107',0.39],
['20181108',0.39],
['20181109',0.36],
['20181112',0.35],
['20181113',0.355],
['20181114',0.355],
['20181115',0.355],
['20181116',0.355],
['20181119',0.355],
['20181120',0.355],
['20181121',0.355],
['20181122',0.355],
['20181123',0.355],
['20181126',0.355],
['20181127',0.355],
['20181128',0.355],
['20181129',0.355],
['20181130',0.355],
['20181203',0.36],
['20181204',0.36],
['20181205',0.38],
['20181206',0.38],
['20181207',0.39],
['20181210',0.4],
['20181211',0.4],
['20181212',0.4],
['20181213',0.4],
['20181214',0.4],
['20181217',0.46],
['20181218',0.46],
['20181219',0.455],
['20181220',0.455],
['20181221',0.455],
['20181224',0.455],
['20181227',0.5],
['20181228',0.5],
['20181231',0.5],
['20190102',0.5],
['20190103',0.5],
['20190104',0.5],
['20190107',0.52],
['20190108',0.57],
['20190109',0.5],
['20190110',0.55],
['20190111',0.55],
['20190114',0.55],
['20190115',0.55],
['20190116',0.55],
['20190117',0.55],
['20190118',0.55],
['20190121',0.55],
['20190122',0.55],
['20190123',0.55],
['20190124',0.55],
['20190125',0.55],
['20190128',0.55],
['20190129',0.54],
['20190130',0.54],
['20190131',0.5],
['20190201',0.5],
['20190204',0.5],
['20190208',0.5],
['20190211',0.435],
['20190212',0.44],
['20190213',0.455],
['20190214',0.455],
['20190215',0.43],
['20190218',0.43],
['20190219',0.44],
['20190220',0.44],
['20190221',0.44],
['20190222',0.44],
['20190225',0.44],
['20190226',0.47],
['20190227',0.45],
['20190228',0.45],
['20190301',0.44],
['20190304',0.41],
['20190305',0.42],
['20190306',0.42],
['20190307',0.41],
['20190308',0.41],
['20190311',0.41],
['20190312',0.41],
['20190313',0.41],
['20190314',0.415],
['20190315',0.415],
['20190318',0.415],
['20190319',0.415],
['20190320',0.415],
['20190321',0.45],
['20190322',0.43],
['20190325',0.43],
['20190326',0.4],
['20190327',0.4],
['20190328',0.4],
['20190329',0.4],
['20190401',0.4],
['20190402',0.435],
['20190403',0.435],
['20190404',0.43],
['20190408',0.43],
['20190409',0.4],
['20190410',0.4],
['20190411',0.4],
['20190412',0.365],
['20190415',0.365],
['20190416',0.38],
['20190417',0.38],
['20190418',0.38],
['20190423',0.38],
['20190424',0.38],
['20190425',0.38],
['20190426',0.38],
['20190429',0.355],
['20190430',0.355],
['20190502',0.355],
['20190503',0.355],
['20190506',0.355],
['20190507',0.355],
['20190508',0.35],
['20190509',0.345],
['20190510',0.375],
['20190514',0.35],
['20190515',0.36],
['20190516',0.36],
['20190517',0.36],
['20190520',0.36],
['20190521',0.335],
['20190522',0.335],
['20190523',0.335],
['20190524',0.33],
['20190527',0.33],
['20190528',0.34],
['20190529',0.34],
['20190530',0.41],
['20190531',0.37],
['20190603',0.37],
['20190604',0.33],
['20190605',0.33],
['20190606',0.33],
['20190610',0.325],
['20190611',0.33],
['20190612',0.33],
['20190613',0.33],
['20190614',0.33],
['20190617',0.33],
['20190618',0.33],
['20190619',0.365],
['20190620',0.385],
['20190621',0.38],
['20190624',0.375],
['20190625',0.43],
['20190626',0.43],
['20190627',0.43],
['20190628',0.365],
['20190702',0.355],
['20190703',0.355],
['20190704',0.36],
['20190705',0.36],
['20190708',0.33],
['20190709',0.33],
['20190710',0.35],
['20190711',0.35],
['20190712',0.345],
['20190715',0.345],
['20190716',0.345],
['20190717',0.345],
['20190718',0.345],
['20190719',0.345],
['20190722',0.345],
['20190723',0.345],
['20190724',0.345],
['20190725',0.345],
['20190726',0.345],
['20190729',0.345],
['20190730',0.345],
['20190731',0.345],
['20190801',0.345],
['20190802',0.345],
['20190805',0.325],
['20190806',0.32],
['20190807',0.32],
['20190808',0.32],
['20190809',0.32],
['20190812',0.325],
['20190813',0.325],
['20190814',0.32],
['20190815',0.3],
['20190816',0.32],
['20190819',0.32],
['20190820',0.305],
['20190821',0.31],
['20190822',0.31],
['20190823',0.31],
['20190826',0.31],
['20190827',0.32],
['20190828',0.32],
['20190829',0.32],
['20190830',0.32]];
var source='finance.yahoo.com'; | 0.519531 | 1 |
src/upload/previewImage.js | zbfe/zui | 5 | 15994244 | /**
* @file html5预览图片
* @author fe.xiaowu
* @todo canvas缩略图
*/
define(function (require) {
'use strict';
/**
* 预览
*
* @type {Object}
*/
var Preview = {
/**
* 转换对象为blob链接
*
* @param {Object} file 文件对象
*
* @return {string} 文件路径
*/
createObjectURL: function (file) {
var url = window.URL || window.webkitURL;
if (url) {
return url.createObjectURL(file);
}
return '';
}
};
return Preview;
});
| 1.3125 | 1 |
resources/js/app.js | yanarowana123/radev | 0 | 15994252 | require('./bootstrap');
import Alpine from 'alpinejs';
window.Alpine = Alpine;
Alpine.start();
document.querySelectorAll('.delete-product__btn').forEach(btn => {
btn.addEventListener('click', event => {
let url = `/schools/${event.target.dataset.id}`;
axios.delete(url).then(response => window.location.reload());
})
})
document.querySelectorAll('.delete-employee__btn').forEach(btn => {
btn.addEventListener('click', event => {
let url = `/employees/${event.target.dataset.id}`;
axios.delete(url).then(response => window.location.reload());
})
})
| 0.929688 | 1 |
vinal/resources/plot_graph_iterations.js | henryrobbins/vinal | 2 | 15994260 | /** @type {integer} */
var iteration = 0
/**
* Increment iteration and update n Div.
*/
function increment_iteration() {
if ((parseInt(n.text) + 1) < parseInt(k.text)) {
n.text = (parseInt(n.text) + 1).toString()
}
iteration = parseInt(n.text)
}
/**
* Decrement iteration and update n Div.
*/
function decrement_iteration() {
if ((parseInt(n.text) - 1) >= 0) {
n.text = (parseInt(n.text) - 1).toString()
}
iteration = parseInt(n.text)
}
/**
* Update which nodes are highlighted given the current iteration.
*/
function nodes_update() {
var in_tree = source.data['nodes'][iteration]
for (let i = 0; i < nodes_src.data['line_color'].length ; i++) {
if (in_tree.includes(i)) {
nodes_src.data['fill_color'][i] = PRIMARY_DARK_COLOR
nodes_src.data['line_color'][i] = PRIMARY_DARK_COLOR
} else {
nodes_src.data['fill_color'][i] = PRIMARY_LIGHT_COLOR
nodes_src.data['line_color'][i] = PRIMARY_DARK_COLOR
}
}
nodes_src.change.emit()
}
/**
* Update which subset of edges are highlighted given the current iteration.
*/
function edge_subset_update() {
edge_subset_src.data['xs'] = source.data['edge_xs'][iteration]
edge_subset_src.data['ys'] = source.data['edge_ys'][iteration]
edge_subset_src.change.emit()
}
/**
* Update which swaps are updated given the current iteration
*/
function swaps_update() {
swaps_src.data['swaps_before_x'] = source.data['swaps_before_x'][iteration]
swaps_src.data['swaps_before_y'] = source.data['swaps_before_y'][iteration]
swaps_src.data['swaps_after_x'] = source.data['swaps_after_x'][iteration]
swaps_src.data['swaps_after_y'] = source.data['swaps_after_y'][iteration]
swaps_src.change.emit()
}
/**
* Update which table is shown given the current iteration.
*/
function table_update() {
table_src.data = source.data['tables'][iteration]
}
/**
* Update which cost is shown given the current iteration.
*/
function cost_update() {
cost.text = source.data['costs'][iteration].toFixed(1)
}
/**
* Update done Div based on the current iteration.
*/
function done_update() {
if (iteration == parseInt(k.text) - 1) {
done.text = "done."
} else {
done.text = ""
}
}
// BEGIN FUNCTION CALLING
| 2.28125 | 2 |
public/modules/subjects/services/subjects.client.service.js | duyet/admissions | 0 | 15994268 | 'use strict';
//Subjects service used to communicate Subjects REST endpoints
angular.module('subjects').factory('Subjects', ['$resource',
function($resource) {
return $resource('subjects/:subjectId', { subjectId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}
]); | 1.132813 | 1 |
crates/swc/tests/tsc-references/tsxAttributeResolution2x_es5.2.minified.js | mengxy/swc | 21,008 | 15994276 | React.createElement("test1", {
c1: function(x) {
return x.length;
}
}), React.createElement("test1", {
"data-c1": function(x) {
return x.leng;
}
}), React.createElement("test1", {
c1: function(x) {
return x.leng;
}
});
| 0.917969 | 1 |
frontend/fleet/entities/invites.js | groob/fleetdm-fleet | 1 | 15994284 | import endpoints from "fleet/endpoints";
import helpers from "fleet/helpers";
export default (client) => {
return {
create: (formData) => {
const { INVITES } = endpoints;
return client
.authenticatedPost(client._endpoint(INVITES), JSON.stringify(formData))
.then((response) => helpers.addGravatarUrlToResource(response.invite));
},
destroy: (invite) => {
const { INVITES } = endpoints;
const endpoint = `${client._endpoint(INVITES)}/${invite.id}`;
return client.authenticatedDelete(endpoint);
},
loadAll: (page = 0, perPage = 100, globalFilter = "", sortBy = []) => {
const { INVITES } = endpoints;
// NOTE: this code is duplicated from /entities/users.js
// we should pull this out into shared utility at some point.
const pagination = `page=${page}&per_page=${perPage}`;
let orderKeyParam = "";
let orderDirection = "";
if (sortBy.length !== 0) {
const sortItem = sortBy[0];
orderKeyParam += `&order_key=${sortItem.id}`;
orderDirection = sortItem.desc
? "&order_direction=desc"
: "&order_direction=asc";
}
let searchQuery = "";
if (globalFilter !== "") {
searchQuery = `&query=${globalFilter}`;
}
const inviteEndpoint = `${INVITES}?${pagination}${searchQuery}${orderKeyParam}${orderDirection}`;
return client
.authenticatedGet(client._endpoint(inviteEndpoint))
.then((response) => {
const { invites } = response;
return invites.map((invite) => {
return helpers.addGravatarUrlToResource(invite);
});
});
},
};
};
| 1.414063 | 1 |
resources/js/router.js | noeloariola/ama_forum | 0 | 15994292 | import Vue from 'vue'
import Router from 'vue-router'
import axios from 'axios'
Vue.use(Router, axios)
var router = new Router({
mode: 'history',
// base: '/refresher',
routes: [
{
path: '/',
name: 'home',
component: () => import('./views/Home.vue'),
meta: {
auth: false
}
},
{
path: '/login',
name: 'login',
components: {
default: () => import('./components/Login.vue'),
},
meta: {
auth: false
}
},
{
path: '/admin',
name: 'admin_page',
components: {
default: () => import('./components/AdminPage.vue'),
},
meta: {
auth: false
}
},
]
});
// router.beforeEach((to, from, next) => {
// if (to.matched.some(record => record.meta.auth)) {
// if(store.state.user) {
// if( authHelper.isAuthorize(store.state.user, to.meta.auth.roles)) {
// return next()
// }else {
// return next({
// name: 'login',
// query: {
// redirect: to.fullPath
// }
// })
// }
// }else {
// return next({
// path: '/login',
// query: {
// redirect: to.fullPath
// }
// })
// }
// }else {
// if(to.name == "login") {
// if(authHelper.isLogged(store.state.user)) {
// return next('/')
// }
// }
// return next();
// }
// })
export default router;
| 1.148438 | 1 |
test/laws/Semigroup.js | jlmorgan/node-lodash-fantasy | 12 | 15994300 | "use strict";
// Third Party
const curry = require("lodash/fp/curry");
module.exports = curry((expect, Type) =>
describe("Semigroup", () => {
it("should express associativity", () => {
const testValue = true;
const testLeft = new Type(testValue);
const testMiddle = new Type(testValue);
const testRight = new Type(testValue);
expect(testLeft.concat(testMiddle).concat(testRight))
.to.eql(testLeft.concat(testMiddle.concat(testRight)));
});
})
);
| 1.40625 | 1 |
test/updatetest.js | sithmel/http-cache-semantics | 102 | 15994308 | 'use strict';
const assert = require('assert');
const CachePolicy = require('..');
const simpleRequest = {
method: 'GET',
headers: {
host: 'www.w3c.org',
connection: 'close',
},
url: '/Protocols/rfc2616/rfc2616-sec14.html',
};
function withHeaders(request, headers) {
return Object.assign({}, request, {
headers: Object.assign({}, request.headers, headers),
});
}
const cacheableResponse = { headers: { 'cache-control': 'max-age=111' } };
const etaggedResponse = {
headers: Object.assign({ etag: '"123456789"' }, cacheableResponse.headers),
};
const weakTaggedResponse = {
headers: Object.assign(
{ etag: 'W/"123456789"' },
cacheableResponse.headers
),
};
const lastModifiedResponse = {
headers: Object.assign(
{ 'last-modified': 'Tue, 15 Nov 1994 12:45:26 GMT' },
cacheableResponse.headers
),
};
const multiValidatorResponse = {
headers: Object.assign(
{},
etaggedResponse.headers,
lastModifiedResponse.headers
),
};
function notModifiedResponseHeaders(
firstRequest,
firstResponse,
secondRequest,
secondResponse
) {
const cache = new CachePolicy(firstRequest, firstResponse);
const headers = cache.revalidationHeaders(secondRequest);
const { policy: newCache, modified } = cache.revalidatedPolicy(
{ headers },
secondResponse
);
if (modified) {
return false;
}
return newCache.responseHeaders();
}
function assertUpdates(
firstRequest,
firstResponse,
secondRequest,
secondResponse
) {
firstResponse = withHeaders(firstResponse, { foo: 'original', 'x-other': 'original' });
if (!firstResponse.status) {
firstResponse.status = 200;
}
secondResponse = withHeaders(secondResponse, {
foo: 'updated',
'x-ignore-new': 'ignoreme',
});
if (!secondResponse.status) {
secondResponse.status = 304;
}
const headers = notModifiedResponseHeaders(
firstRequest,
firstResponse,
secondRequest,
secondResponse
);
assert(headers);
assert.equal(headers['foo'], 'updated');
assert.equal(headers['x-other'], 'original');
assert.strictEqual(headers['x-ignore-new'], undefined);
assert.strictEqual(headers['etag'], secondResponse.headers.etag);
}
describe('Update revalidated', function() {
it('Matching etags are updated', function() {
assertUpdates(
simpleRequest,
etaggedResponse,
simpleRequest,
etaggedResponse
);
});
it('Matching weak etags are updated', function() {
assertUpdates(
simpleRequest,
weakTaggedResponse,
simpleRequest,
weakTaggedResponse
);
});
it('Matching lastmod are updated', function() {
assertUpdates(
simpleRequest,
lastModifiedResponse,
simpleRequest,
lastModifiedResponse
);
});
it('Both matching are updated', function() {
assertUpdates(
simpleRequest,
multiValidatorResponse,
simpleRequest,
multiValidatorResponse
);
});
it('Checks status', function() {
const response304 = Object.assign({}, multiValidatorResponse, {
status: 304,
});
const response200 = Object.assign({}, multiValidatorResponse, {
status: 200,
});
assertUpdates(
simpleRequest,
multiValidatorResponse,
simpleRequest,
response304
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
multiValidatorResponse,
simpleRequest,
response200
)
);
});
it('Last-mod ignored if etag is wrong', function() {
assert(
!notModifiedResponseHeaders(
simpleRequest,
multiValidatorResponse,
simpleRequest,
withHeaders(multiValidatorResponse, { etag: 'bad' })
)
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
multiValidatorResponse,
simpleRequest,
withHeaders(multiValidatorResponse, { etag: 'W/bad' })
)
);
});
it('Ignored if validator is missing', function() {
assert(
!notModifiedResponseHeaders(
simpleRequest,
etaggedResponse,
simpleRequest,
cacheableResponse
)
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
weakTaggedResponse,
simpleRequest,
cacheableResponse
)
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
lastModifiedResponse,
simpleRequest,
cacheableResponse
)
);
});
it('Skips update of content-length', function() {
const etaggedResponseWithLenght1 = withHeaders(etaggedResponse, {
'content-length': 1,
});
const etaggedResponseWithLenght2 = withHeaders(etaggedResponse, {
'content-length': 2,
});
const headers = notModifiedResponseHeaders(
simpleRequest,
etaggedResponseWithLenght1,
simpleRequest,
etaggedResponseWithLenght2
);
assert.equal(1, headers['content-length']);
});
it('Ignored if validator is different', function() {
assert(
!notModifiedResponseHeaders(
simpleRequest,
lastModifiedResponse,
simpleRequest,
etaggedResponse
)
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
lastModifiedResponse,
simpleRequest,
weakTaggedResponse
)
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
etaggedResponse,
simpleRequest,
lastModifiedResponse
)
);
});
it("Ignored if validator doesn't match", function() {
assert(
!notModifiedResponseHeaders(
simpleRequest,
etaggedResponse,
simpleRequest,
withHeaders(etaggedResponse, { etag: '"other"' })
),
'bad etag'
);
assert(
!notModifiedResponseHeaders(
simpleRequest,
lastModifiedResponse,
simpleRequest,
withHeaders(lastModifiedResponse, { 'last-modified': 'dunno' })
),
'bad lastmod'
);
});
it("staleIfError revalidate, no response", function() {
const cacheableStaleResponse = { headers: { 'cache-control': 'max-age=200, stale-if-error=300' } };
const cache = new CachePolicy(simpleRequest, cacheableStaleResponse);
const { policy, modified } = cache.revalidatedPolicy(
simpleRequest,
null
);
assert(policy === cache);
assert(modified === false);
});
it("staleIfError revalidate, server error", function() {
const cacheableStaleResponse = { headers: { 'cache-control': 'max-age=200, stale-if-error=300' } };
const cache = new CachePolicy(simpleRequest, cacheableStaleResponse);
const { policy, modified } = cache.revalidatedPolicy(
simpleRequest,
{ status: 500 }
);
assert(policy === cache);
assert(modified === false);
});
});
| 1.476563 | 1 |
lib/constants/environment.js | Tech-Alliance-of-Distributed-Artists/impro_bot | 0 | 15994316 | function getEnvVars (loadEnvVars, getEnvVar) {
loadEnvVars();
const opts = {
options: {
debug: true
},
connection: {
secure: true,
reconnect: true
},
identity: {
username: getEnvVar.BOT_USERNAME,
async password() {
return getEnvVar.OAUTH_TOKEN;
}
},
channels: [
getEnvVar.CHANNEL_NAME
]
};
return opts;
}
module.exports = getEnvVars;
| 0.730469 | 1 |
web/wp-content/themes/lf-theme/source/js/third-party/tab-container.js | Karelweb/cncf.io | 33 | 15994324 | /**
* Tab Container JS
*
* @package WordPress
* @since 1.0.0
*/
/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */
/* eslint-disable array-callback-return */
/* eslint-disable no-var */
jQuery( document ).ready(
function( $ ) {
// Setup Sticky.
let sticky;
let setSticky;
( setSticky = function() {
sticky = new Sticky(
'.sticky-element',
{
marginTop: getSpacing(),
marginBottom: 100,
stickyFor: 800,
}
);
} )();
// If page loads with hash, go to it nicely after 1s.
if ( window.location.hash ) {
// smooth scroll to the anchor id if exists after 1s.
if ( $( window.location.hash ).length ) {
let theHash = $( window.location.hash );
let offsetNew = theHash === '#' ? 0 : theHash.offset().top - getSpacing();
setTimeout(
function() {
$( 'html, body' )
.animate(
{
scrollTop: offsetNew,
},
500
);
},
1000
);
}
}
// create array of elements from nav links.
let topMenu = $( '.tab-container-nav' );
if ( topMenu.length > 0 ) {
let lastId;
let menuItems = topMenu.find( 'a' );
let scrollItems = menuItems.map(
function() {
let item = $( $( this ).attr( 'href' ) );
if ( item.length ) {
return item;
}
}
);
// Check nav items are in view as user scrolls.
$( window ).on( 'scroll', window.utils.isThrottled( navInView, 200, true ) );
// Update nav and hash as user scrolls.
$( window ).on( 'scroll', window.utils.isThrottled( navUpdate, 200, true ) );
// Update Sticky on resize.
$( window ).on( 'resize', window.utils.isThrottled( setSticky, 200, true ) );
// Click handler for menu items so we can get a fancy scroll animation.
menuItems.click(
function( e ) {
let href = $( this ).attr( 'href' );
let offsetTop = href === '#' ? 0 : $( href ).offset()
.top - getSpacing();
$( 'html, body' )
.stop()
.animate(
{
scrollTop: offsetTop,
},
500
);
e.preventDefault();
}
);
// Function to update nav and hash as user scrolls.
function navUpdate() {
let fromTop = $( this ).scrollTop();
// Get id of current scroll item, add 20 for padding from header.
let cur = scrollItems.map(
function() {
if ( $( this ).offset().top < fromTop + getSpacing() + 20 ) {
return this;
}
}
);
// Get the id of the current element.
cur = cur[ cur.length - 1 ];
let id = cur && cur.length ? cur[ 0 ].id : '';
if ( lastId !== id ) {
lastId = id;
// Set/remove active class.
menuItems
.parent()
.removeClass( 'is-active' )
.end()
.filter( "[href='#" + id + "']" )
.parent()
.addClass( 'is-active' );
if ( id ) {
if ( history.pushState ) {
window.history.replaceState(
null,
null,
'#' + id
);
} else {
// IE9, IE8, etc.
window.location.hash = '#!' + id;
}
} else {
removeHash();
}
}
}
}
// Get spacing required from top of window for content.
function getSpacing() {
let spacingTotal = 0;
let winH = $( window ).height();
let winW = $( window ).width();
const adminBar = $( '#wpadminbar' );
if ( winH < 616 && winW > 514 ) {
spacingTotal += 40;
} else if ( winW < 800 ) {
spacingTotal += 80;
} else {
spacingTotal += 125;
}
if ( adminBar.length > 0 ) {
spacingTotal += 32;
}
return spacingTotal;
}
// Remove hash from URL.
function removeHash() {
let scrollV;
let scrollH;
let loc = window.location;
if ( 'pushState' in history ) {
history.pushState( '', document.title, loc.pathname + loc.search );
} else {
// Prevent scrolling by storing the page's current scroll offset.
scrollV = document.body.scrollTop;
scrollH = document.body.scrollLeft;
loc.hash = '';
// Restore the scroll offset, should be flicker free.
document.body.scrollTop = scrollV;
document.body.scrollLeft = scrollH;
}
}
// Looks for nav item and checks its in view.
function navInView() {
let currentItem = $( '.tab-container-nav-item.is-active' );
let winW = $( window ).width();
if ( winW > 799 && currentItem.length ) {
currentItem[ 0 ].scrollIntoView(
{
block: 'nearest',
}
);
}
}
// END.
}
);
| 1.460938 | 1 |
src/remind.js | SamuraiZen28/WIP-Files | 0 | 15994332 | const { MessageEmbed } = require('discord.js');
const i = require('./../../colors.json')
module.exports = {
name: 'reminder',
description: 'set a reminder to do something!',
category: 'General',
cooldown: 10,
aliases: ['remind', 'remember'],
usage: '<oneday> || <sixhours> || <hour> || <minute> [reminder]',
run: async(client, message, args, text) => {
let minute = 60000
let hour = 3600000
let sixhours = 21600000
let oneday = 86400000
let time = args[0]
let reason = args.slice(1).join(" ")
const sucem = new MessageEmbed().setDescription(`\`✅ Done!\` **Remind: ${reason} in an ${time}**`).setColor(i.nocolor).setTimestamp()
const remind = new MessageEmbed().setDescription(`<@!${message.author.id}> **Reminder: ${reason}**`).setColor(i.nocolor)
if(!reason) {
message.reply(`\`❌ Please specify something for me to remind you!\``)
} else if(!time) {
message.reply(`\`No time specified\``)
} else if(args[0] === 'oneday') {
message.reply(sucem).then(() => {
setTimeout(function(){message.reply(remind)}, oneday)
})
} else if(args[0] === 'sixhours') {
message.reply(sucem).then(() => {
setTimeout(function(){message.reply(remind)}, sixhours)
})
} else if(args[0] === 'hour') {
message.reply(sucem).then(() => {
setTimeout(function(){message.reply(remind)}, hour)
})
} else if(args[0] === 'minute') {
message.reply(sucem).then(() => {
setTimeout(function(){message.reply(remind)}, minute)
})
}
}
}
| 1.851563 | 2 |
migrations/20161123162509_newBowlingDB.js | simon-jk-casey/OTD | 0 | 15994340 | exports.up = function(knex, Promise) {
return knex.schema.createTableIfNotExists('matchDB_Bowl', function(table){
table.increments('id')
table.integer('bowlPlayerId').notNullable()
table.integer('overs').defaultTo(0)
table.integer('maidens').defaultTo(0)
table.integer('bowlRuns').defaultTo(0)
table.integer('wickets').defaultTo(0)
table.integer('wides').defaultTo(0)
table.integer('noBalls').defaultTo(0)
table.integer('matchId').notNullable()
})
}
exports.down = function(knex, Promise) {
return knex.schema.dropTableIfExists('matchDB_Bowl')
};
| 1.140625 | 1 |
app/contexts/index.js | mgarciagalan/hackathon | 0 | 15994348 | /*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import React from 'react'
/**
* This is the global state for categories, we use this for navigation and for
* the product list page.
*
* To use these context's simply import them into the component requiring context
* like the below example:
*
* import React, {useContext} from 'react'
* import {CategoriesContext} from './contexts'
*
* export const RootCategoryLabel = () => {
* const {categories} = useContext(CategoriesContext)
* return <div>{categories['root'].name}</div>
* }
*
*/
export const CategoriesContext = React.createContext()
| 1.234375 | 1 |
templates-jquerry/template-2-revisao/assets/js/main.js | henrique-roldao/desenvolvimento-a-componentes | 0 | 15994356 | $(document).ready(function () {
home();
$("#home").click(function () {
home();
});
$("#features").click(function () {
features();
});
$("#contact").click(function () {
contact();
});
});
function home() {
$(".testeJs").html(" <div class='title'><h1>Bem vindo!</h1></div>");
}
function features() {
$(".testeJs").html("<div class='title'><h1>Features!</h1></div>");
}
function contact() {
$(".testeJs").load("views/contact.html");
}
function LoadPerson() {
var Person = {
name: document.querySelector("#name_form").value,
email: document.querySelector("#email_form").value,
phone: document.querySelector("#phone_form").value,
cep: document.querySelector("#cep_form").value,
subject: document.querySelector("#subject_form").value,
};
getLocal(Person.cep, function (data) {
Person.data = data.localidade;
Person.uf = data.uf;
$(".testeJs").load("views/person.html", function () {
var teste = document.querySelector("#namePerson");
teste.innerHTML = `${Person.name}`;
var teste = document.querySelector("#emailPerson");
teste.innerHTML = `${Person.email}`;
var teste = document.querySelector("#phonePerson");
teste.innerHTML = `${Person.phone}`;
var teste = document.querySelector("#cepPerson");
teste.innerHTML = `${Person.data} - ${Person.uf}`;
var teste = document.querySelector("#subjectPerson");
teste.innerHTML = `${Person.subject}`;
});
});
}
function getLocal(cep, callBack) {
$.getJSON(`https://viacep.com.br/ws/${cep}/json`, function (data) {
return callBack(data);
});
}
| 1.4375 | 1 |
src/component/Portal/index.js | seeskyblue/AtomicUI | 1 | 15994364 | import Portal, * as others from './Portal';
export default Object.assign(Portal, others);
export * from './Portal';
| 0.285156 | 0 |
src/js/LocalStorageMock.test.js | AkashaRojee/to-do-list | 3 | 15994372 | import LocalStorageMock from './LocalStorageMock.js';
describe('constructor', () => {
test('Create new localStorage mock object', () => {
const expected = new LocalStorageMock();
Object.defineProperty(window, 'localStorage', { value: new LocalStorageMock() });
const result = window.localStorage;
expect(result).toStrictEqual(expected);
});
});
describe('getItem', () => {
test('Get key from empty localStorage mock object returns null', () => {
Object.defineProperty(window, 'localStorage', { value: new LocalStorageMock() });
const result = window.localStorage.getItem('tasks');
expect(result).toBeNull();
});
test('Get key from non-empty localStorage mock object returns value', () => {
const expected = new LocalStorageMock();
expected.store = {
tasks:
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: false, index: 2 },
{ description: 'Task 3', completed: false, index: 3 },
],
),
};
Object.defineProperty(window, 'localStorage', { value: new LocalStorageMock() });
window.localStorage.store = {
tasks:
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: false, index: 2 },
{ description: 'Task 3', completed: false, index: 3 },
],
),
};
const result = window.localStorage.getItem('tasks');
expect(result).toStrictEqual(expected.store.tasks);
});
});
describe('setItem', () => {
test('Set key in empty localStorage mock object adds key to it', () => {
const expected = new LocalStorageMock();
expected.store = {
tasks:
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: false, index: 2 },
{ description: 'Task 3', completed: false, index: 3 },
],
),
};
Object.defineProperty(window, 'localStorage', { value: new LocalStorageMock() });
window.localStorage.setItem(
'tasks',
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: false, index: 2 },
{ description: 'Task 3', completed: false, index: 3 },
],
),
);
const result = window.localStorage.store.tasks;
expect(result).toStrictEqual(expected.store.tasks);
});
test('Set key in non-empty localStorage mock object updates value', () => {
const expected = new LocalStorageMock();
expected.store = {
tasks:
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: true, index: 2 },
{ description: 'Task 3', completed: true, index: 3 },
],
),
};
Object.defineProperty(window, 'localStorage', { value: new LocalStorageMock() });
window.localStorage.store = {
tasks:
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: false, index: 2 },
{ description: 'Task 3', completed: false, index: 3 },
],
),
};
window.localStorage.setItem(
'tasks',
JSON.stringify(
[
{ description: 'Task 1', completed: true, index: 1 },
{ description: 'Task 2', completed: true, index: 2 },
{ description: 'Task 3', completed: true, index: 3 },
],
),
);
const result = window.localStorage.store.tasks;
expect(result).toStrictEqual(expected.store.tasks);
});
}); | 1.859375 | 2 |
components/index/AboutMe.js | gs291/ElliotFWebsite | 0 | 15994380 | import {Typography} from '@mui/material';
export default function AboutMe() {
return (
<>
<Typography variant="h4">
Hello
</Typography>
<Typography variant="body1">
This is all about me and me and me.
</Typography>
</>
);
} | 0.777344 | 1 |
packages/__tests__/src/datelib/moment-timezone.js | fariaseduv/fullcalendar | 1 | 15994388 | import momentTimeZonePlugin from '@fullcalendar/moment-timezone'
import { testTimeZoneImpl } from '../lib/timeZoneImpl'
describe('moment-timezone', function() {
testTimeZoneImpl(momentTimeZonePlugin)
})
| 0.6875 | 1 |
packages/manager/modules/pci/src/projects/project/kubernetes/details/node-pool/node-pool.controller.js | ilesinge/manager | 0 | 15994396 | import find from 'lodash/find';
import set from 'lodash/set';
export default class KubernetesNodePoolsCtrl {
/* @ngInject */
constructor(
$translate,
CucCloudMessage,
Kubernetes,
PciProjectFlavors,
) {
this.$translate = $translate;
this.CucCloudMessage = CucCloudMessage;
this.Kubernetes = Kubernetes;
this.PciProjectFlavors = PciProjectFlavors;
}
$onInit() {
this.loadMessages();
}
loadMessages() {
this.CucCloudMessage.unSubscribe(
'pci.projects.project.kubernetes.details.nodepools',
);
this.messageHandler = this.CucCloudMessage.subscribe(
'pci.projects.project.kubernetes.details.nodepools',
{ onMessage: () => this.refreshMessages() },
);
}
refreshMessages() {
this.messages = this.messageHandler.getMessages();
}
getAssociatedFlavor(nodePool) {
return this.PciProjectFlavors
.getFlavors(this.projectId, this.cluster.region)
.then((flavors) => {
this.flavor = find(flavors, { name: nodePool.flavor });
this.flavor.region = this.cluster.region;
this.formatteFlavor = this.Kubernetes.formatFlavor(this.flavor);
set(
nodePool,
'formattedFlavor',
this.formatteFlavor,
);
return nodePool;
})
.catch(() => {
set(
nodePool,
'formattedFlavor',
this.$translate.instant('kube_nodes_flavor_error'),
);
});
}
loadRowData(nodePool) {
return this.getAssociatedFlavor(nodePool);
}
}
| 1.320313 | 1 |
src/moderate/jolly-jumpers/solutions/javascript/solution.js | rdtsc/codeeval-solutions | 0 | 15994404 | #!/usr/bin/env node
'use strict';
const lineReader = require('readline').createInterface(
{
input: require('fs').createReadStream(process.argv[2])
});
function isJolly(terms)
{
const termCount = terms.length;
if(termCount == 1) return true;
let used = Array(termCount).fill(false);
for(let i = 0; i < termCount - 1; ++i)
{
let delta = Math.abs(terms[i] - terms[i + 1]);
if(!delta || delta >= termCount || used[delta - 1])
{
return false;
}
used[delta - 1] = true;
}
return true;
}
lineReader.on('line', (line) =>
{
line = line.split(' ').map(Number).slice(1);
console.log(isJolly(line) ? 'Jolly' : 'Not jolly');
});
| 2.015625 | 2 |
src/display.js | Miguelus373/Todo-List | 2 | 15994412 | const displayProjectTodo = (projectArr, todoArr) => {
const content = document.getElementById('content');
content.innerHTML = '';
projectArr.forEach(projectTitle => {
const projectDiv = document.createElement('div');
projectDiv.setAttribute('class', 'project-div');
projectDiv.innerHTML = `
<h1>${projectTitle}</h1>
<div class="todos-div">
${todoArr.map((todo, index) => {
if (todo.project === projectTitle) {
return `
<ul class="todo-info" id="${index}">
<li>${todo.title}</li>
<li>${todo.description}</li>
<li>${todo.dueDate}</li>
<li>${todo.priority}</li>
<a href="#form-container" class="edit btn">Edit</a>
<button class="delete btn">Done</button>
</ul>`;
}
return '';
}).join('')}
</div>`;
content.appendChild(projectDiv);
});
};
export { displayProjectTodo as default }; | 1.585938 | 2 |
app/services/author.server.service.js | nghuuquyen/sociss-course-offline | 3 | 15994420 | /**
* @module services
* @author <NAME>
* @name author.server.service
*/
"use strict";
let Author = require('../models').Author;
module.exports = {
findByUsernameOrId : findByUsernameOrId,
getAllAuthors : getAllAuthors
};
/**
* @name findByUsernameOrId
* @description
* Find one author by username or id.
*
* @param {string} _param Username or Id of author.
* @return {promise.<object>} Author object.
*/
function findByUsernameOrId(_param) {
// TODO: More business logic code here.
return Author.findOne(_param);
}
/**
* @name getAllAuthors
* @description
* Get all authors in database
*
* @return {promise.<array>} Authors.
*/
function getAllAuthors() {
// TODO: More business logic code here.
return Author.getAll();
}
| 1.609375 | 2 |
src/backend/puppeteerServer.js | josephiswhere/reactime | 1,286 | 15994428 | /* eslint-disable linebreak-style */
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable @typescript-eslint/no-var-requires */
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(path.resolve(__dirname)));
const server = app.listen(5000);
module.exports = server;
| 0.953125 | 1 |
gulpfile.js | ChattyCrow/chattycrow_app | 0 | 15994436 | /** Init gulp files */
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var plumber = require('gulp-plumber');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var jade = require('gulp-jade');
var bf = require('main-bower-files');
var inject = require('gulp-inject');
var less = require('gulp-less');
/* Compile Coffee APP files into www directory */
gulp.task('coffee', function() {
return gulp.src('src/**/*.coffee')
.pipe(plumber())
.pipe(coffee({ bare: true }))
.on('error', gutil.log)
.pipe(gulp.dest('./www/app/'));
});
/* Compile less stylesheets */
gulp.task('less', function() {
return gulp.src('src/stylesheets/*.less')
.pipe(plumber())
.pipe(less())
.on('error', gutil.log)
.pipe(gulp.dest('./www/css/'));
});
/* Compile & inject jade file */
gulp.task('inject', function() {
return gulp.src('src/index.jade')
.pipe(plumber())
.pipe(jade())
.on('error', gutil.log)
.pipe(inject(gulp.src(['css/*.js', 'css/*.css'], { read: false, cwd: 'www/' }), { name: 'ui', relative: true }))
.pipe(inject(gulp.src(['app/**/*.js', 'assets/**/*.css', '!app/app.js'], { read: false, cwd: 'www/' }), { name: 'app', relative: true }))
.pipe(inject(gulp.src(['app/app.js'], { read: false, cwd: 'www/' }), { name: 'main', relative: true }))
.pipe(inject(gulp.src(bf(), { read: false, cwd: 'www/' }), { name: 'bower', relative: true }))
.pipe(gulp.dest('./www/'));
});
/* Check JS files for stylish errors */
gulp.task('jshint', function() {
return gulp.src(['www/app/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
/* Copy libs */
gulp.task('libs', function() {
return gulp.src('./src/lib/**/*.js')
.pipe(gulp.dest('./www/app/lib/'));
});
/* Copy images */
gulp.task('images', function() {
return gulp.src('./res/images/**/*.*')
.pipe(gulp.dest('./www/images/'));
});
/** Run watchers */
gulp.task('watch-coffee', function() {
return gulp.watch('src/**/*.coffee', ['coffee', 'jshint']);
});
gulp.task('watch-jade', function() {
return gulp.watch('src/**/*.jade', ['inject']);
});
gulp.task('watch-less', function() {
return gulp.watch('src/stylesheets/*.less', ['less']);
});
gulp.task('watch-image', function() {
return gulp.watch('res/images/**/*.png', ['images']);
});
/** Gulp start task */
gulp.task('default', [ 'coffee', 'jshint', 'less', 'images', 'libs', 'inject', 'watch-coffee', 'watch-jade', 'watch-less', 'watch-image' ]);
| 1.109375 | 1 |
test/url/shortener.spec.js | matheuslc/shorts | 19 | 15994444 | import chai from 'chai';
import config from '../fixtures/config.json';
import Shortener from '../../src/url/shortener';
const assert = chai.assert;
const should = chai.should;
describe('URL Shortener', () => {
const shortener = new Shortener(config.dictionary, config.shortUrlSize);
it('Should return a hash with 5 digits', () => {
const url = shortener.getRandomUrl();
assert.typeOf(url, 'string');
assert.equal(url.length, 5);
});
it('Should return a random number between 0 and dictionary length', () => {
const randomNumber = shortener.getRandomPosition();
assert.typeOf(randomNumber, 'number');
assert.isBelow(randomNumber, config.dictionary.length);
});
});
| 1.257813 | 1 |
src/components/loading.js | Muxingren/My-vue-project-02 | 0 | 15994452 | import Modal from "./modal.js"
const template=`
<Modal v-if="show">
<div style="font-size:1.5em;color:#fff" >
加载中...
</div>
</Modal>
`;
export default{
template,
components:{
Modal
},
props:{
show:{
type:Boolean,//通过布尔属性show来控制是否显示
default:false
}
}
} | 0.945313 | 1 |
ExpressCode/headers.js | izualkernanaus/coe457_fall2020 | 2 | 15994460 | var express = require('express');
var app = express();
app.set('port', process.env.PORT || 1234);
app.get('/', function(req, res) {
res.set('Content-Type', 'text/plain');
var s = '';
for (var name in req.headers)
s += name + ': ' + req.headers[name] + '\n';
res.send(s);
});
app.listen(app.get('port'), function() {
console.log('Express started on http://localhost:' + app.get('port') + '; press Ctrl-C to terminate.');
}); | 1.117188 | 1 |
src/UI/Reference/Widgets/applyDistanceWidgetValue.js | abcsFrederick/itk-vtk-viewer | 115 | 15994468 | function applyDistanceWidgetValue(context, event) {
context.widgets.distanceValueElement.setAttribute('value', `${event.data}`)
}
export default applyDistanceWidgetValue
| 0.671875 | 1 |
packages/api-main/api/middlewares/HasOrganizationAccess.js | momentechnologies/Slugin | 0 | 15994476 | const Unauthorized = require('../exceptions/unauthorized');
const ValidationException = require('../exceptions/validation');
const IsLoggedIn = require('./isLoggedIn');
const OrganizationService = require('../services/organization');
module.exports = () => (req, res, next) =>
IsLoggedIn(req, res, err => {
if (err) return next(err);
if (!req.params.organizationId || req.params.organizationId <= 0) {
return next(
new ValidationException([
ValidationException.createError(
'organizationId',
'url',
'invalid organization id. Must be provided and greater than 0'
),
])
);
}
OrganizationService.isUserInOrganization(
req.user.id,
req.params.organizationId
)
.then(isUserInOrganization => {
if (!isUserInOrganization) {
return next(
new Unauthorized(
'You do not have access to this organization'
)
);
}
next();
})
.catch(next);
});
| 1.414063 | 1 |
src/util/net.js | AnthonyLaw/symbol-data-lib | 0 | 15994484 | /*
*
* Copyright (c) 2019-present for NEM
*
* Licensed under the Apache License, Version 2.0 (the "License ");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Asynchronous API that wraps the NodeJS net API.
*/
import assert from 'assert'
import net from 'net'
import shared from './shared'
/**
* General error type for connection errors.
*/
class ConnectionError extends Error {
constructor() {
super('connection failed')
this.name = 'ConnectionError'
}
}
/**
* General error type when we receive unexpected data.
*/
class DataError extends Error {
constructor(bytes) {
super(`not expecting data, received ${bytes} bytes`)
this.name = 'ConnectionError'
}
}
/**
* Client class.
*
* Wraps the event-driven NodeJS net API into an asynchronous, call-based API.
*/
class Client {
constructor(connection) {
this.connection = connection
}
/**
* Connect to host.
*/
static connect(...args) {
return new Promise((resolve, reject) => {
let rejectOnClose = () => reject(new ConnectionError())
let rejectOnError = error => reject(error)
let client = net.connect(...args)
client.on('close', rejectOnClose)
client.on('error', rejectOnError)
client.on('connect', () => {
client.removeListener('close', rejectOnClose)
client.removeListener('error', rejectOnError)
resolve(new Client(client))
})
})
}
/**
* Receive data from socket.
*/
receive() {
assert(this.isOpen, 'socket must be open')
return new Promise((resolve, reject) => {
let size
let buffer = Buffer.alloc(0)
let rejectOnClose = () => reject(new ConnectionError())
let rejectOnError = error => reject(error)
this.connection.on('close', rejectOnClose)
this.connection.on('error', rejectOnError)
this.connection.on('data', data => {
// Merge the buffers, and if we don't yet know the packet size,
// calculate it.
buffer = Buffer.concat([buffer, data], buffer.length + data.length)
if (size === undefined && buffer.length >= 4) {
size = shared.readUint32(buffer.slice(0, 4))
}
// We've extracted the full packet.
if (buffer.length === size) {
this.connection.removeListener('close', rejectOnClose)
this.connection.removeListener('error', rejectOnError)
resolve(buffer)
} else if (buffer.length > size) {
// Invalid packet, received too much data.
reject(new Error('invalid packet, got more bytes than expected'))
}
})
})
}
/**
* Send data to socket.
*/
send(payload) {
assert(this.isOpen, 'socket must be open')
return new Promise((resolve, reject) => {
let rejectOnClose = () => reject(new ConnectionError())
let rejectOnError = error => reject(error)
let rejectOnData = data => reject(new DataError(data.length))
this.connection.on('close', rejectOnClose)
this.connection.on('error', rejectOnError)
this.connection.on('data', rejectOnData)
this.connection.write(payload, () => {
this.connection.removeListener('close', rejectOnClose)
this.connection.removeListener('error', rejectOnError)
this.connection.removeListener('data', rejectOnData)
resolve()
})
})
}
/**
* Get the address the socket is connected to.
*/
address() {
assert(this.isOpen, 'socket must be open')
return this.connection.address()
}
/**
* Close socket.
*/
close() {
assert(this.isOpen, 'socket must be open')
return new Promise(resolve => {
this.connection.end(() => {
this.connection = undefined
resolve()
})
})
}
/**
* Get if the socket connection is open.
*/
get isOpen() {
return this.connection !== undefined
}
/**
* Get if the socket connection is closed.
*/
get isClosed() {
return this.connection === undefined
}
}
export default {
Client
}
| 2.03125 | 2 |
src/helpers/setVar.js | slycreations/slycreations | 0 | 15994492 | module.exports = function(varName, varValue, options) {
options.data.root[varName] = varValue;
} | 0.211914 | 0 |
public/js/main.js | nakae117/test-prismic | 0 | 15994500 | var json;
// Función para crear los enlaces hacias los items.
var makeRender = function (item) {
return `
<a class="col-xs-12 col-sm-6 col-md-3 col-lg-3 categoria" href="/item/${item.id}">
<div>
${item.name}
</div>
<div>
<i>
<strong>${item.category}</strong>
</i>
</div>
<div class="picture">
<img src="${item.img}" class="img-fluid rounded-circle" alt="Logo">
</div>
</a>
`
}
// Función para crear la lista de items.
var renderHtml = function (obj) {
var render = ''
// Recorre la lista de elementos para crear el enlace.
$.each(obj, function (i, item) {
render += makeRender(item)
})
// Renderiza la lista en el DOM.
$('#items').html(render)
}
// Agregar el evento a los botones para filtrar los items segun su categoria.
$('body').on('change', '[name="options"]', function () {
// Obtiene el valor de la categoria.
var value = $(this).val()
// Obtengo la lista de items filtrados.
$.ajax({
url: '/filtro/' + value, // Url para filtrar los items.
dataType: 'json',
beforeSend: function(){
$('#items').html(`
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"><br>
<div class="alert alert-info text-center" role="alert">
Cargando
</div>
</div>`)
}
})
.done(function (data) {
json = data
renderHtml(json) // Crea la lista con todos los elementos.
})
}) | 1.390625 | 1 |
Free Logo Generator/js/box2.js | ILYAS0304/Logo-Generator-Extension | 1 | 15994508 | function rantangellogo2() {
console.log('2functin is running now');
let logobox2 = document.querySelector('.logobox2');
let valu = document.querySelector('.input_field').value;
let colo1logo = document.querySelector('#towcolorlogo');
let colo2logo = document.querySelector('#towcolor2logo');
let arry = valu.split(" ");
colo1logo.style.backgroundColor = 'rgb(0, 60, 130)';
colo1logo.style.color = "white";
console.log("funciton is 2runing now what the ehe");
colo2logo.style.color = "rgb(85, 89, 92)";
logobox2.style.border = "4px solid rgb(0, 60, 130)";
if (valu.length < 20 && arry.length==1) {
colo1logo.innerText = arry[0];
colo2logo.style.display="none";
logobox2.style.borderRadius = "39px";
colo1logo.style.padding = "5px 15px";
colo1logo.style.borderRadius = "30px";
logobox2.style.padding = "4px 5px";
logobox2.style.lineHeight = "31px";
}else if (valu.length < 20 && arry.length==2) {
colo1logo.innerText = arry[0];
if (arry[1] == undefined) {
colo2logo.innerText = "asm";
} else {
colo2logo.innerText = arry[1];
}
}
}
| 1.34375 | 1 |
js/request.js | swk3st/ChainReaction | 1 | 15994516 | function requestPlayerID() {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
let playerID = "";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
playerID = JSON.parse(xmlhttp.responseText);
return resolve(playerID);
}
}
let playerIDUrl = "../php/sessiondata.php?var=playerID";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
console.log(dir);
if (dir == "/inventory.php") {
playerIDUrl = "../../php/sessiondata.php?var=playerID";
}
xmlhttp.open("GET", playerIDUrl, true);
xmlhttp.send();
});
}
function requestDisplayName() {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
let dN = "";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
dN = JSON.parse(xmlhttp.responseText);
return resolve(dN);
}
}
let dNUrl = "../php/sessiondata.php?var=displayName";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
console.log(dir);
if (dir == "/inventory.php") {
dNUrl = "../../php/sessiondata.php?var=displayName";
}
xmlhttp.open("GET", dNUrl, true);
xmlhttp.send();
});
}
function requestChains(playerID) {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
var data = JSON.parse(xmlhttp.responseText);
resolve([playerID, data]);
}
}
let url = "../php/loadcustomcreate.php?playerID=";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
if (dir == "/inventory.php") {
url = "../../php/loadcustomcreate.php?playerID=";
}
let request = playerID;
xmlhttp.open("GET", url+request, true);
xmlhttp.send();
})
}
function requestGame(gameId) {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
var data = JSON.parse(xmlhttp.responseText);
resolve(data);
}
}
let url = "../php/gamedata.php?gameID=";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
if (dir == "/inventory.php") {
url = "../../php/gamedata.php?gameID=";
}
let request = gameId;
xmlhttp.open("GET", url+request, true);
xmlhttp.send();
});
}
function playerJoin(gameId, playerId, displayName) {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
let url = "../php/playerjoin.php";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
if (dir == "/inventory.php") {
url = "../../php/playerjoin.php";
}
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
resolve();
}
}
let data = {'gameID': gameId, 'playerID': playerId, 'displayName': displayName};
console.log(JSON.stringify(data));
xmlhttp.send(JSON.stringify(data));
});
}
function startGame(gameId) {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
let url = "../php/gameupdate.php";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
if (dir == "/inventory.php") {
url = "../../php/gameupdate.php";
}
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
resolve();
}
}
let data = {'gameID': gameId};
xmlhttp.send(JSON.stringify(data));
});
}
function requestStatus(gameId) {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
var data = JSON.parse(xmlhttp.responseText);
resolve(data);
}
}
let url = "../php/gamestatus.php?gameID=";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
if (dir == "/inventory.php") {
url = "../../php/gamestatus.php?gameID=";
}
let request = gameId;
xmlhttp.open("GET", url+request, true);
xmlhttp.send();
});
}
function requestPlayers(gameId) {
var xmlhttp = new XMLHttpRequest();
return new Promise ((resolve, reject) => {
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
var data = JSON.parse(xmlhttp.responseText);
resolve(data);
}
}
let url = "../php/players.php?gameID=";
var loc = window.location.pathname;
var dir = loc.substring(loc.lastIndexOf('/'));
if (dir == "/inventory.php") {
url = "../../php/players.php?gameID=";
}
let request = gameId;
xmlhttp.open("GET", url+request, true);
xmlhttp.send();
});
}
export { requestPlayerID, requestDisplayName, requestChains, requestGame, playerJoin, startGame, requestStatus, requestPlayers }; | 1.429688 | 1 |
functions/index.js | RickK213/react-firebase-starter | 1 | 15994524 | const onAuthUserCreate = require("./on-auth-user-create/on-auth-user-create");
module.exports = {
onAuthUserCreate
};
| 0.359375 | 0 |
src/app/controllers/product.controller.js | wborbajr/eXchange | 0 | 15994532 | const db = require("../models");
const Product = db.products;
// Post a
exports.create = (req, res) => {
// Save to MariaDB database
Product.create(req.body)
.then((product) => {
// Send created product to client
res.json(product);
})
.catch((error) => res.status(400).send(error));
};
// Fetch all
exports.findAll = (req, res) => {
Product.findAll({
attributes: { exclude: ["createdAt", "updatedAt"] },
})
.then((products) => {
res.json(products);
})
.catch((error) => res.status(400).send(error));
};
// Find by Id
exports.findByPk = (req, res) => {
Product.findByPk(req.params.productId, {
attributes: { exclude: ["createdAt", "updatedAt"] },
})
.then((product) => {
if (!product) {
return res.status(404).json({ message: "Product Not Found" });
}
return res.status(200).json(product);
})
.catch((error) => res.status(400).send(error));
};
// Update
exports.update = (req, res) => {
return Product.findByPk(req.params.productId)
.then((product) => {
if (!product) {
return res.status(404).json({
message: "Product Not Found",
});
}
return product
.update({
nameproduct: req.body.nameproduct,
amountproduct: req.body.amountproduct,
productvalue: req.body.productvalue,
percentcomis: req.body.percentcomis,
percentchq: req.body.percentchq,
rule: req.body.rule,
rmovetypele: req.body.movetype,
})
.then(() => res.status(200).json(product))
.catch((error) => res.status(400).send(error));
})
.catch((error) => res.status(400).send(error));
};
// Delete by Id
exports.delete = (req, res) => {
return Product.findByPk(req.params.productId)
.then((product) => {
if (!product) {
return res.status(400).send({
message: "Product Not Found",
});
}
return product
.destroy()
.then(() => res.status(200).json({ message: "Destroy successfully!" }))
.catch((error) => res.status(400).send(error));
})
.catch((error) => res.status(400).send(error));
};
| 1.625 | 2 |
modules/nuclide-debugger-common/debug-adapter-service.js | aaronabramov/atom-ide-ui | 988 | 15994540 | /**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow strict-local
* @format
*/
import type {NuclideUri} from 'nuclide-commons/nuclideUri';
import typeof * as VSCodeDebuggerAdapterService from './VSCodeDebuggerAdapterService';
import * as VSCodeDebuggerAdapterServiceLocal from './VSCodeDebuggerAdapterService';
export function getVSCodeDebuggerAdapterServiceByNuclideUri(
uri: NuclideUri,
): VSCodeDebuggerAdapterService {
let rpcService: ?nuclide$RpcService = null;
// Atom's service hub is synchronous.
atom.packages.serviceHub
.consume('nuclide-rpc-services', '0.0.0', provider => {
rpcService = provider;
})
.dispose();
if (rpcService != null) {
return rpcService.getServiceByNuclideUri(
'VSCodeDebuggerAdapterService',
uri,
);
} else {
return VSCodeDebuggerAdapterServiceLocal;
}
}
| 1.226563 | 1 |
src/Header.js | ehjay/bookworm-frontend | 0 | 15994548 | import React, { Component } from 'react';
import FontAwesome from 'react-fontawesome';
import './Header.css';
class Header extends Component {
render() {
return (
<div className='header'>
<FontAwesome
name='book'
size='2x'
/>
<h3>
Bookworm
</h3>
</div>
);
}
}
export default Header;
| 1.054688 | 1 |
generators/rpm-pkg/index.js | baggachipz/generator-ox-ui-module | 3 | 15994556 | 'use strict';
const { PkgGeneratorBase } = require('../../lib/index');
const Generator = require('yeoman-generator');
module.exports = class RpmpkgGenerator extends Generator {
initializing() {
PkgGeneratorBase.initializing.call(this, arguments);
}
prompting() {
PkgGeneratorBase.prompting.call(this, arguments);
}
files() {
const { packageName, version, maintainer, license, summary, description, staticFrontendPackage } = this;
this.fs.copyTpl(this.templatePath('_specfile.spec'), this.destinationPath(this.packageName + '.spec'), {
packageName, version, maintainer, license, summary, description, staticFrontendPackage
});
}
};
| 1.054688 | 1 |
packages/essentials/src/util/getRelatedTarget.js | vcn/vcnkit | 1 | 15994564 | /**
* IE11 compatible relatedTarget
*
* @param {SyntheticFocusEvent} event
*/
export default function getRelatedTarget(event) {
if (!('relatedTarget' in event) || !event.relatedTarget) {
if (document.activeElement === null || document.activeElement.tagName === 'BODY') {
return document.querySelector(':focus');
}
return document.activeElement;
}
return event.relatedTarget instanceof Node ? event.relatedTarget : undefined;
}
| 1.023438 | 1 |
steghide.js | emlun/stegosaurus | 0 | 15994572 | var child_process = require('child_process');
var path = require('path');
var fs = require('fs.extra');
var sprintf = require('sprintf').sprintf;
var tmp = require('tmp');
var _ = require('underscore');
/**
* @param imagePath: String the path to the image to use as the "cover file" -cf
* argument to steghide
* @param messagePath: String the path to the file to use as the "embed file" -ef
* argument to steghide
* @param password: String the password to use for encrypting the message before
* embedding it
* @return String the path to the created stego file
*/
module.exports.embed = function(imagePath, messagePath, password) {
var steghiddenPath = imagePath + '.steghidden';
child_process.execSync(sprintf(
'steghide embed -cf "%s" -ef "%s" -p "%s" -sf "%s"',
imagePath,
messagePath,
password,
steghiddenPath
));
return steghiddenPath;
};
/**
* @param imagePath: String the path to the image to use as the "stego file"
* -sf argument to steghide
* @param password: String the password that was used to encrypt the message
* when it was embedded
* @param callback: Function(extractedPath: String, cleanup: Function()) a
* function to call when extraction is completed. The parameters are:
* - `extractedPath`: The path to the extracted file
* - `cleanup`: A function which, when called, will clean up temporary files
* (including the one at `extractedPath`)
* @return nothing
*/
module.exports.extract = function(imagePath, password, callback) {
var tmpdir = tmp.dirSync();
var output = child_process.exec(
sprintf(
'steghide extract -sf "%s" -p "%s"',
imagePath,
password
), {
cwd: tmpdir.name,
}, function(err, stdout, stderr) {
var outputFileName = _(stderr.split('"')).chain()
.rest()
.initial()
.value()
.join('"');
var cleanup = _.once(function() {
fs.rmrfSync(tmpdir.name);
});
callback(path.join(tmpdir.name, outputFileName), cleanup);
}
);
};
| 1.640625 | 2 |
node_modules/carbon-icons-svelte/lib/RainScattered20/index.js | seekersapp2013/new | 0 | 15994580 | import RainScattered20 from "./RainScattered20.svelte";
export default RainScattered20; | 0.204102 | 0 |
api/index.js | gungdeaditya/LearningExpress | 1 | 15994588 | var express = require('express')
var router = express.Router()
const controller = require('./controller')
router.get('/', controller)
module.exports = router
| 0.917969 | 1 |
packages/htte-reporter-cli/src/__tests__/index.test.js | sigoden/hest | 73 | 15994596 | const createReporter = require('../');
const EventEmitter = require('events');
const utils = require('../utils');
const { mockUnit } = require('./helper');
const htte = {};
const options = {};
utils.useColors = false;
utils.epilogue = jest.fn();
let emitter = new EventEmitter();
let stdoutWrite = (process.stdout.write = jest.fn());
utils.spinnerMarks = '◵';
afterEach(() => jest.clearAllMocks());
describe('reporter', function() {
createReporter(htte, options)({ emitter });
test('@start', function() {
emitter.emit('start', { units: [], tdd: false });
expect(stdoutWrite.mock.calls.join('')).toMatchSnapshot();
});
test('@enterGroup', function() {
let unit = mockUnit(1, 'pass');
emitter.emit('enterGroup', { unit });
expect(stdoutWrite.mock.calls.join('')).toMatchSnapshot();
});
test('@skipUnit', function() {
let unit = mockUnit(1, 'skip');
emitter.emit('skipUnit', { unit });
expect(stdoutWrite.mock.calls.join('')).toMatchSnapshot();
});
test('@runUnit & doneUnit', function(done) {
let unit = mockUnit(1, 'pass');
emitter.emit('runUnit', { unit });
setTimeout(() => {
expect(stdoutWrite.mock.calls[1][0]).toBe(` ◵ describe1`);
emitter.emit('doneUnit');
expect(stdoutWrite.mock.calls.slice(3).join('')).toMatchSnapshot();
done();
}, utils.spinnerInterval + 1);
});
test('@runUnit & doneUnit slow', function(done) {
let unit = mockUnit(1, 'pass');
unit.session.duration = 10000;
emitter.emit('runUnit', { unit });
setTimeout(() => {
expect(stdoutWrite.mock.calls[1][0]).toBe(` ◵ describe1`);
emitter.emit('doneUnit');
expect(stdoutWrite.mock.calls.slice(3).join('')).toMatchSnapshot();
done();
}, utils.spinnerInterval + 1);
});
test('@runUnit & errorUnit', function(done) {
let unit = mockUnit(1, 'fail');
emitter.emit('runUnit', { unit });
setTimeout(() => {
expect(stdoutWrite.mock.calls[1][0]).toMatchSnapshot();
emitter.emit('errorUnit');
expect(stdoutWrite.mock.calls.slice(3).join('')).toMatchSnapshot();
done();
}, utils.spinnerInterval + 1);
});
test('@done', function() {
let args = {};
emitter.emit('done', args);
expect(utils.epilogue).toHaveBeenCalledWith(args);
});
test('auto enable metadata.debug of last failed unit when tdd', function() {
let units = [mockUnit(1, 'pass'), mockUnit(2, 'fail')];
emitter.emit('start', { units, tdd: true });
emitter.emit('runUnit', { unit: units[1] });
setTimeout(() => {
emitter.emit('errorUnit');
expect(units[1].metadata.debug).toBe(true);
done();
}, utils.spinnerInterval + 1);
});
});
| 1.585938 | 2 |
components/loader.js | glitchdigital/glitched.news | 14 | 15994604 | export default class extends React.Component {
render() {
return(
<div className="loader">
<div className="spinner-border text-primary" role="status">
<span className="sr-only">Loading...</span>
</div>
</div>
)
}
} | 0.769531 | 1 |
backend/src/models/index.js | molaux/mui-app-boilerplate | 2 | 15994612 | 'use strict'
import dotenv from 'dotenv-flow'
import fs from 'fs'
import Sequelize from 'sequelize'
import configData from '../../config/model.json'
import { fileURLToPath } from 'url'
import path, { dirname } from 'path'
import sqliteModelConverter from './sqlite'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
dotenv.config({
silent: true
})
const env = process.env.NODE_ENV || 'development'
const loadModels = async () => {
const isDirectory = source => fs.lstatSync(source).isDirectory()
const getDirectories = source =>
fs.readdirSync(source)
.map(name => path.join(source, name))
.filter(source => isDirectory(source) && source.indexOf('.') !== 0)
const dbs = {}
for (const dbDirName of getDirectories(__dirname)) {
const dbName = path.basename(dbDirName)
console.log(`Loading ${dbName} database repo...`)
const config = configData[dbName][env]
if (config.logging === true) {
config.logging = console.log
}
const sequelize = config.use_env_variable
? new Sequelize(process.env[config.use_env_variable], config)
: new Sequelize(config.database, config.username, config.password, config)
const models = await Promise.all(fs
.readdirSync(dbDirName)
.filter(file => {
return (file.indexOf('.') !== 0) && (file !== path.basename(__filename)) && (file.slice(-4) === '.cjs')
})
.map(async file => await Promise.all([
import(path.join(dbDirName, file)),
fs.existsSync(path.join(dbDirName, 'extensions', file))
? import(path.join(dbDirName, 'extensions', file))
: Promise.resolve({ default: { definition: sequelize => o => o } })
])
)
).then(modules => modules.reduce((o, [module, extension]) => {
let dialectConverter = (x) => x
if (sequelize.options.dialect === 'sqlite') {
dialectConverter = sqliteModelConverter(sequelize)
}
const extend = (baseDefinition) => extension.default.definition?.(sequelize)(dialectConverter(baseDefinition))
const model = module.default(sequelize, extend)
model.extraAssociate = extension.default.associate?.(sequelize)
return ({ ...o, [model.name]: model })
}, {}))
Object.keys(models).forEach(modelName => {
models[modelName].associate?.(models)
models[modelName].extraAssociate?.(models[modelName])
})
dbs[dbName] = sequelize
}
return dbs
}
export default loadModels
| 1.351563 | 1 |
dist/cron-tab/hourly.js | gamingcrafts/react-cron-generator | 0 | 15994620 | import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import React, { Component } from 'react';
import Minutes from '../minutes-select';
import Hour from '../hour-select';
var HourlyCron = /*#__PURE__*/function (_Component) {
_inherits(HourlyCron, _Component);
var _super = _createSuper(HourlyCron);
function HourlyCron(props) {
var _this;
_classCallCheck(this, HourlyCron);
_this = _super.call(this, props);
_this.state = {
every: false
};
_this.onHourChange = _this.onHourChange.bind(_assertThisInitialized(_this));
_this.onAtHourChange = _this.onAtHourChange.bind(_assertThisInitialized(_this));
_this.onAtMinuteChange = _this.onAtMinuteChange.bind(_assertThisInitialized(_this));
return _this;
}
_createClass(HourlyCron, [{
key: "componentWillMount",
value: function componentWillMount() {
this.state.value = this.props.value;
if (this.state.value[2].split('/')[1] || this.state.value[2] === '*') {
this.state.every = true;
}
}
}, {
key: "onHourChange",
value: function onHourChange(e) {
if (this.state.every && (e.target.value > 0 && e.target.value < 24 || e.target.value === '')) {
var val = ['0', '0', '*', '*', '*', '?', '*'];
val[2] = e.target.value ? "0/".concat(e.target.value) : e.target.value;
val[3] = '1/1';
this.props.onChange(val);
}
}
}, {
key: "onAtHourChange",
value: function onAtHourChange(e) {
var val = ['0', this.state.value[1], '*', '1/1', '*', '?', '*'];
val[2] = "".concat(e.target.value);
this.props.onChange(val);
}
}, {
key: "onAtMinuteChange",
value: function onAtMinuteChange(e) {
var val = ['0', '*', this.state.value[2], '1/1', '*', '?', '*'];
val[1] = "".concat(e.target.value);
this.props.onChange(val);
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var translateFn = this.props.translate;
this.state.value = this.props.value;
return /*#__PURE__*/React.createElement("div", {
className: "tab-content"
}, /*#__PURE__*/React.createElement("div", {
className: "tab-pane active"
}, /*#__PURE__*/React.createElement("div", {
className: "well well-small"
}, /*#__PURE__*/React.createElement("input", {
type: "radio",
onChange: function onChange(e) {
_this2.setState({
every: true
});
_this2.props.onChange(['0', '0', '0/1', '1/1', '*', '?', '*']);
},
checked: this.state.every
}), /*#__PURE__*/React.createElement("span", null, translateFn('Every'), " "), /*#__PURE__*/React.createElement("input", {
disabled: !this.state.every,
type: "Number",
onChange: this.onHourChange,
value: this.state.value[2].split('/')[1] ? this.state.value[2].split('/')[1] : ''
}), /*#__PURE__*/React.createElement("span", null, translateFn('hour(s)'))), /*#__PURE__*/React.createElement("div", {
className: "well df well-small margin-right-0 margin-left-0"
}, /*#__PURE__*/React.createElement("div", {
className: "col-md-offset-2 col-md-6 text_align_right"
}, /*#__PURE__*/React.createElement("input", {
type: "radio",
onChange: function onChange(e) {
_this2.setState({
every: false
});
_this2.props.onChange();
},
checked: !this.state.every
}), /*#__PURE__*/React.createElement("span", {
className: "margin-right-10 "
}, translateFn('At')), /*#__PURE__*/React.createElement(Hour, {
disabled: this.state.every,
onChange: this.onAtHourChange,
value: this.state.value[2]
}), /*#__PURE__*/React.createElement(Minutes, {
disabled: this.state.every,
onChange: this.onAtMinuteChange,
value: this.state.value[1]
})))));
}
}]);
return HourlyCron;
}(Component);
export { HourlyCron as default }; | 1.765625 | 2 |
infra/bridge/src/utils/hooks.js | OriginProtocol/Origin | 391 | 15994628 | 'use strict'
/**
* Returns the host of the bridge
* For webhooks on `development` environment, returns the tunnel host
*/
function getHost() {
const HOST =
process.env.NODE_ENV === 'development'
? process.env.WEBHOOK_TUNNEL_HOST
: process.env.HOST
return HOST
}
/**
* Returns the webhook endpoint
* @param {String} service Can be twitter/telegram
*/
function getWebhookURL(service) {
return `https://${getHost()}/hooks/${service.toLowerCase()}`
}
/**
* Returns the consumer key to be used for webhooks
*/
function getTwitterWebhookConsumerKey() {
return (
process.env.TWITTER_WEBHOOKS_CONSUMER_KEY ||
process.env.TWITTER_CONSUMER_KEY
)
}
/**
* Returns the consumer secret to be used for webhooks
*/
function getTwitterWebhookConsumerSecret() {
return (
process.env.TWITTER_WEBHOOKS_CONSUMER_SECRET ||
process.env.TWITTER_CONSUMER_SECRET
)
}
module.exports = {
getHost,
getWebhookURL,
getTwitterWebhookConsumerKey,
getTwitterWebhookConsumerSecret
}
| 1.351563 | 1 |
packages/codistica-core/src/__tests__/constants/reg-exps.test.js | codistica/codistica-js | 10 | 15994636 | import {assert} from 'chai';
import {REG_EXPS} from '../../constants/reg-exps.js';
import {SEEDS} from '../../constants/seeds.js';
import {checkAll} from '../../modules/reg-exp-utils/internals/check-all.js';
/** @see module:core/constants/reg-exps */
function regExpsTest() {
describe('REG_EXPS', () => {
const specialChars = SEEDS.special
.replace(SEEDS.alpha, '')
.replace(SEEDS.num, '');
it('Should match e-mail like strings.', () => {
assert.isTrue(checkAll('<EMAIL>', REG_EXPS.IS_EMAIL));
assert.isTrue(checkAll('tt-ne_25@tst-test.<EMAIL>', REG_EXPS.IS_EMAIL));
assert.isFalse(checkAll('<EMAIL>', REG_EXPS.IS_EMAIL));
assert.isFalse(checkAll('no <EMAIL>', REG_EXPS.IS_EMAIL));
assert.isFalse(checkAll('not-ending@test', REG_EXPS.IS_EMAIL));
});
it('Should match RegExp reserved characters.', () => {
assert.isTrue(
checkAll(REG_EXPS.LETTERS.toString(), REG_EXPS.REG_EXP_RESERVED)
);
assert.isTrue(checkAll('Test /^H+/', REG_EXPS.REG_EXP_RESERVED));
assert.isFalse(checkAll('abc', REG_EXPS.REG_EXP_RESERVED));
});
it('Should match letters.', () => {
SEEDS.alpha.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.LETTERS));
});
SEEDS.num.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.LETTERS));
});
specialChars.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.LETTERS));
});
assert.isTrue(checkAll('000T000', REG_EXPS.LETTERS));
assert.isFalse(checkAll('12!@3()-/?|{}<>.,', REG_EXPS.LETTERS));
});
it('Should match non-capital letters.', () => {
SEEDS.alphaLow.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.LOW_LETTERS));
});
SEEDS.alphaUp.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.LOW_LETTERS));
});
SEEDS.num.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.LOW_LETTERS));
});
specialChars.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.LOW_LETTERS));
});
assert.isTrue(checkAll('445 15m {}:', REG_EXPS.LOW_LETTERS));
assert.isFalse(checkAll('0(^.> MM', REG_EXPS.LOW_LETTERS));
});
it('Should match capital letters.', () => {
SEEDS.alphaUp.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.UP_LETTERS));
});
SEEDS.alphaLow.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.UP_LETTERS));
});
SEEDS.num.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.UP_LETTERS));
});
specialChars.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.UP_LETTERS));
});
assert.isTrue(checkAll('445 15M {}:', REG_EXPS.UP_LETTERS));
assert.isFalse(checkAll('445 15m {}:', REG_EXPS.UP_LETTERS));
});
it('Should match special characters.', () => {
specialChars.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.SPECIALS));
});
SEEDS.alphaNum.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.SPECIALS));
});
assert.isTrue(checkAll('445 15M {}:', REG_EXPS.SPECIALS));
assert.isFalse(checkAll('445 15 TYm', REG_EXPS.SPECIALS));
});
it('Should match non-letter characters.', () => {
SEEDS.alpha.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.NON_LETTERS));
});
SEEDS.num.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.NON_LETTERS));
});
specialChars.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.NON_LETTERS));
});
assert.isFalse(checkAll('TEST', REG_EXPS.NON_LETTERS));
assert.isTrue(checkAll('T3ST', REG_EXPS.NON_LETTERS));
});
it('Should match non-special characters.', () => {
specialChars.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isFalse(checkAll(char, REG_EXPS.NON_SPECIALS));
});
SEEDS.alphaNum.split(REG_EXPS.SPLIT_BY_CHAR).forEach((char) => {
assert.isTrue(checkAll(char, REG_EXPS.NON_SPECIALS));
});
assert.isFalse(checkAll('--+?/:"><', REG_EXPS.NON_SPECIALS));
assert.isFalse(checkAll('', REG_EXPS.NON_SPECIALS));
assert.isTrue(checkAll('12!@3()-/?|{}<>.,', REG_EXPS.NON_SPECIALS));
});
it('Should match strings starting with a letter.', () => {
assert.isFalse(checkAll('445 15M {}:', REG_EXPS.FIRST_LETTERS));
assert.isTrue(checkAll('5654 T765', REG_EXPS.FIRST_LETTERS));
assert.isTrue(checkAll('j785 1121', REG_EXPS.FIRST_LETTERS));
});
it('Should match every not empty string.', () => {
assert.isFalse(checkAll('', REG_EXPS.SPLIT_BY_CHAR));
assert.isTrue(checkAll(' ', REG_EXPS.SPLIT_BY_CHAR));
assert.isTrue(checkAll('t', REG_EXPS.SPLIT_BY_CHAR));
});
it('Should match short HEX colors.', () => {
assert.isFalse(checkAll('#111111', REG_EXPS.SHORTHEX));
assert.isTrue(checkAll('#111', REG_EXPS.SHORTHEX));
assert.isTrue(checkAll('#AaA', REG_EXPS.SHORTHEX));
assert.isFalse(checkAll('#zzz', REG_EXPS.SHORTHEX));
});
it('Should match long HEX colors.', () => {
assert.isFalse(checkAll('#111', REG_EXPS.LONGHEX));
assert.isTrue(checkAll('#111111', REG_EXPS.LONGHEX));
assert.isTrue(checkAll('#A9ff10', REG_EXPS.LONGHEX));
assert.isFalse(checkAll('#a9fF1z', REG_EXPS.LONGHEX));
});
});
}
export {regExpsTest};
| 1.484375 | 1 |
sugar/clients/portal/views/list/list.js | tonyberrynd/SugarDockerized | 0 | 15994644 | /*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then do not
* install or use this SugarCRM file.
*
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
({
extendsFrom: 'ListView',
sidebarClosed: false,
initialize: function(options) {
this._super('initialize', [options]);
// Once the sidebartoggle is rendered we close the sidebar so the arrows are updated SP-719
app.controller.context.on('sidebarRendered', this.closeSidebar, this);
// FIXME: This is a copy-paste from flex-list.js. Remove this when
// doing TY-728
this._fields = _.flatten(_.pluck(this.meta.panels, 'fields'));
},
closeSidebar: function() {
if (!this.sidebarClosed) {
app.controller.context.trigger('toggleSidebar');
this.sidebarClosed = true;
}
}
})
| 0.898438 | 1 |
src/models/category.js | yoohan-dex/seven-rabbit-admin | 0 | 15994652 | import api from '../api/category';
export default {
namespace: 'category',
state: {
category: '',
categories: [],
list: [],
toggle: false,
},
effects: {
*modOne({ payload }, { call, put }) {
yield call(api.modCategory, payload);
yield put({
type: 'fetchCategory',
});
yield put({
type: 'fetchCategory',
});
},
*getOne({ payload }, { call, put }) {
const res = yield call(api.getOne, payload);
yield put({
type: 'saveOne',
payload: res,
});
},
*del({ payload }, { call, put }) {
yield call(api.delCategory, payload);
yield put({
type: 'fetchCategory',
});
},
*submit({ payload }, { call, put }) {
yield call(api.addCategory, payload);
yield put({
type: 'fetchCategory',
});
},
*add({ payload }, { call, put }) {
yield call(api.addFilter, payload);
yield put({
type: 'fetch',
});
},
*fetchCategory(_, { call, put }) {
const response = yield call(api.getCategory);
yield put({
type: 'saveCategory',
payload: Array.isArray(response) ? response : [],
});
yield put({
type: 'toggle',
payload: false,
});
},
*fetch(_, { call, put }) {
const response = yield call(api.getFilters);
yield put({
type: 'saveList',
payload: Array.isArray(response) ? response : [],
});
},
},
reducers: {
saveCategory(state, action) {
return {
...state,
categories: action.payload,
};
},
saveList(state, action) {
return {
...state,
list: action.payload,
};
},
saveOne(state, action) {
return {
...state,
category: action.payload,
};
},
toggle(state, action) {
return {
...state,
toggle: action.payload,
};
},
},
};
| 1.117188 | 1 |
dev/composi/lib2/utils/removeElement.js | composor/composi-masterminds | 0 | 15994660 | import { removeChildren } from './removeChildren'
/**
* @description Function to remove element from DOM.
* @param {Node} parent The containing element in which the component resides.
* @param {Node} element The parent of the element to remove.
* @namespace {Node} node The element to remove.
* @property {Object} node.props
* @returns {void} undefined
*/
export const removeElement = (parent, element, node) => {
parent.removeChild(removeChildren(element, node))
if (node && node.props && node.props['onComponentDidUnmount']) {
node.props['onComponentDidUnmount'].call(
node.props['onComponentDidUnmount'],
parent
)
}
}
| 1.046875 | 1 |
src/App.js | oloruntomiojo/foodnet | 0 | 15994668 | import styled, { ThemeProvider } from 'styled-components';
import Home from './pages/Home';
import { GlobalStyles } from './styles/GlobalStyles';
import { lightTheme, darkTheme } from "./styles/theme";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import Header from './components/Header';
import Footer from './components/Footer';
import { useChangeTheme } from './hooks/useChangeTheme';
import ComingSoon from './pages/ComingSoon';
function App() {
const [ theme, toggleTheme ] = useChangeTheme();
const themeMode = theme === "light" ? lightTheme : darkTheme;
return (
<Router>
<AppContainer>
<ThemeProvider
theme={themeMode}>
<GlobalStyles />
<Header toggleTheme={toggleTheme} theme={theme} />
<main>
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route path="/comingsoon">
<ComingSoon />
</Route>
</Switch>
</main>
<Footer id="contact" />
</ThemeProvider>
</AppContainer>
</Router>
);
}
export default App;
const AppContainer = styled.div`
overflow: hidden;
max-width: 1440px;
margin: 0 auto;
`; | 1.335938 | 1 |
src/Variables/index.js | Saif807380/es6-examples | 1 | 15994676 | export const variablesExample = function () {
console.log("Variable declaration keywords in ES6 - const and let");
// constants
const x = 10;
// const x = 5, throws error variable redeclared
// x = 5, throws error variable cannot be reassigned
// let keyword, lexicographical scoping
var y = 10;
let z = 15;
// y = 10, z = 15
console.log("Before y = " + y + " z = " + z);
if (x > 5) {
// var changes in global scope
// let redeclares in local scope
var y = 5;
let z = 5;
}
// y = 5, z = 15,
console.log("After y = " + y + " z = " + z);
};
| 1.898438 | 2 |
wordpress/wp-content/plugins/leadin/js/src/feedback/feedback.js | adayguerra/cloud-run-wordpress | 0 | 15994684 | import $ from 'jquery';
import Raven, { configureRaven } from '../lib/Raven';
import { domElements } from '../constants/selectors';
import ThickBoxModal from './ThickBoxModal';
import { submitFeedbackForm } from './feedbackFormApi';
function deactivatePlugin() {
window.location.href = $(domElements.deactivatePluginButton).attr('href');
}
function setLoadingState() {
$(domElements.deactivateFeedbackSubmit).addClass('loading');
}
function submitAndDeactivate(e) {
e.preventDefault();
setLoadingState();
submitFeedbackForm(domElements.deactivateFeedbackForm)
.then(deactivatePlugin)
.catch(err => {
Raven.captureException(err);
deactivatePlugin();
});
}
function init() {
// eslint-disable-next-line no-unused-vars
const feedbackModal = new ThickBoxModal(
domElements.deactivatePluginButton,
'leadin-feedback-container',
'leadin-feedback-window',
'leadin-feedback-content'
);
$(domElements.deactivateFeedbackForm)
.unbind('submit')
.submit(submitAndDeactivate);
$(domElements.deactivateFeedbackSkip)
.unbind('click')
.click(deactivatePlugin);
}
$(document).ready(() => {
configureRaven();
Raven.context(init);
});
| 1.3125 | 1 |
api/get_active_leases.js | networkshokunin/glass-isc-dhcp | 572 | 15994700 | /**
* Created by cmiles on 8/9/2017.
*/
var express = require('express');
var router = express.Router();
router.get('/', function (req, res, next) {
var lease_parser = require('../core/lease-parser.js');
lease_parser.clean();
var dhcp_lease_data_return_buffer = {};
var search_string = req.query.search;
if (typeof search_string !== "undefined") {
for (var key in dhcp_lease_data) {
var matcher = new RegExp(search_string, "i");
if (
!matcher.test(dhcp_lease_data[key].mac_oui_vendor)
&& !matcher.test(dhcp_lease_data[key].host)
&& !matcher.test(key)
&& !matcher.test(dhcp_lease_data[key].mac)
)
continue;
if (typeof dhcp_lease_data_return_buffer[key] !== "undefined")
dhcp_lease_data_return_buffer[key] = {};
dhcp_lease_data_return_buffer[key] = dhcp_lease_data[key];
}
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify(dhcp_lease_data_return_buffer));
return true;
}
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify(dhcp_lease_data));
});
module.exports = router; | 1.257813 | 1 |
src/file-upload/src/file-upload-editing.js | xumoqiu/ckeditor5-classic-build | 1 | 15994708 | import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import Widget from '@ckeditor/ckeditor5-widget/src/widget';
import {
toWidget,
toWidgetEditable
} from '@ckeditor/ckeditor5-widget/src/utils';
import InsertSjkFileUploadEditorCommand from './file-upload-command.js'
import '../theme/file-upload.css';
export default class fileUploadEditing extends Plugin {
static get requires() {
return [Widget];
}
init() {
this._defineSchema();
this._defineConverters();
//this._addDownloadListener();
this.editor.commands.add('insertFileUploadBox', new InsertSjkFileUploadEditorCommand(this.editor));
}
// 文件下载框点击事件
// _addDownloadListener() {
// document.addEventListener('click', (e) => {
// if (e.target.getAttribute('class') === 's-name') {
// var a = document.createElement('a');
// a.href = e.target.getAttribute('href');
// a.target = '_blank';
// a.click();
// } else {
// return false;
// }
// });
// }
_defineSchema() {
const schema = this.editor.model.schema;
schema.register('sjk-attachment', {
isObject: true, // 会把 sjk-attachment 当成一个整体处理
allowAttributes: ['attr_href', 'href', 'name', 'size', 'attr_name', 'attr_size'],
// Allow in places where other blocks are allowed (e.g. directly in the root).
allowWhere: '$block'
});
schema.register('sjk-name', {
allowWhere: '$block',
isLimit: true,
allowAttributes: ['href', 'name', 'target', 'download'],
allowIn: 'sjk-attachment',
});
}
_defineConverters() {
const conversion = this.editor.conversion;
//downcast(model-to-view)
//upcast(view-to-model)
//为了在视图中将<sjk-attachment>模型元素转换为<div class='s-attachment'></div>
conversion.for('editingDowncast')
.elementToElement({
model: 'sjk-attachment',
view: (modelItem, writer) => {
const viewWrapper = writer.createContainerElement('div', { class: 's-attachment' });
return toWidget(viewWrapper, writer);
}
});
conversion.for('dataDowncast')
.elementToElement({
model: 'sjk-attachment',
view: (modelItem, writer) => {
return writer.createContainerElement('div', { class: 's-attachment' });
}
});
//---------
conversion.for('downcast').elementToElement({
model: 'sjk-attachment',
view: (modelItem, writer) => {
const div = writer.createContainerElement('div', { class: 's-attachment' });
return toWidget(div, writer);
}
});
conversion.for('upcast').elementToElement({
converterPriority: 'high',
view: {
name: 'div',
classes: 's-attachment'
},
model: (viewElement, modelWriter) => {
return modelWriter.createElement('sjk-attachment', {
attr_href: viewElement._children[0].getAttribute('attr_href') || '',
name: viewElement._children[0].getAttribute('attr_name') || '',
size: viewElement._children[0].getAttribute('attr_size') || ''
});
}
});
//sjk-name
conversion.for('editingDowncast')
.elementToElement({
model: 'sjk-name',
view: (modelItem, writer) => {
const href = modelItem._attrs.get('href');
const name = modelItem._attrs.get('name');
const aTarget = writer.createContainerElement('a', {
class: 's-name',
href: href,
target: '_blank',
download: href,
name: name
});
const textNode = writer.createText(name);
writer.insert(writer.createPositionAt(aTarget, 0), textNode);
return aTarget;
}
});
conversion.for('dataDowncast')
.elementToElement({
model: 'sjk-name',
view: (modelItem, writer) => {
const href = modelItem._attrs.get('href');
const name = modelItem._attrs.get('name');
const aTarget = writer.createContainerElement('a', {
class: 's-name',
href: href,
target: '_blank',
download: href,
name: name
});
const textNode = writer.createText(name);
writer.insert(writer.createPositionAt(aTarget, 0), textNode);
return aTarget;
}
});
conversion.for('downcast').elementToElement({
model: 'sjk-name',
view: (modelItem, writer) => {
const href = modelItem._attrs.get('href');
const name = modelItem._attrs.get('name');
return writer.createContainerElement('a', {
class: 's-name',
href: href,
target: '_blank',
download: href,
name: name
});
}
});
conversion.for('upcast').elementToElement({
converterPriority: 'high',
view: {
name: 'a',
classes: 's-name'
},
model: (viewElement, modelWriter) => {
const aTarget = modelWriter.createElement('sjk-name', {
href: viewElement._attrs.get('href') || '',
name: viewElement._attrs.get('name') || '',
target: '_blank',
download: viewElement._attrs.get('href') || ''
});
return aTarget;
// const href = viewElement._attrs.get('href') || '';
// const name = viewElement._attrs.get('name') || '';
// const aTarget = modelWriter.createContainerElement('a', {
// class: 's-name',
// href: href,
// target: '_blank',
// download: href,
// name: name
// });
// modelWriter.insertText(viewElement._attrs.get('name'), modelWriter.createPositionAt(aTarget, 0));
return aTarget;
}
});
};
} | 1.476563 | 1 |
index.js | gwintzer/piwik_tracker | 2 | 15994716 | export default function (kibana) {
return new kibana.Plugin({
require: ['elasticsearch'],
name: 'piwik-tracker',
uiExports: {
hacks: [
'plugins/piwik-tracker/hack'
],
uiSettingDefaults: {
'piwik-tracker:enabled': {
value: false,
description: 'Enable the Kibana page tracking for all users of the instance'
},
'piwik-tracker:siteId': {
value: "undefined",
description: 'Set the website id'
},
'piwik-tracker:trackerUrl': {
value: "undefined",
description: 'Set the tracker url'
}
}
},
config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
}).default();
},
});
}
| 1.023438 | 1 |
src/utils.spec.js | Blackdread/honeycomb | 468 | 15994724 | /* eslint-env mocha */
import { expect } from 'chai'
import { compassToNumberDirection, signedModulo } from './utils'
describe('signedModulo', () => {
describe('when called with a negative dividend', () => {
it('returns the modulo mirrored from the divider(?)', () => {
expect(signedModulo(1, 6)).to.equal(1)
expect(signedModulo(-1, 6)).to.equal(5)
})
})
})
describe('compassToNumberDirection', () => {
let orientation
describe('when called with an invalid compass direction', () => {
it('throws', () => {
expect(() => compassToNumberDirection('invalid')).to.throw(
'Invalid compass direction: invalid. Choose from E, SE, S, SW, W, NW, N or NE.',
)
})
})
describe('when called with an ambiguous compass direction', () => {
it('throws', () => {
expect(() => compassToNumberDirection('N', 'pointy')).to.throw(
`Direction N is ambiguous for pointy hexes. Did you mean NE or NW?`,
)
expect(() => compassToNumberDirection('S', 'pointy')).to.throw(
`Direction S is ambiguous for pointy hexes. Did you mean SE or SW?`,
)
expect(() => compassToNumberDirection('E', 'flat')).to.throw(
`Direction E is ambiguous for flat hexes. Did you mean NE or SE?`,
)
expect(() => compassToNumberDirection('W', 'flat')).to.throw(
`Direction W is ambiguous for flat hexes. Did you mean NW or SW?`,
)
})
})
describe('when called with a pointy orientation', () => {
before(() => {
orientation = 'pointy'
})
it('converts a compass direction to a number direction', () => {
expect(compassToNumberDirection('E', orientation)).to.equal(0)
expect(compassToNumberDirection('SE', orientation)).to.equal(1)
expect(compassToNumberDirection('SW', orientation)).to.equal(2)
expect(compassToNumberDirection('W', orientation)).to.equal(3)
expect(compassToNumberDirection('NW', orientation)).to.equal(4)
expect(compassToNumberDirection('NE', orientation)).to.equal(5)
})
})
describe('when called with a flat orientation', () => {
before(() => {
orientation = 'flat'
})
it('converts a compass direction to a number direction', () => {
expect(compassToNumberDirection('SE', orientation)).to.equal(0)
expect(compassToNumberDirection('S', orientation)).to.equal(1)
expect(compassToNumberDirection('SW', orientation)).to.equal(2)
expect(compassToNumberDirection('NW', orientation)).to.equal(3)
expect(compassToNumberDirection('N', orientation)).to.equal(4)
expect(compassToNumberDirection('NE', orientation)).to.equal(5)
})
})
})
| 1.6875 | 2 |
index.js | washingtoncitypaper/dc-election-scraper | 2 | 15994732 | var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var config = require('./config.js');
var election = config.election,
election_path = config.settings[election].election_path,
races = config.settings[election].races;
var precinct = first_precinct = config.first_precinct,
last_precinct = config.last_precinct;
var results = {}; // this object will be written to a JSON file when all scraping is done
for (var race in races) {
results[races[race].race_name] = {};
results[races[race].race_name]['TOTAL'] = {};
}
results.metadata = {};
var is_error_free = true,
start_stamp = Date.now(),
start_time = new Date;
(function scrape() {
if (precinct <= last_precinct) {
request('https://www.dcboee.org/election_info/election_results/v3/' + election_path + '?hdn_results_tab=p&hdn_precinct=' + precinct, function (error, response, html) {
if (!error && response.statusCode == 200) {
var $ = cheerio.load(html);
if (precinct == 1) {
results.metadata.precincts_reporting = $('.col-md-6:contains("Precincts Counted: ")').html().trim().split(': ')[1];
console.log('Precincts reporting: ' + results.metadata.precincts_reporting);
}
console.log('Scraping precinct ' + precinct);
for (var race in races) {
var race_name = races[race].race_name;
results[race_name]['p_' + precinct] = {};
var this_precinct_total_votes = 0;
for (var i = 0; i < races[race].candidates.length; i++) {
var selector = 'table:contains("' + race_name + '") td:contains("' + races[race].candidates[i] + '")';
var votes = null;
if ($(selector).length) {
votes = Number($(selector).next().html().replace(/\D/g,''));
}
if (votes != null) {
this_precinct_total_votes += votes;
results[race_name]['p_' + precinct][races[race].candidates[i]] = votes;
}
}
results[race_name]['p_' + precinct]['Total'] = this_precinct_total_votes;
}
} else {
console.log(error);
is_error_free = false;
}
precinct++;
scrape(); // scrape again once the current scrape has finished
});
} else {
var end_stamp = Date.now(),
end_time = new Date;
results.metadata.start_time = start_time.toString();
results.metadata.end_time = end_time.toString();
results.metadata.scrape_duration = (end_stamp - start_stamp) / 1000 + ' seconds';
results.metadata.races = races;
for (var race in races) {
var race_name = races[race].race_name;
var candidates = races[race].candidates;
for (var j = 0; j < candidates.length; j++) {
results[race_name]['TOTAL'][candidates[j]] = 0;
}
var total_of_totals = 0;
for (var i = first_precinct; i <= last_precinct; i++) {
var precinct_results = results[race_name]['p_' + i];
total_of_totals += precinct_results['Total'];
for (var j = 0; j < candidates.length; j++) {
if (precinct_results[candidates[j]]) {
results[race_name]['TOTAL'][candidates[j]] += precinct_results[candidates[j]];
}
}
}
results[race_name]['TOTAL']['Total'] = total_of_totals;
}
if (is_error_free) {
fs.writeFile('public/javascripts/results/scrape_' + election + '.json', JSON.stringify(results), function (err) {
var scrape_message = err ? err : 'Scrape successful';
console.log(scrape_message);
fs.writeFile('log/scrape_' + start_stamp + '.json', JSON.stringify(results, null, '\t'), function (err) {
var log_message = err ? err : 'Scrape logged';
console.log(log_message);
});
});
}
}
}()); | 1.523438 | 2 |