commit
stringlengths 40
40
| old_file
stringlengths 4
264
| new_file
stringlengths 4
264
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
624
| message
stringlengths 15
4.7k
| lang
stringclasses 3
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
|
---|---|---|---|---|---|---|---|---|---|
779fdd103374a6edb27d555e23aaace7a6f7caa3
|
public/assets/default/js/thread.js
|
public/assets/default/js/thread.js
|
$(document).ready(function(){
var simplemde = new SimpleMDE({
element: $("#postreply")[0],
autosave: {
enabled: true,
delay: 2000,
unique_id: "thread-" + window.thread_id // save drafts based on thread id
},
spellChecker: false
});
});
|
$(document).ready(function(){
var simplemde = new SimpleMDE({
element: $("#postreply")[0],
// Autosave disabled temporarily because it keeps it's content even after submitting (Clearboard will use a custom AJAX submit function)
/*autosave: {
enabled: true,
delay: 2000,
unique_id: "thread-" + window.thread_id // save drafts based on thread id
},*/
spellChecker: false
});
});
|
Disable SimpleMDE autosaving, as it retains it would retain it's content after posting
|
Disable SimpleMDE autosaving, as it retains it would retain it's content after posting
|
JavaScript
|
mit
|
clearboard/clearboard,mitchfizz05/clearboard,mitchfizz05/clearboard,clearboard/clearboard
|
45dfb547c46f25255759f6ebcdc95f59cf1d9c75
|
commonjs/cookie-opt.js
|
commonjs/cookie-opt.js
|
var componentEvent = require('kwf/component-event');
var cookies = require('js-cookie');
var CookieOpt = {};
CookieOpt.getDefaultOpt = function() {
return 'in'; // TODO get from baseProperty
};
CookieOpt.isSetOpt = function() {
return !!cookies.get('cookieOpt');
};
CookieOpt.getOpt = function() {
if (CookieOpt.isSetOpt()) {
return cookies.get('cookieOpt');
} else {
return CookieOpt.getDefaultOpt();
}
};
CookieOpt.setOpt = function(value) {
var opt = cookies.get('cookieOpt');
cookies.set('cookieOpt', value, { expires: 3*365 });
if (opt != value) {
componentEvent.trigger('cookieOptChanged', value);
}
};
CookieOpt.onOptChange = function(callback) {
componentEvent.on('cookieOptChanged', callback);
};
module.exports = CookieOpt;
|
var componentEvent = require('kwf/component-event');
var cookies = require('js-cookie');
var $ = require('jQuery');
var CookieOpt = {};
CookieOpt.getDefaultOpt = function() {
var defaultOpt = $('body').data('cookieDefaultOpt');
if (defaultOpt != 'in' && defaultOpt != 'out') defaultOpt = 'in';
return defaultOpt;
};
CookieOpt.isSetOpt = function() {
return !!cookies.get('cookieOpt');
};
CookieOpt.getOpt = function() {
if (CookieOpt.isSetOpt()) {
return cookies.get('cookieOpt');
} else {
return CookieOpt.getDefaultOpt();
}
};
CookieOpt.setOpt = function(value) {
var opt = cookies.get('cookieOpt');
cookies.set('cookieOpt', value, { expires: 3*365 });
if (opt != value) {
componentEvent.trigger('cookieOptChanged', value);
}
};
CookieOpt.onOptChange = function(callback) {
componentEvent.on('cookieOptChanged', callback);
};
module.exports = CookieOpt;
|
Read default cookie opt setting from body data tag
|
Read default cookie opt setting from body data tag
|
JavaScript
|
bsd-2-clause
|
koala-framework/koala-framework,kaufmo/koala-framework,kaufmo/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework
|
20347bfe721a0189e77978561400e5cb23132a11
|
Kwf_js/Utils/YoutubePlayer.js
|
Kwf_js/Utils/YoutubePlayer.js
|
Ext.namespace('Kwf.Utils.YoutubePlayer');
Kwf.Utils.YoutubePlayer.isLoaded = false;
Kwf.Utils.YoutubePlayer.isCallbackCalled = false;
Kwf.Utils.YoutubePlayer.callbacks = [];
Kwf.Utils.YoutubePlayer.load = function(callback, scope)
{
if (Kwf.Utils.YoutubePlayer.isCallbackCalled) {
callback.call(scope || window);
return;
}
Kwf.Utils.YoutubePlayer.callbacks.push({
callback: callback,
scope: scope
});
if (Kwf.Utils.YoutubePlayer.isLoaded) return;
Kwf.Utils.YoutubePlayer.isLoaded = true;
var tag = document.createElement('script');
tag.setAttribute('type', 'text/javascript');
tag.setAttribute('src', '//www.youtube.com/iframe_api');
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
};
if (typeof window.onYouTubePlayerAPIReady == 'undefined') {
window.onYouTubePlayerAPIReady = function() {
Kwf.Utils.YoutubePlayer.isCallbackCalled = true;
Kwf.Utils.YoutubePlayer.callbacks.forEach(function(i) {
i.callback.call(i.scope || window);
});
}
}
|
Ext.namespace('Kwf.Utils.YoutubePlayer');
Kwf.Utils.YoutubePlayer.isLoaded = false;
Kwf.Utils.YoutubePlayer.isCallbackCalled = false;
Kwf.Utils.YoutubePlayer.callbacks = [];
Kwf.Utils.YoutubePlayer.load = function(callback, scope)
{
if (Kwf.Utils.YoutubePlayer.isCallbackCalled) {
callback.call(scope || window);
return;
}
Kwf.Utils.YoutubePlayer.callbacks.push({
callback: callback,
scope: scope
});
if (Kwf.Utils.YoutubePlayer.isLoaded) return;
Kwf.Utils.YoutubePlayer.isLoaded = true;
var tag = document.createElement('script');
tag.setAttribute('type', 'text/javascript');
tag.setAttribute('src', 'http://www.youtube.com/iframe_api');
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
};
if (typeof window.onYouTubePlayerAPIReady == 'undefined') {
window.onYouTubePlayerAPIReady = function() {
Kwf.Utils.YoutubePlayer.isCallbackCalled = true;
Kwf.Utils.YoutubePlayer.callbacks.forEach(function(i) {
i.callback.call(i.scope || window);
});
}
}
|
Revert "get dynamicly if https or http is supported for youtube iframe api"
|
Revert "get dynamicly if https or http is supported for youtube iframe api"
This reverts commit ffbdfe78a884b06447ff6da01137820224081962.
|
JavaScript
|
bsd-2-clause
|
koala-framework/koala-framework,yacon/koala-framework,nsams/koala-framework,Ben-Ho/koala-framework,Sogl/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework,yacon/koala-framework,kaufmo/koala-framework,Sogl/koala-framework,Ben-Ho/koala-framework,yacon/koala-framework,kaufmo/koala-framework,nsams/koala-framework,nsams/koala-framework
|
a62a28a4819f038ab46a32fee32869cc54c920e2
|
web/src/searchQuery.js
|
web/src/searchQuery.js
|
// This is a second entry point to speed up our query
// to fetch search results.
// We've patched react-scripts to add this as another entry
// point. E.g., the Webpack config by running lives at
// web/node_modules/react-scripts/config/webpack.config.js.
// After modifying files in react-scripts, commit the
// patches with:
// `yarn patch-package react-scripts`
// You can view the patch diff in ./web/patches.
// For this to be meaningful, we have to make sure we inject
// this script first, before all other app code.
// Return an empty script when building the newtab app.
// The newtab app will still build this entry point because
// we share Webpack configs.
if (process.env.REACT_APP_WHICH_APP === 'search') {
const {
// eslint-disable-next-line no-unused-vars
prefetchSearchResults,
} = require('js/components/Search/fetchBingSearchResults')
const getSearchResults = () => {
var t = performance.now()
// console.log('searchQuery', t)
window.debug.searchQuery = t
// TODO
// If the path is /query, call fetchBingSearchResults.
// Let it handle the logic of determining the search query, etc.
// prefetchSearchResults()
}
getSearchResults()
}
|
// This is a second entry point to speed up our query
// to fetch search results.
// We've patched react-scripts to add this as another entry
// point. E.g., the Webpack config by running lives at
// web/node_modules/react-scripts/config/webpack.config.js.
// After modifying files in react-scripts, commit the
// patches with:
// `yarn patch-package react-scripts`
// You can view the patch diff in ./web/patches.
// For this to be meaningful, we have to make sure we inject
// this script first, before all other app code.
// TODO: add tests for env var and other logic
// Return an empty script when building the newtab app.
// The newtab app will still build this entry point because
// we share Webpack configs.
if (process.env.REACT_APP_WHICH_APP === 'search') {
const {
// eslint-disable-next-line no-unused-vars
prefetchSearchResults,
} = require('js/components/Search/fetchBingSearchResults')
const getSearchResults = () => {
var t = performance.now()
// console.log('searchQuery', t)
window.debug.searchQuery = t
// TODO
// If the path is /query, call fetchBingSearchResults.
// Let it handle the logic of determining the search query, etc.
prefetchSearchResults()
}
getSearchResults()
}
|
Enable prefetching to try it out
|
Enable prefetching to try it out
|
JavaScript
|
mpl-2.0
|
gladly-team/tab,gladly-team/tab,gladly-team/tab
|
ba9c863de909906382b55309e1cfe0e0ce935308
|
spec/html/QueryStringSpec.js
|
spec/html/QueryStringSpec.js
|
describe("QueryString", function() {
describe("#setParam", function() {
it("sets the query string to include the given key/value pair", function() {
var windowLocation = {
search: ""
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
queryString.setParam("foo", "bar baz");
expect(windowLocation.search).toMatch(/foo=bar%20baz/);
});
});
describe("#getParam", function() {
it("returns the value of the requested key", function() {
var windowLocation = {
search: "?baz=quux%20corge"
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
expect(queryString.getParam("baz")).toEqual("quux corge");
});
it("returns null if the key is not present", function() {
var windowLocation = {
search: ""
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
expect(queryString.getParam("baz")).toBeFalsy();
});
});
});
|
describe("QueryString", function() {
describe("#setParam", function() {
it("sets the query string to include the given key/value pair", function() {
var windowLocation = {
search: ""
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
queryString.setParam("foo", "bar baz");
expect(windowLocation.search).toMatch(/foo=bar%20baz/);
});
it("leaves existing params alone", function() {
var windowLocation = {
search: "?foo=bar"
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
queryString.setParam("baz", "quux");
expect(windowLocation.search).toMatch(/foo=bar/);
expect(windowLocation.search).toMatch(/baz=quux/);
});
});
describe("#getParam", function() {
it("returns the value of the requested key", function() {
var windowLocation = {
search: "?baz=quux%20corge"
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
expect(queryString.getParam("baz")).toEqual("quux corge");
});
it("returns null if the key is not present", function() {
var windowLocation = {
search: ""
},
queryString = new j$.QueryString({
getWindowLocation: function() { return windowLocation }
});
expect(queryString.getParam("baz")).toBeFalsy();
});
});
});
|
Add spec to verify custom query params are left alone
|
Add spec to verify custom query params are left alone
[#29578495]
|
JavaScript
|
mit
|
faizalpribadi/jasmine,danielalexiuc/jasmine,GerHobbelt/jasmine,Contagious06/jasmine,tsaikd/jasmine,negherbon/jasmine,soycode/jasmine,mashroomxl/jasmine,mashroomxl/jasmine,WY08271/jasmine,GerHobbelt/jasmine,songshuangkk/jasmine,rlugojr/jasmine,paulcbetts/jasmine,IveWong/jasmine,leahciMic/jasmine,morsdyce/jasmine,danielalexiuc/jasmine,kalins/samples-javascript.jasmine,rlugojr/jasmine,qiangyee/jasmine,caravenase/jasmine,songshuangkk/jasmine,kalins/samples-javascript.jasmine,kidaa/jasmine,deborahleehamel/jasmine,caravenase/jasmine,paulcbetts/jasmine,aaron-goshine/jasmine,aln787/jasmine,suvarnaraju/jasmine,faizalpribadi/jasmine,rlugojr/jasmine,GerHobbelt/jasmine,soycode/jasmine,tsaikd/jasmine,Contagious06/jasmine,denisKaranja/jasmine,Contagious06/jasmine,leahciMic/jasmine,JoseRoman/jasmine,Sanjo/jasmine,faizalpribadi/jasmine,kyroskoh/jasmine,rlugojr/jasmine,wongterrencew/jasmine,marcioj/jasmine,morsdyce/jasmine,Muktesh01/jasmine,kidaa/jasmine,Muktesh01/jasmine,tsaikd/jasmine,mashroomxl/jasmine,suvarnaraju/jasmine,antialias/jasmine,seanparmelee/jasmine,jnayoub/jasmine,caravenase/jasmine,negherbon/jasmine,jnayoub/jasmine,faizalpribadi/jasmine,James-Dunn/jasmine,James-Dunn/jasmine,qiangyee/jasmine,seanlin816/jasmine,SimenB/jasmine,James-Dunn/jasmine,Contagious06/jasmine,SimenB/jasmine,paulcbetts/jasmine,SimenB/jasmine,kyroskoh/jasmine,seanlin816/jasmine,xolvio/jasmine,aln787/jasmine,caravenase/jasmine,xolvio/jasmine,jnayoub/jasmine,songshuangkk/jasmine,yy8597/jasmine,Sanjo/jasmine,caravena-nisum-com/jasmine,seanlin816/jasmine,WY08271/jasmine,qiangyee/jasmine,caravenase/jasmine,caravena-nisum-com/jasmine,marcioj/jasmine,yy8597/jasmine,deborahleehamel/jasmine,tsaikd/jasmine,martinma4/jasmine,danielalexiuc/jasmine,IveWong/jasmine,danielalexiuc/jasmine,WY08271/jasmine,yy8597/jasmine,morsdyce/jasmine,aln787/jasmine,xolvio/jasmine,songshuangkk/jasmine,JoseRoman/jasmine,Jahred/jasmine,wongterrencew/jasmine,WY08271/jasmine,negherbon/jasmine,caravena-nisum-com/jasmine,suvarnaraju/jasmine,wongterrencew/jasmine,martinma4/jasmine,Sanjo/jasmine,paulcbetts/jasmine,aln787/jasmine,caravena-nisum-com/jasmine,rlugojr/jasmine,kalins/samples-javascript.jasmine,aln787/jasmine,aaron-goshine/jasmine,seanlin816/jasmine,kyroskoh/jasmine,Muktesh01/jasmine,qiangyee/jasmine,martinma4/jasmine,leahciMic/jasmine,denisKaranja/jasmine,SimenB/jasmine,GerHobbelt/jasmine,seanparmelee/jasmine,kidaa/jasmine,antialias/jasmine,deborahleehamel/jasmine,qiangyee/jasmine,songshuangkk/jasmine,negherbon/jasmine,martinma4/jasmine,James-Dunn/jasmine,negherbon/jasmine,paulcbetts/jasmine,wongterrencew/jasmine,Jahred/jasmine,xolvio/jasmine,kyroskoh/jasmine,marcioj/jasmine,seanparmelee/jasmine,deborahleehamel/jasmine,tsaikd/jasmine,Sanjo/jasmine,danielalexiuc/jasmine,SimenB/jasmine,mashroomxl/jasmine,JoseRoman/jasmine,mashroomxl/jasmine,seanlin816/jasmine,aaron-goshine/jasmine,aaron-goshine/jasmine,imshibaji/jasmine,marcioj/jasmine,morsdyce/jasmine,yy8597/jasmine,Muktesh01/jasmine,denisKaranja/jasmine,leahciMic/jasmine,caravena-nisum-com/jasmine,soycode/jasmine,deborahleehamel/jasmine,JoseRoman/jasmine,WY08271/jasmine,jnayoub/jasmine,Jahred/jasmine,kidaa/jasmine,Jahred/jasmine,IveWong/jasmine,suvarnaraju/jasmine,kalins/samples-javascript.jasmine,leahciMic/jasmine,imshibaji/jasmine,imshibaji/jasmine,soycode/jasmine,GerHobbelt/jasmine,kyroskoh/jasmine,Contagious06/jasmine,jnayoub/jasmine,imshibaji/jasmine,soycode/jasmine,IveWong/jasmine,antialias/jasmine,faizalpribadi/jasmine,marcioj/jasmine,denisKaranja/jasmine,xolvio/jasmine,kidaa/jasmine,JoseRoman/jasmine,Sanjo/jasmine,Jahred/jasmine,imshibaji/jasmine,seanparmelee/jasmine,yy8597/jasmine,antialias/jasmine,wongterrencew/jasmine,suvarnaraju/jasmine,morsdyce/jasmine,James-Dunn/jasmine,antialias/jasmine,IveWong/jasmine,aaron-goshine/jasmine,kalins/samples-javascript.jasmine,denisKaranja/jasmine,seanparmelee/jasmine,Muktesh01/jasmine,martinma4/jasmine
|
585467648d0ec67da6cde967a1e17b07014638b8
|
src/native/app/components/Text.react.js
|
src/native/app/components/Text.react.js
|
import React, { Component, PropTypes } from 'react';
import theme from '../theme';
import { StyleSheet, Text } from 'react-native';
const styles = StyleSheet.create({
text: {
color: theme.textColor,
fontFamily: theme.fontFamily,
fontSize: theme.fontSize,
},
});
// Normalize multiline strings because Text component preserves spaces.
const normalizeMultilineString = message => message.replace(/ +/g, ' ').trim();
export default class AppText extends Component {
static propTypes = {
children: PropTypes.node,
style: Text.propTypes.style,
};
constructor() {
super();
this.onTextRef = this.onTextRef.bind(this);
}
onTextRef(text) {
this.text = text;
}
setNativeProps(nativeProps) {
this.text.setNativeProps(nativeProps);
}
render() {
const { children, style } = this.props;
const fontSize = (style && style.fontSize) || theme.fontSize;
const lineHeight = fontSize * theme.lineHeight;
return (
<Text
{...this.props}
ref={this.onTextRef}
style={[styles.text, style, { lineHeight }]}
>
{typeof children === 'string'
? normalizeMultilineString(children)
: children
}
</Text>
);
}
}
|
import React, { Component, PropTypes } from 'react';
import theme from '../theme';
import { StyleSheet, Text } from 'react-native';
const styles = StyleSheet.create({
text: { // eslint-disable-line react-native/no-unused-styles
color: theme.textColor,
fontFamily: theme.fontFamily,
fontSize: theme.fontSize,
lineHeight: theme.fontSize * theme.lineHeight,
},
});
// Normalize multiline strings because Text component preserves spaces.
const normalizeMultilineString = message => message.replace(/ +/g, ' ').trim();
export default class AppText extends Component {
static propTypes = {
children: PropTypes.node,
style: Text.propTypes.style,
};
constructor() {
super();
this.onTextRef = this.onTextRef.bind(this);
}
onTextRef(text) {
this.text = text;
}
setNativeProps(nativeProps) {
this.text.setNativeProps(nativeProps);
}
getTextStyleWithMaybeComputedLineHeight() {
const { style } = this.props;
if (!style) {
return styles.text;
}
const customFontSize = StyleSheet.flatten(style).fontSize;
if (!Number.isInteger(customFontSize)) {
return [styles.text, style];
}
const lineHeight = customFontSize * theme.lineHeight;
return [styles.text, style, { lineHeight }];
}
render() {
const { children } = this.props;
const textStyle = this.getTextStyleWithMaybeComputedLineHeight();
return (
<Text {...this.props} ref={this.onTextRef} style={textStyle}>
{typeof children === 'string'
? normalizeMultilineString(children)
: children
}
</Text>
);
}
}
|
Fix native Text computed lineHeight
|
Fix native Text computed lineHeight
|
JavaScript
|
mit
|
este/este,robinpokorny/este,TheoMer/Gyms-Of-The-World,skallet/este,christophediprima/este,robinpokorny/este,cjk/smart-home-app,christophediprima/este,TheoMer/Gyms-Of-The-World,TheoMer/este,christophediprima/este,christophediprima/este,steida/este,TheoMer/este,TheoMer/este,sikhote/davidsinclair,sikhote/davidsinclair,este/este,este/este,steida/este,skallet/este,sikhote/davidsinclair,TheoMer/Gyms-Of-The-World,skallet/este,este/este,robinpokorny/este
|
9692dfc1f91f9fe3c87a1afe4df8d613f78f885c
|
bin/startBot.js
|
bin/startBot.js
|
const RoundpiecesBot = require('./../src/roundpiecesbot');
const token = process.env.ROUNDPIECES_API_KEY;
const adminUserName = process.env.ROUNDPIECES_ADMIN_USERNAME;
const listPath = process.env.ROUNDPIECES_LIST_PATH;
const startSearch = '00 * * * * *';
const endSearch = '30 * * * * *';
const resetSearch = '55 * * * * *';
if (token && adminUserName && listPath) {
const roundpiecesBot = new RoundpiecesBot({
token: token,
name: 'Roundpieces Administration Bot',
adminUserName: adminUserName,
listPath: listPath,
cronRanges: {
start: startSearch,
end: endSearch,
reset: resetSearch
}
});
roundpiecesBot.run();
}
else {
console.error(`Environment is not properly configured. Please make sure you have set\n
ROUNDPIECES_API_KEY to the slack bot API token
ROUNDPIECES_ADMIN_USERNAME to the slack username of your roundpieces administrator
ROUNDPIECES_LIST_PATH to the absolute path to your list of participants`);
}
|
const RoundpiecesBot = require('./../src/roundpiecesbot');
const token = process.env.ROUNDPIECES_API_KEY;
const adminUserName = process.env.ROUNDPIECES_ADMIN_USERNAME;
const listPath = process.env.ROUNDPIECES_LIST_PATH;
const startSearch = '00 00 9 * * 4'; // 09.00 Thursdays
const endSearch = '00 00 12 * * 4'; // 12.00 Thursdays
const resetSearch = '00 00 9 * * 5'; // 09.00 Fridays
if (token && adminUserName && listPath) {
const roundpiecesBot = new RoundpiecesBot({
token: token,
name: 'Roundpieces Administration Bot',
adminUserName: adminUserName,
listPath: listPath,
cronRanges: {
start: startSearch,
end: endSearch,
reset: resetSearch
}
});
roundpiecesBot.run();
}
else {
console.error(`Environment is not properly configured. Please make sure you have set\n
ROUNDPIECES_API_KEY to the slack bot API token
ROUNDPIECES_ADMIN_USERNAME to the slack username of your roundpieces administrator
ROUNDPIECES_LIST_PATH to the absolute path to your list of participants`);
}
|
Set cron ranges to match real arrangement times
|
Set cron ranges to match real arrangement times
|
JavaScript
|
mit
|
jbroni/roundpieces-slackbot
|
cc033abb20799f36b170e607ce95297491781eda
|
utility.js
|
utility.js
|
const path = require( 'path' )
const fs = require( 'fs' )
// Create a new path from arguments.
const getAbsolutePath = ( ...args ) => path.resolve( path.join.apply( null, args ) )
const isExist = filePath => {
try {
fs.statSync( path.resolve( filePath ) )
return true
} catch( error ){
return false
}
}
module.exports = {
getAbsolutePath: getAbsolutePath,
isExist : isExist
}
|
const path = require( 'path' )
const fs = require( 'fs' )
// Create a new path from arguments.
const getAbsolutePath = ( ...args ) => path.resolve( path.join.apply( null, args ) )
const isExist = filePath => {
try {
fs.statSync( path.resolve( filePath ) )
return true
} catch( error ){
return false
}
}
const read = filePath => fs.readFileSync( filePath, 'utf-8' )
const write = ( filePath, content ) => fs.writeFileSync( filePath, content )
module.exports = {
getAbsolutePath: getAbsolutePath,
isExist : isExist,
read : read,
write : write
}
|
Add method to read and write
|
Add method to read and write
|
JavaScript
|
mit
|
Yacona/yacona
|
edeca61db29c3076b41c005eace74e2555f76be3
|
test/helpers/benchmarkReporter.js
|
test/helpers/benchmarkReporter.js
|
const chalk = require('chalk');
function benchmarkResultsToConsole(suite){
console.log("\n");
console.log("==================");
console.log("Benchmark results:");
console.log("------------------");
var bench;
for(var testNo = 0; testNo < suite.length; testNo++){
bench = suite[testNo];
console.log(chalk.green.underline(bench.name) +
"\n Ops/sec: " + chalk.bold.bgBlue(bench.hz.toFixed(bench.hz < 100 ? 2 : 0)) +
chalk.dim(' ±' + bench.stats.rme.toFixed(2) + '% ') +
chalk.gray('Ran ' + bench.count + ' times in ' +
bench.times.cycle.toFixed(3) + ' seconds.'));
}
console.log("===================");
}
if (typeof exports !== "undefined") {
exports.benchmarkResultsToConsole = benchmarkResultsToConsole;
}
|
const chalk = require('chalk');
function benchmarkResultsToConsole(suite){
console.log("\n");
console.log("==================");
console.log("Benchmark results:");
console.log("------------------");
var bench;
for(var testNo = 0; testNo < suite.length; testNo++){
bench = suite[testNo];
console.log(chalk.green.underline(bench.name) +
"\n Ops/sec: " + chalk.bold.magenta(bench.hz.toFixed(bench.hz < 100 ? 2 : 0)) +
chalk.dim(' ±' + bench.stats.rme.toFixed(2) + '% ') +
chalk.gray('Ran ' + bench.count + ' times in ' +
bench.times.cycle.toFixed(3) + ' seconds.'));
}
console.log("===================");
}
if (typeof exports !== "undefined") {
exports.benchmarkResultsToConsole = benchmarkResultsToConsole;
}
|
Change benchmark results color to magenta
|
Change benchmark results color to magenta
as white on blue is barely visible in travis
|
JavaScript
|
mit
|
baranga/JSON-Patch,Starcounter-Jack/JSON-Patch,baranga/JSON-Patch,Starcounter-Jack/JSON-Patch,baranga/JSON-Patch,baranga/JSON-Patch,Starcounter-Jack/JSON-Patch,Starcounter-Jack/JSON-Patch
|
f55703a7a027651e141b753058abec7cbdf28e89
|
test/jsx-no-logical-expression.js
|
test/jsx-no-logical-expression.js
|
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import rule from '../src/rules/jsx-no-logical-expression';
const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true
}
}
});
const ruleId = 'jsx-no-logical-expression';
const message = 'JSX should not use logical expression';
const error = {
ruleId,
message,
type: 'LogicalExpression'
};
ruleTester.run(ruleId, rule, {
valid: [
'{true ? <div /> : null}',
'{false || false ? <div /> : null}',
'{true && true ? <div /> : null}'
],
invalid: [
{
code: '{true && <div />}',
errors: [error]
},
{
code: '{true || <div />}',
errors: [error]
}
]
});
|
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import rule from '../src/rules/jsx-no-logical-expression';
const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true
}
}
});
const ruleId = 'jsx-no-logical-expression';
const message = 'JSX should not use logical expression';
const error = {
ruleId,
message,
type: 'LogicalExpression'
};
ruleTester.run(ruleId, rule, {
valid: [
'{true ? <div /> : null}',
'{false || false ? <div /> : null}',
'{true && true ? <div /> : null}'
],
invalid: [
{
code: '{true && <div />}',
errors: [error]
},
{
code: '{true || <div />}',
errors: [error]
},
{
code: '{false && <div />}',
errors: [error]
},
{
code: '{undefined && <div />}',
errors: [error]
},
{
code: '{0 && <div />}',
errors: [error]
}
]
});
|
Add another invalid use case
|
Add another invalid use case
|
JavaScript
|
mit
|
CoorpAcademy/eslint-plugin-coorpacademy
|
d05e4d520f627b555fc52f243db307275eb7ca39
|
tests/unit/adapters/github-release-test.js
|
tests/unit/adapters/github-release-test.js
|
import { moduleFor, test } from 'ember-qunit';
moduleFor('adapter:github-release', 'Unit | Adapter | github release', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let adapter = this.subject();
assert.ok(adapter);
});
test('it builds the URL for the releases query correctly', function(assert) {
let adapter = this.subject();
const host = adapter.get('host');
const repo = 'jimmay5469/old-hash';
assert.equal(adapter.buildURL('github-release', null, null, 'query', { repo: repo }), `${host}/repos/${repo}/releases`);
});
test('it builds the URL for a specific release query correctly', function(assert) {
let adapter = this.subject();
const host = adapter.get('host');
const repo = 'jimmay5469/old-hash';
const release = 1;
assert.equal(
adapter.buildURL('github-release', null, null, 'queryRecord', { repo: repo, releaseId: release }),
`${host}/repos/${repo}/releases/${release}`
);
});
|
import { moduleFor, test } from 'ember-qunit';
moduleFor('adapter:github-release', 'Unit | Adapter | github release', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
test('it exists', function(assert) {
let adapter = this.subject();
assert.ok(adapter);
});
test('it builds the URL for the releases query correctly', function(assert) {
let adapter = this.subject();
const host = adapter.get('host');
const repo = 'jimmay5469/old-hash';
assert.equal(adapter.buildURL('github-release', null, null, 'query', { repo: repo }), `${host}/repos/${repo}/releases`);
});
test('it builds the URL for a specific release query correctly', function(assert) {
let adapter = this.subject();
const host = adapter.get('host');
const repo = 'jimmay5469/old-hash';
const release = 1;
assert.equal(
adapter.buildURL('github-release', null, null, 'queryRecord', { repo: repo, releaseId: release }),
`${host}/repos/${repo}/releases/${release}`
);
});
|
Remove the boilerplate comment now that we have more tests.
|
Remove the boilerplate comment now that we have more tests.
|
JavaScript
|
mit
|
elwayman02/ember-data-github,jimmay5469/ember-data-github,elwayman02/ember-data-github,jimmay5469/ember-data-github
|
0b13a34c60150e8eee5394b61233d451c7a933cb
|
assets/js/app.js
|
assets/js/app.js
|
$( document ).ready(function() {
/* Sidebar height set */
$('.sidebar').css('min-height',$(document).height());
/* Secondary contact links */
var scontacts = $('#contact-list-secondary');
var contact_list = $('#contact-list');
scontacts.hide();
contact_list.mouseenter(function(){ scontacts.fadeIn(); });
contact_list.mouseleave(function(){ scontacts.fadeOut(); });
});
|
$( document ).ready(function() {
/* Sidebar height set */
$('.sidebar').css('min-height',$(document).height());
/* Secondary contact links */
var scontacts = $('#contact-list-secondary');
var contact_list = $('#contact-list');
scontacts.hide();
contact_list.mouseenter(function(){ scontacts.fadeIn(); });
contact_list.mouseleave(function(){ scontacts.fadeOut(); });
// prevent line-breaks in links and make open in new tab
$('div.article_body a').not('[rel="footnote"], [rev="footnote"]').html(function(i, str) {
return str.replace(/ /g,' ');
}).attr('target','_blank');
});
|
Add target _blank on article links
|
Add target _blank on article links
|
JavaScript
|
mit
|
meumobi/meumobi.github.io,meumobi/meumobi.github.io,meumobi/meumobi.github.io
|
59c5b0cf7aade3943a2d9b664c5efacd4f23a14d
|
src/api-gateway-websocket/lambda-events/WebSocketDisconnectEvent.js
|
src/api-gateway-websocket/lambda-events/WebSocketDisconnectEvent.js
|
import WebSocketRequestContext from './WebSocketRequestContext.js'
// TODO this should be probably moved to utils, and combined with other header
// functions and utilities
function createMultiValueHeaders(headers) {
return Object.entries(headers).reduce((acc, [key, value]) => {
acc[key] = [value]
return acc
}, {})
}
export default class WebSocketDisconnectEvent {
constructor(connectionId) {
this._connectionId = connectionId
}
create() {
const headers = {
Host: 'localhost',
'x-api-key': '',
'x-restapi': '',
}
const multiValueHeaders = createMultiValueHeaders(headers)
const requestContext = new WebSocketRequestContext(
'DISCONNECT',
'$disconnect',
this._connectionId,
).create()
return {
headers,
isBase64Encoded: false,
multiValueHeaders,
requestContext,
}
}
}
|
import WebSocketRequestContext from './WebSocketRequestContext.js'
import { parseHeaders, parseMultiValueHeaders } from '../../utils/index.js'
export default class WebSocketDisconnectEvent {
constructor(connectionId) {
this._connectionId = connectionId
}
create() {
// TODO FIXME not sure where the headers come from
const rawHeaders = ['Host', 'localhost', 'x-api-key', '', 'x-restapi', '']
const headers = parseHeaders(rawHeaders)
const multiValueHeaders = parseMultiValueHeaders(rawHeaders)
const requestContext = new WebSocketRequestContext(
'DISCONNECT',
'$disconnect',
this._connectionId,
).create()
return {
headers,
isBase64Encoded: false,
multiValueHeaders,
requestContext,
}
}
}
|
Rewrite header handling in websocket disconnect event
|
Rewrite header handling in websocket disconnect event
|
JavaScript
|
mit
|
dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline,dherault/serverless-offline
|
3a1638c1538b902bc8cebbf6b969798240f84157
|
demo/server.js
|
demo/server.js
|
var config = require('./webpack.config.js');
var webpack = require('webpack');
var webpackDevServer = require('webpack-dev-server');
var compiler;
var server;
// Source maps
config.devtool = 'source-map';
config.output.publicPath = '/dist/';
// Remove minification to speed things up.
config.plugins.splice(1, 2);
// Add Hot Loader server entry points.
config.entry.app.unshift(
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server'
);
// Add HMR plugin
config.plugins.unshift(new webpack.HotModuleReplacementPlugin());
// Add React Hot loader
config.module.loaders[0].loaders.unshift('react-hot');
compiler = webpack(config);
server = new webpackDevServer(compiler, {
publicPath: config.output.publicPath,
hot: true
});
server.listen(8080);
|
var config = require('./webpack.config.js');
var webpack = require('webpack');
var webpackDevServer = require('webpack-dev-server');
var compiler;
var server;
// Source maps
config.devtool = 'eval';
config.output.publicPath = '/dist/';
// Remove minification to speed things up.
config.plugins.splice(1, 2);
// Add Hot Loader server entry points.
config.entry.app.unshift(
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server'
);
// Add HMR plugin
config.plugins.unshift(new webpack.HotModuleReplacementPlugin());
// Add React Hot loader
config.module.loaders[0].loaders.unshift('react-hot');
compiler = webpack(config);
server = new webpackDevServer(compiler, {
publicPath: config.output.publicPath,
hot: true
});
server.listen(8080);
|
Improve hot loading compile time
|
Improve hot loading compile time
|
JavaScript
|
mit
|
acorn421/react-html5video-subs,mderrick/react-html5video,Caseworx/inferno-html5video,Caseworx/inferno-html5video,acorn421/react-html5video-subs
|
49d8d01a14fb235c999473915667144d890e125b
|
src/components/video_list.js
|
src/components/video_list.js
|
import React from 'react'
import VideoListItem from './video_list_item'
const VideoList = (props) => {
const videoItems = props.videos.map((video) => {
return <VideoListItem video={video} />
});
return (
<ul className="col-md-4 list-group">
{videoItems}
</ul>
);
};
export default VideoList;
|
import React from 'react'
import VideoListItem from './video_list_item'
const VideoList = (props) => {
const videoItems = props.videos.map((video) => {
return <VideoListItem key={video.etag} video={video} />
});
return (
<ul className="col-md-4 list-group">
{videoItems}
</ul>
);
};
export default VideoList;
|
Add etag as unique key
|
Add etag as unique key
Finish 25
|
JavaScript
|
mit
|
fifiteen82726/ReduxSimpleStarter,fifiteen82726/ReduxSimpleStarter
|
60b20d83f4fdc9c625b56a178c93af1533b82a60
|
src/redux/modules/card.js
|
src/redux/modules/card.js
|
import uuid from 'uuid';
import { Record as record } from 'immutable';
export class CardModel extends record({
name: '',
mana: null,
attack: null,
defense: null,
portrait: null,
}) {
constructor(obj) {
super(obj);
this.id = uuid.v4();
}
}
|
// import uuid from 'uuid';
import { Record as record } from 'immutable';
export const CardModel = record({
id: null,
name: '',
mana: null,
attack: null,
defense: null,
portrait: null,
});
|
Remove id from Record and add id field
|
Remove id from Record and add id field
Reason: on CardModel.update() it doesn’t keep the id field, so shit
crashes
|
JavaScript
|
mit
|
inooid/react-redux-card-game,inooid/react-redux-card-game
|
153b9121bc2971e916ddc78045ebc6afc8a8ec5e
|
src/acorn_plugin/skipBlockComment.js
|
src/acorn_plugin/skipBlockComment.js
|
export default function skipSpace() {
// https://github.com/ternjs/acorn/blob/master/src/tokenize.js#L100-L116
return function ha(endSign) {
const endS = endSign ? endSign : '*/';
let startLoc = this.options.onComment && this.curPosition();
let start = this.pos, end = this.input.indexOf(endS, this.pos += endS.length);
if (end === -1) this.raise(this.pos - 2, "Unterminated comment")
this.pos = end + endS.length
if (this.options.locations) {
lineBreakG.lastIndex = start
let match
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
++this.curLine
this.lineStart = match.index + match[0].length
}
}
if (this.options.onComment)
this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
startLoc, this.curPosition())
};
}
|
// eslint-disable
export default function skipSpace() {
// https://github.com/ternjs/acorn/blob/master/src/tokenize.js#L100-L116
return function ha(endSign) {
const endS = endSign ? endSign : '*/';
let startLoc = this.options.onComment && this.curPosition();
let start = this.pos,
end = this.input.indexOf(endS, this.pos += endS.length);
if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
this.pos = end + endS.length;
if (this.options.locations) {
lineBreakG.lastIndex = start
let match
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
++this.curLine
this.lineStart = match.index + match[0].length
}
}
if (this.options.onComment)
this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
startLoc, this.curPosition())
};
}
|
Disable eslint for this for now.
|
Disable eslint for this for now.
|
JavaScript
|
mit
|
laosb/hatp
|
bc24c83daef21248ee0ab141675bd6170c399403
|
tests/specs/misc/on-error/main.js
|
tests/specs/misc/on-error/main.js
|
define(function(require) {
var test = require('../../../test')
var n = 0
// 404
var a = require('./a')
test.assert(a === null, '404 a')
// exec error
setTimeout(function() {
var b = require('./b')
}, 0)
require.async('./c', function(c) {
test.assert(c === null, '404 c')
done()
})
require.async('./e', function(e) {
test.assert(e === null, 'exec error e')
done()
})
seajs.use('./d', function(d) {
test.assert(d === null, '404 d')
done()
})
// 404 css
//require('./f.css')
function done() {
if (++n === 3) {
test.assert(w_errors.length === 2, w_errors.length)
test.assert(s_errors.length === 4, s_errors.length)
test.next()
}
}
})
|
define(function(require) {
var test = require('../../../test')
var n = 0
// 404
var a = require('./a')
test.assert(a === null, '404 a')
// exec error
setTimeout(function() {
var b = require('./b')
}, 0)
require.async('./c', function(c) {
test.assert(c === null, '404 c')
done()
})
require.async('./e', function(e) {
test.assert(e === null, 'exec error e')
done()
})
seajs.use('./d', function(d) {
test.assert(d === null, '404 d')
done()
})
// 404 css
//require('./f.css')
function done() {
if (++n === 3) {
test.assert(w_errors.length > 0, w_errors.length)
test.assert(s_errors.length === 4, s_errors.length)
test.next()
}
}
})
|
Improve specs for error event
|
Improve specs for error event
|
JavaScript
|
mit
|
jishichang/seajs,eleanors/SeaJS,baiduoduo/seajs,ysxlinux/seajs,kaijiemo/seajs,wenber/seajs,uestcNaldo/seajs,PUSEN/seajs,zaoli/seajs,JeffLi1993/seajs,13693100472/seajs,tonny-zhang/seajs,chinakids/seajs,ysxlinux/seajs,kuier/seajs,Gatsbyy/seajs,wenber/seajs,miusuncle/seajs,mosoft521/seajs,treejames/seajs,Lyfme/seajs,imcys/seajs,yern/seajs,AlvinWei1024/seajs,yuhualingfeng/seajs,yern/seajs,kuier/seajs,FrankElean/SeaJS,lianggaolin/seajs,zwh6611/seajs,tonny-zhang/seajs,13693100472/seajs,treejames/seajs,miusuncle/seajs,FrankElean/SeaJS,MrZhengliang/seajs,baiduoduo/seajs,coolyhx/seajs,angelLYK/seajs,longze/seajs,PUSEN/seajs,sheldonzf/seajs,liupeng110112/seajs,hbdrawn/seajs,judastree/seajs,mosoft521/seajs,judastree/seajs,longze/seajs,hbdrawn/seajs,twoubt/seajs,baiduoduo/seajs,AlvinWei1024/seajs,Lyfme/seajs,lovelykobe/seajs,yuhualingfeng/seajs,zaoli/seajs,jishichang/seajs,ysxlinux/seajs,moccen/seajs,evilemon/seajs,LzhElite/seajs,lee-my/seajs,seajs/seajs,moccen/seajs,lovelykobe/seajs,zwh6611/seajs,miusuncle/seajs,lovelykobe/seajs,chinakids/seajs,yuhualingfeng/seajs,sheldonzf/seajs,twoubt/seajs,LzhElite/seajs,lee-my/seajs,liupeng110112/seajs,treejames/seajs,MrZhengliang/seajs,lianggaolin/seajs,kaijiemo/seajs,judastree/seajs,longze/seajs,imcys/seajs,Gatsbyy/seajs,coolyhx/seajs,Lyfme/seajs,angelLYK/seajs,121595113/seajs,uestcNaldo/seajs,seajs/seajs,evilemon/seajs,JeffLi1993/seajs,eleanors/SeaJS,liupeng110112/seajs,kaijiemo/seajs,Gatsbyy/seajs,sheldonzf/seajs,jishichang/seajs,PUSEN/seajs,eleanors/SeaJS,LzhElite/seajs,AlvinWei1024/seajs,JeffLi1993/seajs,evilemon/seajs,121595113/seajs,yern/seajs,seajs/seajs,mosoft521/seajs,kuier/seajs,zaoli/seajs,FrankElean/SeaJS,angelLYK/seajs,zwh6611/seajs,wenber/seajs,moccen/seajs,tonny-zhang/seajs,MrZhengliang/seajs,coolyhx/seajs,twoubt/seajs,lianggaolin/seajs,uestcNaldo/seajs,imcys/seajs,lee-my/seajs
|
670dff868d04ab149bd252b6835b224a202a5bd1
|
lib/provider.js
|
lib/provider.js
|
'use babel';
import {filter} from 'fuzzaldrin';
import commands from './commands';
import variables from './variables';
export const selector = '.source.cmake';
export const disableForSelector = '.source.cmake .comment';
export const inclusionPriority = 1;
function existy(value) {
return value != null;
}
function dispatch() {
var funs = arguments;
return function() {
for (var f of funs) {
var ret = f.apply(null, arguments);
if (existy(ret)) {
return ret;
}
}
};
}
function variables_suggestions(prefix) {
return filter(variables, prefix.toUpperCase()).map((variable) => ({
text: variable,
displayText: variable,
type: 'variable'
}));
}
function commands_suggestions(prefix) {
return filter(commands, prefix.toLowerCase()).map((command) => ({
text: `${command}()`,
displayText: command,
type: 'function'
}));
}
const suggest = dispatch(
(prefix, scope_descriptor) => {
if (scope_descriptor.scopes.length > 1) {
return variables_suggestions(prefix);
}
},
(prefix) => commands_suggestions(prefix)
)
export function getSuggestions({prefix, scopeDescriptor: scope_descriptor}) {
return suggest(prefix, scope_descriptor);
}
|
'use babel';
import {filter} from 'fuzzaldrin';
import commands from './commands';
import variables from './variables';
export const selector = '.source.cmake';
export const disableForSelector = '.source.cmake .comment';
export const inclusionPriority = 1;
function existy(value) {
return value != null;
}
function dispatch() {
var funs = arguments;
return function() {
for (var f of funs) {
var ret = f.apply(null, arguments);
if (existy(ret)) {
return ret;
}
}
};
}
function variables_suggestions(prefix) {
return filter(variables, prefix.toUpperCase()).map((variable) => ({
text: variable,
displayText: variable,
type: 'variable'
}));
}
function commands_suggestions(prefix) {
return filter(commands, prefix.toLowerCase()).map((command) => ({
text: `${command}()`,
displayText: command,
type: 'function'
}));
}
const suggest = dispatch(
(prefix, scope_descriptor) => {
if (scope_descriptor.scopes.length > 1) {
return variables_suggestions(prefix);
}
},
(prefix) => commands_suggestions(prefix)
)
export function getSuggestions({prefix, scopeDescriptor: scope_descriptor}) {
return suggest(prefix, scope_descriptor);
}
export function onDidInsertSuggestion({editor, suggestion}) {
if (suggestion && suggestion.type === 'function') {
editor.moveLeft(1);
}
}
|
Move cursor left on function completion.
|
Move cursor left on function completion.
|
JavaScript
|
mit
|
NealRame/autocomplete-cmake
|
7bfb2f65427182294c4582bb6bf1234daa193791
|
shell/Gruntfile.js
|
shell/Gruntfile.js
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"download-atom-shell": {
version: "0.20.3",
outputDir: "./atom-shell",
rebuild: true
}
});
grunt.loadNpmTasks('grunt-download-atom-shell');
};
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"download-atom-shell": {
version: "0.19.5",
outputDir: "./atom-shell",
rebuild: true
}
});
grunt.loadNpmTasks('grunt-download-atom-shell');
};
|
Revert back to older atom-shell where remote-debugging works
|
Revert back to older atom-shell where remote-debugging works
This allows console to work again.
In b5b1c142b6d92d3f254c93aa43432230d4d31e14 we upgraded to an
atom-shell where remote-debugging /json doesn't seem to work.
Details at atom/atom-shell#969
|
JavaScript
|
mit
|
kolya-ay/LightTable,masptj/LightTable,youprofit/LightTable,kausdev/LightTable,0x90sled/LightTable,EasonYi/LightTable,youprofit/LightTable,kenny-evitt/LightTable,kenny-evitt/LightTable,brabadu/LightTable,ashneo76/LightTable,rundis/LightTable,0x90sled/LightTable,youprofit/LightTable,fdserr/LightTable,kolya-ay/LightTable,kausdev/LightTable,kausdev/LightTable,rundis/LightTable,mrwizard82d1/LightTable,masptj/LightTable,masptj/LightTable,ashneo76/LightTable,fdserr/LightTable,mpdatx/LightTable,windyuuy/LightTable,nagyistoce/LightTable,pkdevbox/LightTable,mrwizard82d1/LightTable,LightTable/LightTable,brabadu/LightTable,ashneo76/LightTable,bruno-oliveira/LightTable,Bost/LightTable,LightTable/LightTable,nagyistoce/LightTable,mpdatx/LightTable,hiredgunhouse/LightTable,BenjaminVanRyseghem/LightTable,craftybones/LightTable,mrwizard82d1/LightTable,hiredgunhouse/LightTable,bruno-oliveira/LightTable,pkdevbox/LightTable,EasonYi/LightTable,BenjaminVanRyseghem/LightTable,sbauer322/LightTable,sbauer322/LightTable,EasonYi/LightTable,kenny-evitt/LightTable,nagyistoce/LightTable,Bost/LightTable,bruno-oliveira/LightTable,sbauer322/LightTable,Bost/LightTable,mpdatx/LightTable,BenjaminVanRyseghem/LightTable,brabadu/LightTable,fdserr/LightTable,0x90sled/LightTable,windyuuy/LightTable,hiredgunhouse/LightTable,craftybones/LightTable,rundis/LightTable,craftybones/LightTable,windyuuy/LightTable,LightTable/LightTable,pkdevbox/LightTable,kolya-ay/LightTable
|
5a3b4b8010d20793c0ffcb36caeb27283aef61c5
|
src/components/Members/NavbarLink.js
|
src/components/Members/NavbarLink.js
|
import React from 'react';
import { Link } from 'react-router';
function NavbarLink({to, href, className, component, children}) {
const Comp = component || Link;
return (
<span>
{ href ?
<a href={href}>Yo</a>
:
<Comp to={to} className={className} activeStyle={{
color: '#A94545',
}}>
{children}
</Comp>
}
</span>
);
}
export default NavbarLink;
|
import React from 'react';
import { Link } from 'react-router';
function NavbarLink({ children, className, component, href, to }) {
const Comp = component || Link;
let Linkelement = (
<Comp to={to} className={className} activeStyle={{
color: '#A94545',
}}>
{children}
</Comp>
);
if (href) {
Linkelement = (
<a href={href}>
{children}
</a>
);
}
return Linkelement;
}
export default NavbarLink;
|
Modify link generation to allow off site links
|
Modify link generation to allow off site links
|
JavaScript
|
cc0-1.0
|
cape-io/acf-client,cape-io/acf-client
|
f6b0174625f669cef151cf8ef702d38b509fe95a
|
src/components/finish-order/index.js
|
src/components/finish-order/index.js
|
import { Component } from 'preact';
import style from './style';
export default class FinishOrder extends Component {
constructor(props) {
super(props);
}
render(props, state) {
return (
<div class="container">
<p class="">
Děkujeme, za Vaši objednávku. Budeme Vás kontaktovat. Detaily objednávky jsme Vám zaslali na email.
</p>
<a class="button" href="http://3dtovarna.cz/" class={`button two columns offset-by-four ${style['button']}`}>
OK
</a>
</div>
);
}
}
|
import { Component } from 'preact';
import style from './style';
export default class FinishOrder extends Component {
constructor(props) {
super(props);
}
render(props, state) {
return (
<div class="container">
<p class="">
Děkujeme, za Vaši objednávku. Budeme Vás kontaktovat. Detaily objednávky jsme Vám zaslali na email.
</p>
{/*<a class="button" href="http://3dtovarna.cz/" class={`button two columns offset-by-four ${style['button']}`}>*/}
{/*OK*/}
{/*</a>*/}
</div>
);
}
}
|
Disable redirect button on finish order page
|
Disable redirect button on finish order page
|
JavaScript
|
agpl-3.0
|
MakersLab/custom-print
|
741414856087c820963d3e688d5bbf88f5edf82a
|
src/components/googlemap/TaskPlot.js
|
src/components/googlemap/TaskPlot.js
|
import React, { PropTypes } from 'react';
import { List } from 'immutable';
import Polyline from './Polyline';
import Marker from './Marker';
class TaskPlot extends React.Component {
shouldComponentUpdate(nextProps) {
return (this.props.map !== nextProps.map) ||
(this.props.googlemaps !== nextProps.googlemaps) ||
(this.props.task !== nextProps.task);
}
render() {
const { task, googlemaps, map } = this.props;
const positions = task.map(waypoint => waypoint.get('position'));
let markers = positions.map((pos, index) =>
<Marker googlemaps={googlemaps} map={map} position={pos} key={index} />)
.toArray();
return (
<span>
<Polyline googlemaps={googlemaps} map={map} path={positions} />
{markers}
</span>
);
}
}
TaskPlot.propTypes = {
task: PropTypes.instanceOf(List),
map: PropTypes.object,
googlemaps: PropTypes.object
};
export default TaskPlot;
|
import React, { PropTypes } from 'react';
import { List } from 'immutable';
import Polyline from './Polyline';
import Marker from './Marker';
import * as icons from './icons';
class TaskPlot extends React.Component {
shouldComponentUpdate(nextProps) {
return (this.props.map !== nextProps.map) ||
(this.props.googlemaps !== nextProps.googlemaps) ||
(this.props.task !== nextProps.task);
}
render() {
const { task, googlemaps, map } = this.props;
const positions = task.map(waypoint => waypoint.get('position'));
const lastIndex = positions.count() - 1;
let markers = positions.map((pos, index) => {
let markerLabel;
switch (index) {
case lastIndex:
markerLabel = icons.UNICODE_CHEQUERED_FLAG;
break;
case 0:
markerLabel = 'S';
break;
default:
markerLabel = index.toString();
}
return (<Marker googlemaps={googlemaps} map={map} position={pos} label={markerLabel} key={index} />);
}).toArray();
return (
<span>
<Polyline googlemaps={googlemaps} map={map} path={positions} />
{markers}
</span>
);
}
}
TaskPlot.propTypes = {
task: PropTypes.instanceOf(List),
map: PropTypes.object,
googlemaps: PropTypes.object
};
export default TaskPlot;
|
Add labels to task markers.
|
Add labels to task markers.
|
JavaScript
|
mit
|
alistairmgreen/soaring-analyst,alistairmgreen/soaring-analyst
|
e8a00e1baad5e8ae7baa8afd9502f20cd0cd0687
|
src/store/actions.js
|
src/store/actions.js
|
import axios from 'axios';
const API_BASE = 'http://api.zorexsalvo.com/v1';
export default {
getPosts: ({ commit }) => {
axios.get(`${API_BASE}/posts/`).then(
(response) => {
commit('getPosts', response.data);
},
);
},
getPost: ({ commit }, payload) => {
axios.get(`${API_BASE}/posts/${payload}/`).then(
(response) => {
commit('getPost', response.data);
},
);
},
};
|
import axios from 'axios';
const API_BASE = 'https://api.zorexsalvo.com/v1';
export default {
getPosts: ({ commit }) => {
axios.get(`${API_BASE}/posts/`).then(
(response) => {
commit('getPosts', response.data);
},
);
},
getPost: ({ commit }, payload) => {
axios.get(`${API_BASE}/posts/${payload}/`).then(
(response) => {
commit('getPost', response.data);
},
);
},
};
|
Change api url to https
|
Change api url to https
|
JavaScript
|
mit
|
zorexsalvo/zorexsalvo.github.io,zorexsalvo/zorexsalvo.github.io
|
d456e2986d4b99f09fa291c990dff7c8d6a0d9d9
|
src/utils/draw/reset_g.js
|
src/utils/draw/reset_g.js
|
// remove all children of the main `g` element
// prepare for re-drawing (e.g. during resize) with margins
export default ({
g,
margin
}) => {
g.selectAll('*').remove()
g.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')
}
|
// remove all children of the main `g` element
// and all children of the base `element` that are flagged with a css class named `--delete-on-update`
// prepare for re-drawing (e.g. during resize) with margins
export default ({
g,
element,
margin
}) => {
element.selectAll('.--delete-on-update').remove()
g.selectAll('*').remove()
g.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')
}
|
Add flag to remove stuff outside of `g` element on resize & update.
|
Add flag to remove stuff outside of `g` element on resize & update.
|
JavaScript
|
mit
|
simonwoerpel/d3-playbooks,simonwoerpel/d3-playbooks,simonwoerpel/d3-playbooks
|
8d94ee098cbde06564c72cbd44574bd47fd207a5
|
vmdb/app/assets/javascripts/application.js
|
vmdb/app/assets/javascripts/application.js
|
//= require cfme_application
//= require dialog_import_export
//= require widget_import_export
//= require jquery.jqplot
//= require jqplot-plugins/jqplot.pieRenderer
//= require jqplot-plugins/jqplot.barRenderer
//= require jqplot-plugins/jqplot.categoryAxisRenderer
//= require jqplot-plugins/jqplot.highlighter
//= require jqplot-plugins/jqplot.cursor
//= require jqplot-plugins/jqplot.enhancedLegendRenderer
//= require cfme_jqplot
|
//= require cfme_application
//= require dialog_import_export
//= require widget_import_export
//= require excanvas
//= require jquery.jqplot
//= require jqplot-plugins/jqplot.pieRenderer
//= require jqplot-plugins/jqplot.barRenderer
//= require jqplot-plugins/jqplot.categoryAxisRenderer
//= require jqplot-plugins/jqplot.highlighter
//= require jqplot-plugins/jqplot.cursor
//= require jqplot-plugins/jqplot.enhancedLegendRenderer
//= require cfme_jqplot
|
Enable jqplot charts to be visible in IE8
|
Enable jqplot charts to be visible in IE8
https://bugzilla.redhat.com/show_bug.cgi?id=1058261
|
JavaScript
|
apache-2.0
|
juliancheal/manageiq,jvlcek/manageiq,jameswnl/manageiq,djberg96/manageiq,maas-ufcg/manageiq,josejulio/manageiq,fbladilo/manageiq,romanblanco/manageiq,lpichler/manageiq,agrare/manageiq,romanblanco/manageiq,NaNi-Z/manageiq,aufi/manageiq,jntullo/manageiq,tinaafitz/manageiq,tinaafitz/manageiq,mfeifer/manageiq,branic/manageiq,KevinLoiseau/manageiq,maas-ufcg/manageiq,NaNi-Z/manageiq,chessbyte/manageiq,fbladilo/manageiq,djberg96/manageiq,maas-ufcg/manageiq,josejulio/manageiq,mfeifer/manageiq,billfitzgerald0120/manageiq,agrare/manageiq,mresti/manageiq,josejulio/manageiq,tinaafitz/manageiq,ilackarms/manageiq,skateman/manageiq,jrafanie/manageiq,tzumainn/manageiq,ailisp/manageiq,pkomanek/manageiq,hstastna/manageiq,ManageIQ/manageiq,maas-ufcg/manageiq,tzumainn/manageiq,borod108/manageiq,jrafanie/manageiq,durandom/manageiq,yaacov/manageiq,jntullo/manageiq,durandom/manageiq,josejulio/manageiq,syncrou/manageiq,d-m-u/manageiq,tzumainn/manageiq,billfitzgerald0120/manageiq,matobet/manageiq,israel-hdez/manageiq,andyvesel/manageiq,pkomanek/manageiq,mfeifer/manageiq,andyvesel/manageiq,gerikis/manageiq,kbrock/manageiq,matobet/manageiq,juliancheal/manageiq,gerikis/manageiq,NaNi-Z/manageiq,d-m-u/manageiq,mresti/manageiq,aufi/manageiq,NickLaMuro/manageiq,aufi/manageiq,mkanoor/manageiq,andyvesel/manageiq,jameswnl/manageiq,jvlcek/manageiq,mresti/manageiq,durandom/manageiq,billfitzgerald0120/manageiq,mfeifer/manageiq,jntullo/manageiq,skateman/manageiq,matobet/manageiq,mkanoor/manageiq,yaacov/manageiq,gmcculloug/manageiq,gmcculloug/manageiq,fbladilo/manageiq,branic/manageiq,kbrock/manageiq,lpichler/manageiq,jvlcek/manageiq,juliancheal/manageiq,romaintb/manageiq,ailisp/manageiq,syncrou/manageiq,chessbyte/manageiq,agrare/manageiq,gerikis/manageiq,KevinLoiseau/manageiq,mzazrivec/manageiq,NickLaMuro/manageiq,syncrou/manageiq,yaacov/manageiq,aufi/manageiq,lpichler/manageiq,borod108/manageiq,matobet/manageiq,ilackarms/manageiq,ailisp/manageiq,syncrou/manageiq,chessbyte/manageiq,chessbyte/manageiq,maas-ufcg/manageiq,jrafanie/manageiq,fbladilo/manageiq,lpichler/manageiq,kbrock/manageiq,gmcculloug/manageiq,KevinLoiseau/manageiq,yaacov/manageiq,romanblanco/manageiq,israel-hdez/manageiq,KevinLoiseau/manageiq,romaintb/manageiq,mzazrivec/manageiq,djberg96/manageiq,ManageIQ/manageiq,hstastna/manageiq,israel-hdez/manageiq,KevinLoiseau/manageiq,pkomanek/manageiq,kbrock/manageiq,ilackarms/manageiq,NickLaMuro/manageiq,ManageIQ/manageiq,mkanoor/manageiq,gerikis/manageiq,maas-ufcg/manageiq,jrafanie/manageiq,romaintb/manageiq,borod108/manageiq,romanblanco/manageiq,juliancheal/manageiq,tinaafitz/manageiq,ilackarms/manageiq,israel-hdez/manageiq,KevinLoiseau/manageiq,billfitzgerald0120/manageiq,ailisp/manageiq,andyvesel/manageiq,mzazrivec/manageiq,durandom/manageiq,skateman/manageiq,hstastna/manageiq,djberg96/manageiq,skateman/manageiq,jameswnl/manageiq,branic/manageiq,romaintb/manageiq,pkomanek/manageiq,romaintb/manageiq,d-m-u/manageiq,NickLaMuro/manageiq,d-m-u/manageiq,ManageIQ/manageiq,NaNi-Z/manageiq,jvlcek/manageiq,jameswnl/manageiq,gmcculloug/manageiq,agrare/manageiq,borod108/manageiq,tzumainn/manageiq,jntullo/manageiq,branic/manageiq,mresti/manageiq,hstastna/manageiq,mzazrivec/manageiq,mkanoor/manageiq,romaintb/manageiq
|
50ff129e6e3a02a03aa63a26e5c7d782a722db0e
|
src/bacon.react.js
|
src/bacon.react.js
|
import Bacon from "baconjs"
import React from "react"
export default React.createClass({
getInitialState() {
return {}
},
tryDispose() {
const {dispose} = this.state
if (dispose) {
dispose()
this.replaceState({})
}
},
trySubscribe(tDOM) {
this.tryDispose()
if (tDOM)
this.setState(
{dispose: (tDOM instanceof Bacon.Observable ? tDOM :
Bacon.combineTemplate(tDOM instanceof Array
? <div>{tDOM}</div>
: tDOM))
.onValue(DOM => this.setState({DOM}))})
},
componentWillReceiveProps(nextProps) {
this.trySubscribe(nextProps.children)
},
componentWillMount() {
this.trySubscribe(this.props.children)
const {willMount} = this.props
!willMount || willMount(this)
},
componentDidMount() {
const {didMount} = this.props
!didMount || didMount(this)
},
shouldComponentUpdate(nextProps, nextState) {
return nextState.DOM !== this.state.DOM
},
componentWillUnmount() {
this.tryDispose()
const {willUnmount} = this.props
!willUnmount || willUnmount(this)
},
render() {
const {DOM} = this.state
return DOM ? DOM : null
}
})
|
import Bacon from "baconjs"
import React from "react"
export default React.createClass({
getInitialState() {
return {}
},
tryDispose() {
const {dispose} = this.state
if (dispose) {
dispose()
this.replaceState({})
}
},
trySubscribe(props) {
this.tryDispose()
const {children} = props
if (children) {
let stream = children
if (stream instanceof Array) {
const {className, id} = props
stream = <div className={className} id={id}>{stream}</div>
}
if (!(stream instanceof Bacon.Observable))
stream = Bacon.combineTemplate(stream)
this.setState({dispose: stream.onValue(DOM => this.setState({DOM}))})
}
},
componentWillReceiveProps(nextProps) {
this.trySubscribe(nextProps)
},
componentWillMount() {
this.trySubscribe(this.props)
const {willMount} = this.props
!willMount || willMount(this)
},
componentDidMount() {
const {didMount} = this.props
!didMount || didMount(this)
},
shouldComponentUpdate(nextProps, nextState) {
return nextState.DOM !== this.state.DOM
},
componentWillUnmount() {
this.tryDispose()
const {willUnmount} = this.props
!willUnmount || willUnmount(this)
},
render() {
const {DOM} = this.state
if (!DOM)
return null
if (!(DOM instanceof Array))
return DOM
const {className, id} = this.props
return <div className={className} id={id}>{DOM}</div>
}
})
|
Support className & id attrs and stream of arrays.
|
Support className & id attrs and stream of arrays.
|
JavaScript
|
mit
|
polytypic/bacon.react
|
02e191dabf4485f305c09c37592fcdfdf477553b
|
src/base/Button.js
|
src/base/Button.js
|
mi2JS.comp.add('base/Button', 'Base', '',
// component initializer function that defines constructor and adds methods to the prototype
function(proto, superProto, comp, superComp){
proto.construct = function(el, tpl, parent){
superProto.construct.call(this, el, tpl, parent);
this.lastClick = 0;
this.listen(el,"click",function(evt){
evt.stop();
});
this.listen(el,"mousedown",function(evt){
if(evt.which != 1) return; // only left click
evt.stop();
if(this.isEnabled() && this.parent.fireEvent){
var now = new Date().getTime();
if(now -this.lastClick > 300){ // one click per second
this.parent.fireEvent(this.getEvent(), {
action: this.getAction(),
button:this,
domEvent: evt,
src:this,
eventFor: 'parent'
});
this.lastClick = now;
}
}
});
};
proto.getEvent = function(){
return this.attr("event") || "action";
};
proto.getAction = function(){
return this.attr("action") || "action";
};
proto.setValue = function(value){
this.el.value = value;
};
proto.getValue = function(value){
return this.el.value;
};
});
|
mi2JS.comp.add('base/Button', 'Base', '',
// component initializer function that defines constructor and adds methods to the prototype
function(proto, superProto, comp, superComp){
proto.construct = function(el, tpl, parent){
superProto.construct.call(this, el, tpl, parent);
this.lastClick = 0;
this.listen(el,"click",function(evt){
evt.stop();
});
this.listen(el,"mousedown",function(evt){
if(evt.which != 1) return; // only left click
evt.stop();
if(this.isEnabled() && this.parent.fireEvent){
var now = new Date().getTime();
if(now -this.lastClick > 300){ // one click per second
this.parent.fireEvent(this.getEvent(), {
action: this.getAction(),
button:this,
domEvent: evt,
src:this,
eventFor: 'parent'
});
this.lastClick = now;
}
}
});
};
proto.getEvent = function(){
return this.attr("event") || "action";
};
proto.getAction = function(){
return this.attr("action") || this.__propName;
};
proto.setValue = function(value){
this.el.value = value;
};
proto.getValue = function(value){
return this.el.value;
};
});
|
Use __propName as default action for button
|
Use __propName as default action for button
|
JavaScript
|
mit
|
hrgdavor/mi2js,hrgdavor/mi2js,hrgdavor/mi2js
|
4d949a2bc8f628dcc66ee62161ae3680b21766d0
|
bin/pep-proxy.js
|
bin/pep-proxy.js
|
#!/usr/bin/env node
var proxy = require('../lib/fiware-orion-pep'),
config = require('../config');
proxy.start(function (error, proxyObj) {
if (error) {
process.exit();
} else {
var module;
console.log('Loading middlewares');
module = require('../' + config.middlewares.require);
for (var i in config.middlewares.functions) {
proxyObj.middlewares.push(module[config.middlewares.functions[i]]);
}
console.log('Server started');
}
});
|
#!/usr/bin/env node
var proxy = require('../lib/fiware-orion-pep'),
config = require('../config');
proxy.start(function(error, proxyObj) {
var module;
if (error) {
process.exit();
} else {
console.log('Loading middlewares');
module = require('../' + config.middlewares.require);
for (var i in config.middlewares.functions) {
proxyObj.middlewares.push(module[config.middlewares.functions[i]]);
}
console.log('Server started');
}
});
|
FIX Move the module definition to the top of the function
|
FIX Move the module definition to the top of the function
|
JavaScript
|
agpl-3.0
|
telefonicaid/fiware-pep-steelskin,telefonicaid/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,telefonicaid/fiware-pep-steelskin,telefonicaid/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,agroknow/fiware-pep-steelskin
|
a439b552acbd586615b15b86d79ed003979aeaed
|
static/js/sh_init.js
|
static/js/sh_init.js
|
var codes = document.getElementsByTagName("code");
var title, elTitle, elPre;
for (var i=0, l=codes.length ; i<l ; i++) {
elPre = codes[i].parentNode;
if (elPre.tagName != "PRE") continue;
// Prepare for highlighting
// elPre.className = elPre.className.replace("sourceCode ","");
if (elPre.className.match("sourceCode"))
switch (elPre.className.replace("sourceCode ","")) {
case 'css':
case 'haskell':
case 'html':
case 'php':
case 'python':
elPre.className = "sourceCode sh_" + elPre.className.replace("sourceCode ", "");
break;
case 'js':
elPre.className += " sh_javascript";
case 'literate haskell':
elPre.className += " sh_haskell";
break;
}
}
//sh_highlightDocument("/static/js/lang/", ".js");
|
var codes = document.getElementsByTagName("code");
var title, elTitle, elPre;
for (var i=0, l=codes.length ; i<l ; i++) {
elPre = codes[i].parentNode;
if (elPre.tagName != "PRE") continue;
// Prepare for highlighting
// elPre.className = elPre.className.replace("sourceCode ","");
if (elPre.className.match("sourceCode"))
switch (elPre.className.replace("sourceCode ","")) {
case 'css':
case 'haskell':
case 'html':
case 'php':
case 'java':
case 'python':
elPre.className = "sourceCode sh_" + elPre.className.replace("sourceCode ", "");
break;
case 'js':
elPre.className += " sh_javascript";
case 'literate haskell':
elPre.className += " sh_haskell";
break;
}
}
//sh_highlightDocument("/static/js/lang/", ".js");
|
Add java to automatic conversions
|
Add java to automatic conversions
|
JavaScript
|
bsd-3-clause
|
MasseR/Blog,MasseR/Blog
|
c06c26a6987da66dc1722be92625065cacf73603
|
src/json-chayns-call/json-calls.js
|
src/json-chayns-call/json-calls.js
|
import * as jsonCallFunctions from './calls/index';
const jsonCalls = {
1: jsonCallFunctions.toggleWaitCursor,
2: jsonCallFunctions.selectTapp,
4: jsonCallFunctions.showPictures,
14: jsonCallFunctions.requestGeoLocation,
15: jsonCallFunctions.showVideo,
16: jsonCallFunctions.showAlert,
18: jsonCallFunctions.getGlobalData,
30: jsonCallFunctions.dateTimePicker,
50: jsonCallFunctions.selectDialog,
54: jsonCallFunctions.tobitLogin,
56: jsonCallFunctions.tobitLogout,
72: jsonCallFunctions.showFloatingButton,
73: jsonCallFunctions.setObjectForKey,
74: jsonCallFunctions.getObjectForKey,
75: jsonCallFunctions.addChaynsCallErrorListener,
77: jsonCallFunctions.setIframeHeight,
78: jsonCallFunctions.getWindowMetric,
81: jsonCallFunctions.scrollToPosition,
92: jsonCallFunctions.updateChaynsId,
102: jsonCallFunctions.addScrollListener,
103: jsonCallFunctions.inputDialog,
112: jsonCallFunctions.sendEventToTopFrame,
113: jsonCallFunctions.closeDialog,
114: jsonCallFunctions.setWebsiteTitle,
115: jsonCallFunctions.setTobitAccessToken,
127: jsonCallFunctions.getSavedIntercomChats,
128: jsonCallFunctions.setIntercomChatData,
129: jsonCallFunctions.closeWindow,
};
export default jsonCalls;
|
import * as jsonCallFunctions from './calls/index';
const jsonCalls = {
1: jsonCallFunctions.toggleWaitCursor,
2: jsonCallFunctions.selectTapp,
4: jsonCallFunctions.showPictures,
14: jsonCallFunctions.requestGeoLocation,
15: jsonCallFunctions.showVideo,
16: jsonCallFunctions.showAlert,
18: jsonCallFunctions.getGlobalData,
30: jsonCallFunctions.dateTimePicker,
50: jsonCallFunctions.selectDialog,
52: jsonCallFunctions.setTobitAccessToken,
54: jsonCallFunctions.tobitLogin,
56: jsonCallFunctions.tobitLogout,
72: jsonCallFunctions.showFloatingButton,
73: jsonCallFunctions.setObjectForKey,
74: jsonCallFunctions.getObjectForKey,
75: jsonCallFunctions.addChaynsCallErrorListener,
77: jsonCallFunctions.setIframeHeight,
78: jsonCallFunctions.getWindowMetric,
81: jsonCallFunctions.scrollToPosition,
92: jsonCallFunctions.updateChaynsId,
102: jsonCallFunctions.addScrollListener,
103: jsonCallFunctions.inputDialog,
112: jsonCallFunctions.sendEventToTopFrame,
113: jsonCallFunctions.closeDialog,
114: jsonCallFunctions.setWebsiteTitle,
115: jsonCallFunctions.setTobitAccessToken,
127: jsonCallFunctions.getSavedIntercomChats,
128: jsonCallFunctions.setIntercomChatData,
129: jsonCallFunctions.closeWindow,
};
export default jsonCalls;
|
Add support for chayns-call 52
|
Add support for chayns-call 52
|
JavaScript
|
mit
|
TobitSoftware/chayns-web-light,TobitSoftware/chayns-web-light
|
e13f0ea5f5e21d63d367e61f4b247ba2a60cfd48
|
5.AdvancedReactAndRedux/test/test_helper.js
|
5.AdvancedReactAndRedux/test/test_helper.js
|
// Set up testing enviroment to run like a browser in the command line
// Build 'renderComponent' helper that should render a given react class
// Build helper for simulating events
// Set up chai-jquery
|
import jsdom from 'jsdom';
import jquery from 'jquery';
import TestUtils from 'react-addons-test-utils';
// Set up testing enviroment to run like a browser in the command line
global.document = jsdom.jsdom('<!doctype html><html><body></body></html>');
global.window = global.document.defaultView;
const $ = _$(global.window);
// Build 'renderComponent' helper that should render a given react class
function renderComponent(ComponentClass) {
const componentInstance = TestUtils.renderIntoDocument(<ComponentClass />);
return $(ReactDOM.findDOMNode(componentInstance)); // produces HTML
}
// Build helper for simulating events
// Set up chai-jquery
|
Set up running like browser in command line, build renderComponent helper function
|
Set up running like browser in command line, build renderComponent helper function
|
JavaScript
|
mit
|
Branimir123/Learning-React,Branimir123/Learning-React
|
61a7bad245a6b365ff7162421545b9004d79b2d5
|
firecares/firestation/static/firestation/js/controllers/home.js
|
firecares/firestation/static/firestation/js/controllers/home.js
|
'use strict';
(function() {
angular.module('fireStation.homeController', [])
.controller('home', function($scope, map, $filter) {
var homeMap = map.initMap('map', {scrollWheelZoom: false});
homeMap.setView([40, -90], 4);
var headquartersIcon = L.FireCARESMarkers.headquartersmarker();
if (featured_departments != null) {
L.geoJson(featured_departments, {
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {icon: headquartersIcon});
},
onEachFeature: function(feature, layer) {
if (feature.properties && feature.properties.name) {
var popUp = '<b><a href="' + feature.properties.url +'">' + feature.properties.name + '</a></b>';
if (feature.properties.dist_model_score != null) {
popUp += '<br><b>Performance score: </b> ' + feature.properties.dist_model_score + ' seconds';
}
if (feature.properties.predicted_fires != null) {
popUp += '<br><b>Predicted annual residential fires: </b> ' + $filter('number')(feature.properties.predicted_fires, 0);
}
layer.bindPopup(popUp);
}
}
}).addTo(homeMap);
}
});
})();
|
'use strict';
(function() {
angular.module('fireStation.homeController', [])
.controller('home', function($scope, map, $filter) {
var homeMap = map.initMap('map', {scrollWheelZoom: false});
homeMap.setView([40, -90], 4);
var headquartersIcon = L.FireCARESMarkers.headquartersmarker();
if (featured_departments != null) {
L.geoJson(featured_departments, {
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {icon: headquartersIcon});
},
onEachFeature: function(feature, layer) {
if (feature.properties && feature.properties.name) {
var popUp = '<b><a href="' + feature.properties.url +'">' + feature.properties.name + '</a></b>';
if (feature.properties.dist_model_score != null) {
popUp += '<br><b>Performance score: </b> ' + feature.properties.dist_model_score + ' seconds';
}
if (feature.properties.predicted_fires != null) {
popUp += '<br><b>Predicted annual residential fires: </b> ' + $filter('number')(feature.properties.predicted_fires, 0);
}
layer.bindPopup(popUp);
}
}
}).addTo(homeMap);
}
});
})();
|
Update js to bust compressor cache.
|
Update js to bust compressor cache.
|
JavaScript
|
mit
|
meilinger/firecares,HunterConnelly/firecares,garnertb/firecares,FireCARES/firecares,ROGUE-JCTD/vida,garnertb/firecares,HunterConnelly/firecares,ROGUE-JCTD/vida,ROGUE-JCTD/vida,ROGUE-JCTD/vida,HunterConnelly/firecares,FireCARES/firecares,meilinger/firecares,garnertb/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,meilinger/firecares,meilinger/firecares,HunterConnelly/firecares,ROGUE-JCTD/vida,garnertb/firecares
|
6a97907ccc0ceeadcbbef6c66fda080e926c42b2
|
packages/ember-metal/lib/error_handler.js
|
packages/ember-metal/lib/error_handler.js
|
import Logger from 'ember-console';
import { isTesting } from './testing';
let onerror;
// Ember.onerror getter
export function getOnerror() {
return onerror;
}
// Ember.onerror setter
export function setOnerror(handler) {
onerror = handler;
}
let dispatchOverride;
// dispatch error
export function dispatchError(error) {
if (dispatchOverride) {
dispatchOverride(error);
} else {
defaultDispatch(error);
}
}
// allows testing adapter to override dispatch
export function setDispatchOverride(handler) {
dispatchOverride = handler;
}
function defaultDispatch(error) {
if (isTesting()) {
throw error;
}
if (onerror) {
onerror(error);
} else {
Logger.error(error.stack);
}
}
|
import Logger from 'ember-console';
import { isTesting } from './testing';
// To maintain stacktrace consistency across browsers
let getStack = function(error) {
var stack = error.stack;
var message = error.message;
if (stack.indexOf(message) === -1) {
stack = message + '\n' + stack;
}
return stack;
};
let onerror;
// Ember.onerror getter
export function getOnerror() {
return onerror;
}
// Ember.onerror setter
export function setOnerror(handler) {
onerror = handler;
}
let dispatchOverride;
// dispatch error
export function dispatchError(error) {
if (dispatchOverride) {
dispatchOverride(error);
} else {
defaultDispatch(error);
}
}
// allows testing adapter to override dispatch
export function setDispatchOverride(handler) {
dispatchOverride = handler;
}
function defaultDispatch(error) {
if (isTesting()) {
throw error;
}
if (onerror) {
onerror(error);
} else {
Logger.error(getStack(error));
}
}
|
Fix Error object's stacktrace inconsistency across browsers
|
Fix Error object's stacktrace inconsistency across browsers
|
JavaScript
|
mit
|
johanneswuerbach/ember.js,elwayman02/ember.js,kanongil/ember.js,patricksrobertson/ember.js,intercom/ember.js,Patsy-issa/ember.js,sivakumar-kailasam/ember.js,thoov/ember.js,mixonic/ember.js,kennethdavidbuck/ember.js,sivakumar-kailasam/ember.js,bekzod/ember.js,rfsv/ember.js,kaeufl/ember.js,pixelhandler/ember.js,mike-north/ember.js,mike-north/ember.js,pixelhandler/ember.js,kellyselden/ember.js,karthiick/ember.js,pixelhandler/ember.js,sivakumar-kailasam/ember.js,alexdiliberto/ember.js,thoov/ember.js,Gaurav0/ember.js,bekzod/ember.js,bantic/ember.js,csantero/ember.js,chadhietala/ember.js,skeate/ember.js,mike-north/ember.js,GavinJoyce/ember.js,Gaurav0/ember.js,mfeckie/ember.js,twokul/ember.js,vikram7/ember.js,GavinJoyce/ember.js,code0100fun/ember.js,cbou/ember.js,szines/ember.js,HeroicEric/ember.js,trentmwillis/ember.js,kellyselden/ember.js,tsing80/ember.js,nickiaconis/ember.js,kellyselden/ember.js,mixonic/ember.js,duggiefresh/ember.js,lan0/ember.js,lan0/ember.js,HeroicEric/ember.js,Turbo87/ember.js,miguelcobain/ember.js,HeroicEric/ember.js,thoov/ember.js,lan0/ember.js,fpauser/ember.js,Serabe/ember.js,cibernox/ember.js,fpauser/ember.js,chadhietala/ember.js,jasonmit/ember.js,johanneswuerbach/ember.js,miguelcobain/ember.js,Patsy-issa/ember.js,johanneswuerbach/ember.js,kennethdavidbuck/ember.js,kaeufl/ember.js,jasonmit/ember.js,tsing80/ember.js,cbou/ember.js,chadhietala/ember.js,vikram7/ember.js,emberjs/ember.js,Leooo/ember.js,amk221/ember.js,gfvcastro/ember.js,rlugojr/ember.js,NLincoln/ember.js,knownasilya/ember.js,davidpett/ember.js,patricksrobertson/ember.js,workmanw/ember.js,xiujunma/ember.js,GavinJoyce/ember.js,knownasilya/ember.js,runspired/ember.js,kanongil/ember.js,trentmwillis/ember.js,HeroicEric/ember.js,karthiick/ember.js,johanneswuerbach/ember.js,chadhietala/ember.js,rlugojr/ember.js,elwayman02/ember.js,davidpett/ember.js,alexdiliberto/ember.js,nickiaconis/ember.js,mfeckie/ember.js,karthiick/ember.js,sly7-7/ember.js,vikram7/ember.js,qaiken/ember.js,givanse/ember.js,xiujunma/ember.js,gfvcastro/ember.js,kennethdavidbuck/ember.js,runspired/ember.js,karthiick/ember.js,Turbo87/ember.js,alexdiliberto/ember.js,qaiken/ember.js,sandstrom/ember.js,jherdman/ember.js,davidpett/ember.js,kanongil/ember.js,Gaurav0/ember.js,mixonic/ember.js,tsing80/ember.js,jaswilli/ember.js,jherdman/ember.js,duggiefresh/ember.js,tildeio/ember.js,stefanpenner/ember.js,csantero/ember.js,asakusuma/ember.js,sly7-7/ember.js,code0100fun/ember.js,bantic/ember.js,workmanw/ember.js,patricksrobertson/ember.js,szines/ember.js,Serabe/ember.js,cibernox/ember.js,jaswilli/ember.js,cbou/ember.js,Patsy-issa/ember.js,gfvcastro/ember.js,workmanw/ember.js,bantic/ember.js,fpauser/ember.js,runspired/ember.js,givanse/ember.js,davidpett/ember.js,GavinJoyce/ember.js,jasonmit/ember.js,runspired/ember.js,rfsv/ember.js,patricksrobertson/ember.js,nickiaconis/ember.js,Serabe/ember.js,gfvcastro/ember.js,cibernox/ember.js,jasonmit/ember.js,jasonmit/ember.js,amk221/ember.js,twokul/ember.js,Leooo/ember.js,alexdiliberto/ember.js,jherdman/ember.js,skeate/ember.js,rfsv/ember.js,xiujunma/ember.js,qaiken/ember.js,emberjs/ember.js,stefanpenner/ember.js,emberjs/ember.js,kellyselden/ember.js,tildeio/ember.js,twokul/ember.js,mfeckie/ember.js,elwayman02/ember.js,thoov/ember.js,mfeckie/ember.js,bantic/ember.js,intercom/ember.js,givanse/ember.js,knownasilya/ember.js,sivakumar-kailasam/ember.js,mike-north/ember.js,pixelhandler/ember.js,asakusuma/ember.js,csantero/ember.js,kennethdavidbuck/ember.js,intercom/ember.js,duggiefresh/ember.js,Leooo/ember.js,bekzod/ember.js,lan0/ember.js,kanongil/ember.js,code0100fun/ember.js,sivakumar-kailasam/ember.js,sly7-7/ember.js,asakusuma/ember.js,bekzod/ember.js,Serabe/ember.js,NLincoln/ember.js,asakusuma/ember.js,xiujunma/ember.js,amk221/ember.js,jherdman/ember.js,nickiaconis/ember.js,vikram7/ember.js,tsing80/ember.js,rlugojr/ember.js,skeate/ember.js,stefanpenner/ember.js,Gaurav0/ember.js,cbou/ember.js,sandstrom/ember.js,amk221/ember.js,Turbo87/ember.js,jaswilli/ember.js,trentmwillis/ember.js,kaeufl/ember.js,NLincoln/ember.js,twokul/ember.js,kaeufl/ember.js,code0100fun/ember.js,Turbo87/ember.js,Patsy-issa/ember.js,intercom/ember.js,givanse/ember.js,Leooo/ember.js,szines/ember.js,skeate/ember.js,szines/ember.js,sandstrom/ember.js,miguelcobain/ember.js,jaswilli/ember.js,trentmwillis/ember.js,qaiken/ember.js,rfsv/ember.js,elwayman02/ember.js,csantero/ember.js,cibernox/ember.js,duggiefresh/ember.js,fpauser/ember.js,workmanw/ember.js,miguelcobain/ember.js,rlugojr/ember.js,NLincoln/ember.js,tildeio/ember.js
|
a0045dd29b77217ed86dbf2f1d26925d5416b0ad
|
example_test.js
|
example_test.js
|
var util = require('util'),
webdriver = require('selenium-webdriver'),
chrome = require('selenium-webdriver/chrome'),
retry = require('./index.js');
var driver = chrome.createDriver(
new webdriver.Capabilities({'browserName': 'chrome'}),
new chrome.ServiceBuilder('./chromedriver').build());
driver.get('localhost:8888');
retry.run(function() {
// Note that everything in here will be retried - including the
// first click.
driver.findElement(webdriver.By.id('showmessage')).click();
// This would throw an error without waiting because the message
// is hidden for 3 seconds.
driver.findElement(webdriver.By.id('message')).click();
}, 5000).then(function() {
// run returns a promise which resolves when all the retrying is done
// If the retry fails (either it times out or the error is not in the ignore
// list) the promise will be rejected.
});
// 7 is the error code for element not found.
retry.ignoring(7).run(function() {
driver.findElement(webdriver.By.id('creatediv')).click();
// This would throw an error because the div does not appear for
// 3 seconds.
driver.findElement(webdriver.By.id('inserted')).getText();
}, 5000);
driver.quit();
|
var util = require('util'),
webdriver = require('selenium-webdriver'),
chrome = require('selenium-webdriver/chrome'),
retry = require('./index.js');
// Assumes that there is a chromedriver binary in the same directory.
var driver = chrome.createDriver(
new webdriver.Capabilities({'browserName': 'chrome'}),
new chrome.ServiceBuilder('./chromedriver').build());
driver.get('http://juliemr.github.io/webdriverjs-retry/');
retry.run(function() {
// Note that everything in here will be retried - including the
// first click.
driver.findElement(webdriver.By.id('showmessage')).click();
// This would throw an error without waiting because the message
// is hidden for 3 seconds.
driver.findElement(webdriver.By.id('message')).click();
}, 5000).then(function() {
// run returns a promise which resolves when all the retrying is done
// If the retry fails (either it times out or the error is not in the ignore
// list) the promise will be rejected.
});
// 7 is the error code for element not found.
retry.ignoring(7).run(function() {
driver.findElement(webdriver.By.id('creatediv')).click();
// This would throw an error because the div does not appear for
// 3 seconds.
driver.findElement(webdriver.By.id('inserted')).getText();
}, 5000);
driver.quit();
|
Make the example test run without requiring local server
|
Make the example test run without requiring local server
|
JavaScript
|
mit
|
bbc/webdriverjs-retry,bbc/webdriverjs-retry,juliemr/webdriverjs-retry
|
0f3a4183d62b62f288cc9614fe52bc03ba33d01b
|
test/directory.js
|
test/directory.js
|
/* global beforeEach, describe, it */
var watch = require('..');
var join = require('path').join;
var fs = require('fs');
var rimraf = require('rimraf');
require('should');
function fixtures(glob) {
return join(__dirname, 'fixtures', glob);
}
describe.skip('directories', function () {
beforeEach(function () {
rimraf.sync(fixtures('test'));
});
it('should directory on creation', function (done) {
var w = watch(fixtures('**'));
w.on('ready', function () {
fs.mkdirSync(fixtures('test'));
});
w.on('data', function () {
w.on('end', done);
w.close();
});
});
});
|
/* global beforeEach, describe, it */
var watch = require('..');
var join = require('path').join;
var fs = require('fs');
var rimraf = require('rimraf');
require('should');
function fixtures(glob) {
return join(__dirname, 'fixtures', glob);
}
describe.skip('directories', function () {
beforeEach(function () {
rimraf.sync(fixtures('test'));
});
// This test is not responding on directories creation
it('should directory on creation', function (done) {
var w = watch(fixtures('**'));
w.on('ready', function () {
fs.mkdirSync(fixtures('test'));
});
w.on('data', function () {
w.on('end', done);
w.close();
});
});
});
|
Add comment in directories test
|
Add comment in directories test
|
JavaScript
|
mit
|
devm33/gulp-watch,UltCombo/gulp-watch,operatino/gulp-watch,moander/gulp-watch,floatdrop/gulp-watch
|
cd70ccc9aeb8cb3e26315cd627863ff67e5759f5
|
rules/inject-local-id.js
|
rules/inject-local-id.js
|
/**
* Adds the ID of the user object stored on our database
* to the token returned from Auth0
*/
function (user, context, callback) {
var namespace = 'https://techbikers.com/';
context.idToken[namespace + 'user_id'] = user.app_metadata.id;
callback(null, user, context);
}
|
/**
* Adds the ID of the user object stored on our database
* to the token returned from Auth0
*/
function (user, context, callback) {
var namespace = 'https://techbikers.com/';
// If the user has app_metadata then inject the ID into the token
if (user.app_metadata) {
context.idToken[namespace + 'user_id'] = user.app_metadata.id;
}
callback(null, user, context);
}
|
Check to make sure app_metadata exists
|
Check to make sure app_metadata exists
There shouldn’t be cases where app_metadata doesn’t exist but if it doesn’t then it will cause an error that prevents the user from being logged in.
Signed-off-by: Michael Willmott <[email protected]>
|
JavaScript
|
mit
|
Techbikers/authentication
|
e4b0d2b5ef01904c7206e855f730a5f3b31a0988
|
examples/01-add-user.js
|
examples/01-add-user.js
|
// use level-dyno and open a new datastore
var dyno = require('../level-dyno.js');
var flake = require('flake')('eth0');
// open a new database
var db = dyno('/tmp/users');
// do the above sequence
db.putItem('chilts', { nick : 'chilts', email : '[email protected]' }, flake(), function(err) {
console.log('putItem(): done');
});
db.incAttrBy('chilts', 'logins', 1, flake(), function(err) {
console.log('incAttrBy(): done');
});
db.delAttrs('chilts', [ 'email' ], flake(), function(err) {
console.log('delAttrs(): done');
});
db.putAttrs('chilts', { name : 'Andy Chilton' }, flake(), function(err) {
console.log('putAttrs(): done');
});
db.putAttrs('chilts', { email : '[email protected]' }, flake(), function(err) {
console.log('putAttrs(): done');
});
|
// use level-dyno and open a new datastore
var dyno = require('../level-dyno.js');
var flake = require('flake')('eth0');
// open a new database
var db = dyno('/tmp/users');
var user = 'chilts';
// do the above sequence
db.putItem(user, { nick : 'chilts', email : '[email protected]' }, flake(), function(err) {
console.log('putItem(): done');
});
db.incAttrBy(user, 'logins', 1, flake(), function(err) {
console.log('incAttrBy(): done');
});
db.delAttrs(user, [ 'email' ], flake(), function(err) {
console.log('delAttrs(): done');
});
db.putAttrs(user, { name : 'Andy Chilton' }, flake(), function(err) {
console.log('putAttrs(): done');
});
db.putAttrs(user, { email : '[email protected]' }, flake(), function(err) {
console.log('putAttrs(): done');
});
|
Make the example a bit nicer
|
Make the example a bit nicer
|
JavaScript
|
mit
|
chilts/modb-dyno-leveldb
|
6bbea72f596cfa83b8cf50d3f546fff1bb3ff900
|
src/nls/de/urls.js
|
src/nls/de/urls.js
|
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define */
define({
// Relative to the samples folder
"GETTING_STARTED" : "de/Erste Schritte"
});
|
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define */
define({
// Relative to the samples folder
"GETTING_STARTED" : "de/Erste Schritte",
"ADOBE_THIRD_PARTY" : "http://www.adobe.com/go/thirdparty_de/",
"WEB_PLATFORM_DOCS_LICENSE" : "http://creativecommons.org/licenses/by/3.0/deed.de"
});
|
Add third-party and CC-BY license URLs for 'de' locale
|
Add third-party and CC-BY license URLs for 'de' locale
|
JavaScript
|
mit
|
Cartman0/brackets,ralic/brackets,MantisWare/brackets,y12uc231/brackets,Mosoc/brackets,iamchathu/brackets,nucliweb/brackets,flukeout/brackets,sophiacaspar/brackets,fronzec/brackets,pkdevbox/brackets,riselabs-ufba/RiPLE-HC-ExperimentalData,zaggino/brackets-electron,mjurczyk/brackets,82488059/brackets,2youyouo2/cocoslite,jiimaho/brackets,ls2uper/brackets,mozilla/brackets,arduino-org/ArduinoStudio,pomadgw/brackets,RobertJGabriel/brackets,Live4Code/brackets,ryanackley/tailor,resir014/brackets,sedge/nimble,pomadgw/brackets,brianjking/brackets,RamirezWillow/brackets,Pomax/brackets,shal1y/brackets,shiyamkumar/brackets,petetnt/brackets,L0g1k/brackets,jmarkina/brackets,No9/brackets,Fcmam5/brackets,resir014/brackets,arduino-org/ArduinoStudio,L0g1k/brackets,Fcmam5/brackets,jiawenbo/brackets,L0g1k/brackets,ralic/brackets,fcjailybo/brackets,sgupta7857/brackets,m66n/brackets,phillipalexander/brackets,fvntr/brackets,sgupta7857/brackets,raygervais/brackets,zhukaixy/brackets,raygervais/brackets,wesleifreitas/brackets,quasto/ArduinoStudio,FTG-003/brackets,netlams/brackets,ecwebservices/brackets,GHackAnonymous/brackets,fvntr/brackets,fastrde/brackets,busykai/brackets,MahadevanSrinivasan/brackets,chrisle/brackets,gupta-tarun/brackets,MarcelGerber/brackets,agreco/brackets,ScalaInc/brackets,TylerL-uxai/brackets,shiyamkumar/brackets,jiimaho/brackets,SebastianBoyd/sebastianboyd.github.io-OLD,tan9/brackets,kilroy23/brackets,MantisWare/brackets,FTG-003/brackets,rafaelstz/brackets,brianjking/brackets,jiawenbo/brackets,Pomax/brackets,keir-rex/brackets,emanziano/brackets,ScalaInc/brackets,revi/brackets,show0017/brackets,ScalaInc/brackets,kolipka/brackets,hanmichael/brackets,jacobnash/brackets,Cartman0/brackets,iamchathu/brackets,sprintr/brackets,2youyouo2/cocoslite,andrewnc/brackets,richmondgozarin/brackets,weebygames/brackets,brianjking/brackets,fastrde/brackets,nucliweb/brackets,ForkedRepos/brackets,Lojsan123/brackets,gcommetti/brackets,fronzec/brackets,goldcase/brackets,jiimaho/brackets,baig/brackets,Rynaro/brackets,82488059/brackets,lunode/brackets,netlams/brackets,IAmAnubhavSaini/brackets,Lojsan123/brackets,simon66/brackets,treejames/brackets,Th30/brackets,mozilla/brackets,marcominetti/brackets,JordanTheriault/brackets,baig/brackets,srinivashappy/brackets,RamirezWillow/brackets,raygervais/brackets,Fcmam5/brackets,jacobnash/brackets,mjurczyk/brackets,thehogfather/brackets,NGHGithub/brackets,zaggino/brackets-electron,alexkid64/brackets,lovewitty/brackets,jiimaho/brackets,fabricadeaplicativos/brackets,m66n/brackets,macdg/brackets,gideonthomas/brackets,2youyouo2/cocoslite,Live4Code/brackets,NKcentinel/brackets,No9/brackets,rafaelstz/brackets,ashleygwilliams/brackets,mozilla/brackets,Mosoc/brackets,busykai/brackets,Andrey-Pavlov/brackets,xantage/brackets,RamirezWillow/brackets,fastrde/brackets,ryanackley/tailor,humphd/brackets,StephanieMak/brackets,malinkie/brackets,gideonthomas/brackets,andrewnc/brackets,phillipalexander/brackets,Wikunia/brackets,No9/brackets,netlams/brackets,siddharta1337/brackets,srhbinion/brackets,RobertJGabriel/brackets,raygervais/brackets,cosmosgenius/brackets,zhukaixy/brackets,shiyamkumar/brackets,amrelnaggar/brackets,ashleygwilliams/brackets,bidle/brackets,zLeonjo/brackets,lunode/brackets,IAmAnubhavSaini/brackets,IAmAnubhavSaini/brackets,alicoding/nimble,NickersF/brackets,richmondgozarin/brackets,Denisov21/brackets,FTG-003/brackets,ryanackley/tailor,sprintr/brackets,ralic/brackets,falcon1812/brackets,macdg/brackets,Th30/brackets,busykai/brackets,chrismoulton/brackets,alicoding/nimble,rafaelstz/brackets,abhisekp/brackets,albertinad/brackets,ChaofengZhou/brackets,albertinad/brackets,tan9/brackets,stowball/brackets,2youyouo2/cocoslite,michaeljayt/brackets,pratts/brackets,Denisov21/brackets,revi/brackets,xantage/brackets,uwsd/brackets,chambej/brackets,zLeonjo/brackets,gwynndesign/brackets,ficristo/brackets,2youyouo2/cocoslite,fabricadeaplicativos/brackets,robertkarlsson/brackets,fvntr/brackets,ggusman/present,ls2uper/brackets,richmondgozarin/brackets,chrisle/brackets,massimiliano76/brackets,ralic/brackets,phillipalexander/brackets,JordanTheriault/brackets,RobertJGabriel/brackets,fashionsun/brackets,albertinad/brackets,albertinad/brackets,NKcentinel/brackets,cosmosgenius/brackets,xantage/brackets,rlugojr/brackets,IAmAnubhavSaini/brackets,thehogfather/brackets,ecwebservices/brackets,flukeout/brackets,uwsd/brackets,mcanthony/brackets,adobe/brackets,kolipka/brackets,chrisle/brackets,falcon1812/brackets,chinnyannieb/brackets,chrismoulton/brackets,NGHGithub/brackets,fcjailybo/brackets,agreco/brackets,macdg/brackets,stowball/brackets,SebastianBoyd/sebastianboyd.github.io-OLD,rlugojr/brackets,arduino-org/ArduinoStudio,m66n/brackets,wakermahmud/brackets,IAmAnubhavSaini/brackets,fcjailybo/brackets,humphd/brackets,nucliweb/brackets,chinnyannieb/brackets,udhayam/brackets,nucliweb/brackets,alicoding/nimble,simon66/brackets,Pomax/brackets,SebastianBoyd/sebastianboyd.github.io-OLD,MahadevanSrinivasan/brackets,riselabs-ufba/RiPLE-HC-ExperimentalData,phillipalexander/brackets,busykai/brackets,srinivashappy/brackets,jmarkina/brackets,gcommetti/brackets,iamchathu/brackets,abhisekp/brackets,wakermahmud/brackets,Rajat-dhyani/brackets,show0017/brackets,ls2uper/brackets,SidBala/brackets,thr0w/brackets,revi/brackets,pkdevbox/brackets,RobertJGabriel/brackets,MahadevanSrinivasan/brackets,Jonavin/brackets,fvntr/brackets,bidle/brackets,malinkie/brackets,chambej/brackets,pratts/brackets,macdg/brackets,82488059/brackets,pomadgw/brackets,Jonavin/brackets,fashionsun/brackets,sedge/nimble,adobe/brackets,gcommetti/brackets,y12uc231/brackets,adrianhartanto0/brackets,pratts/brackets,TylerL-uxai/brackets,SebastianBoyd/sebastianboyd.github.io-OLD,ecwebservices/brackets,sophiacaspar/brackets,stowball/brackets,rlugojr/brackets,riselabs-ufba/RiPLE-HC-ExperimentalData,kolipka/brackets,emanziano/brackets,jiawenbo/brackets,ScalaInc/brackets,Real-Currents/brackets,MarcelGerber/brackets,y12uc231/brackets,iamchathu/brackets,Denisov21/brackets,revi/brackets,RobertJGabriel/brackets,gupta-tarun/brackets,Th30/brackets,dtcom/MyPSDBracket,dangkhue27/brackets,wakermahmud/brackets,brianjking/brackets,karevn/brackets,NickersF/brackets,chrisle/brackets,NGHGithub/brackets,pratts/brackets,resir014/brackets,ficristo/brackets,JordanTheriault/brackets,Rajat-dhyani/brackets,keir-rex/brackets,thehogfather/brackets,Denisov21/brackets,alexkid64/brackets,TylerL-uxai/brackets,ChaofengZhou/brackets,richmondgozarin/brackets,ggusman/present,ls2uper/brackets,srhbinion/brackets,treejames/brackets,petetnt/brackets,brianjking/brackets,dangkhue27/brackets,massimiliano76/brackets,Rynaro/brackets,fabricadeaplicativos/brackets,rlugojr/brackets,zhukaixy/brackets,weebygames/brackets,mcanthony/brackets,ropik/brackets,JordanTheriault/brackets,hanmichael/brackets,sgupta7857/brackets,m66n/brackets,82488059/brackets,shal1y/brackets,zLeonjo/brackets,FTG-003/brackets,m66n/brackets,lovewitty/brackets,Jonavin/brackets,ficristo/brackets,jacobnash/brackets,treejames/brackets,zLeonjo/brackets,sophiacaspar/brackets,humphd/brackets,mjurczyk/brackets,wesleifreitas/brackets,pkdevbox/brackets,fashionsun/brackets,kolipka/brackets,ecwebservices/brackets,Andrey-Pavlov/brackets,kilroy23/brackets,youprofit/brackets,veveykocute/brackets,Th30/brackets,JordanTheriault/brackets,veveykocute/brackets,baig/brackets,phillipalexander/brackets,fashionsun/brackets,fronzec/brackets,ChaofengZhou/brackets,shal1y/brackets,mozilla/brackets,NGHGithub/brackets,GHackAnonymous/brackets,Rajat-dhyani/brackets,abhisekp/brackets,fabricadeaplicativos/brackets,Rynaro/brackets,fvntr/brackets,sgupta7857/brackets,GHackAnonymous/brackets,dangkhue27/brackets,Live4Code/brackets,MarcelGerber/brackets,FTG-003/brackets,adrianhartanto0/brackets,Mosoc/brackets,hanmichael/brackets,udhayam/brackets,CapeSepias/brackets,adrianhartanto0/brackets,Free-Technology-Guild/brackets,revi/brackets,andrewnc/brackets,quasto/ArduinoStudio,pratts/brackets,netlams/brackets,andrewnc/brackets,Free-Technology-Guild/brackets,petetnt/brackets,alexkid64/brackets,michaeljayt/brackets,chambej/brackets,falcon1812/brackets,karevn/brackets,malinkie/brackets,youprofit/brackets,Real-Currents/brackets,weebygames/brackets,jiimaho/brackets,lunode/brackets,Pomax/brackets,MarcelGerber/brackets,cdot-brackets-extensions/nimble-htmlLint,sgupta7857/brackets,hanmichael/brackets,chinnyannieb/brackets,wesleifreitas/brackets,ryanackley/tailor,y12uc231/brackets,NickersF/brackets,youprofit/brackets,wangjun/brackets,ChaofengZhou/brackets,NKcentinel/brackets,Rajat-dhyani/brackets,chrismoulton/brackets,Denisov21/brackets,gideonthomas/brackets,fcjailybo/brackets,simon66/brackets,fronzec/brackets,petetnt/brackets,macdg/brackets,NickersF/brackets,massimiliano76/brackets,mat-mcloughlin/brackets,adrianhartanto0/brackets,Free-Technology-Guild/brackets,MarcelGerber/brackets,mcanthony/brackets,eric-stanley/brackets,malinkie/brackets,flukeout/brackets,uwsd/brackets,lovewitty/brackets,zaggino/brackets-electron,lovewitty/brackets,malinkie/brackets,sprintr/brackets,thr0w/brackets,wesleifreitas/brackets,lunode/brackets,bidle/brackets,amrelnaggar/brackets,thr0w/brackets,falcon1812/brackets,simon66/brackets,treejames/brackets,michaeljayt/brackets,srhbinion/brackets,rafaelstz/brackets,cdot-brackets-extensions/nimble-htmlLint,ashleygwilliams/brackets,chrisle/brackets,nucliweb/brackets,siddharta1337/brackets,pomadgw/brackets,pkdevbox/brackets,chambej/brackets,Fcmam5/brackets,lunode/brackets,andrewnc/brackets,goldcase/brackets,StephanieMak/brackets,sedge/nimble,uwsd/brackets,agreco/brackets,xantage/brackets,Real-Currents/brackets,gupta-tarun/brackets,alexkid64/brackets,chrismoulton/brackets,zLeonjo/brackets,dangkhue27/brackets,TylerL-uxai/brackets,busykai/brackets,sprintr/brackets,humphd/brackets,kolipka/brackets,emanziano/brackets,gwynndesign/brackets,ropik/brackets,weebygames/brackets,ashleygwilliams/brackets,adobe/brackets,alicoding/nimble,fabricadeaplicativos/brackets,y12uc231/brackets,sedge/nimble,Jonavin/brackets,stowball/brackets,thr0w/brackets,gupta-tarun/brackets,youprofit/brackets,Free-Technology-Guild/brackets,veveykocute/brackets,mat-mcloughlin/brackets,dtcom/MyPSDBracket,Lojsan123/brackets,karevn/brackets,shiyamkumar/brackets,dangkhue27/brackets,riselabs-ufba/RiPLE-HC-ExperimentalData,Cartman0/brackets,zaggino/brackets-electron,Th30/brackets,robertkarlsson/brackets,CapeSepias/brackets,weebygames/brackets,wangjun/brackets,udhayam/brackets,falcon1812/brackets,abhisekp/brackets,riselabs-ufba/RiPLE-HC-ExperimentalData,kilroy23/brackets,amrelnaggar/brackets,ecwebservices/brackets,82488059/brackets,kilroy23/brackets,arduino-org/ArduinoStudio,SebastianBoyd/sebastianboyd.github.io-OLD,bidle/brackets,srinivashappy/brackets,goldcase/brackets,gcommetti/brackets,wangjun/brackets,zhukaixy/brackets,uwsd/brackets,agreco/brackets,ls2uper/brackets,ForkedRepos/brackets,zhukaixy/brackets,xantage/brackets,amrelnaggar/brackets,MantisWare/brackets,fastrde/brackets,ropik/brackets,ficristo/brackets,siddharta1337/brackets,humphd/brackets,chambej/brackets,siddharta1337/brackets,udhayam/brackets,keir-rex/brackets,karevn/brackets,amrelnaggar/brackets,Cartman0/brackets,eric-stanley/brackets,baig/brackets,karevn/brackets,robertkarlsson/brackets,mcanthony/brackets,ralic/brackets,NKcentinel/brackets,veveykocute/brackets,rlugojr/brackets,shal1y/brackets,Andrey-Pavlov/brackets,GHackAnonymous/brackets,Rajat-dhyani/brackets,gwynndesign/brackets,srhbinion/brackets,StephanieMak/brackets,jacobnash/brackets,udhayam/brackets,jmarkina/brackets,ggusman/present,CapeSepias/brackets,fcjailybo/brackets,gupta-tarun/brackets,Wikunia/brackets,gcommetti/brackets,MantisWare/brackets,show0017/brackets,Rynaro/brackets,wangjun/brackets,eric-stanley/brackets,Lojsan123/brackets,SidBala/brackets,sedge/nimble,ForkedRepos/brackets,ficristo/brackets,emanziano/brackets,gideonthomas/brackets,ashleygwilliams/brackets,RamirezWillow/brackets,NKcentinel/brackets,flukeout/brackets,shiyamkumar/brackets,Cartman0/brackets,ChaofengZhou/brackets,quasto/ArduinoStudio,emanziano/brackets,chinnyannieb/brackets,hanmichael/brackets,Real-Currents/brackets,ricciozhang/brackets,pkdevbox/brackets,Real-Currents/brackets,jiawenbo/brackets,mat-mcloughlin/brackets,veveykocute/brackets,netlams/brackets,Jonavin/brackets,MantisWare/brackets,abhisekp/brackets,stowball/brackets,marcominetti/brackets,Wikunia/brackets,Andrey-Pavlov/brackets,bidle/brackets,albertinad/brackets,iamchathu/brackets,srinivashappy/brackets,richmondgozarin/brackets,fronzec/brackets,NGHGithub/brackets,lovewitty/brackets,L0g1k/brackets,NickersF/brackets,cdot-brackets-extensions/nimble-htmlLint,sophiacaspar/brackets,Live4Code/brackets,TylerL-uxai/brackets,Rynaro/brackets,sophiacaspar/brackets,arduino-org/ArduinoStudio,ricciozhang/brackets,No9/brackets,wakermahmud/brackets,chrismoulton/brackets,resir014/brackets,srhbinion/brackets,jacobnash/brackets,zaggino/brackets-electron,cosmosgenius/brackets,sprintr/brackets,mat-mcloughlin/brackets,goldcase/brackets,robertkarlsson/brackets,treejames/brackets,RamirezWillow/brackets,thehogfather/brackets,jmarkina/brackets,StephanieMak/brackets,ricciozhang/brackets,Mosoc/brackets,mozilla/brackets,MahadevanSrinivasan/brackets,ggusman/present,ricciozhang/brackets,michaeljayt/brackets,CapeSepias/brackets,gwynndesign/brackets,goldcase/brackets,kilroy23/brackets,youprofit/brackets,Andrey-Pavlov/brackets,gideonthomas/brackets,jiawenbo/brackets,ricciozhang/brackets,Real-Currents/brackets,SidBala/brackets,ScalaInc/brackets,fashionsun/brackets,StephanieMak/brackets,mcanthony/brackets,CapeSepias/brackets,tan9/brackets,dtcom/MyPSDBracket,Fcmam5/brackets,flukeout/brackets,tan9/brackets,No9/brackets,pomadgw/brackets,mjurczyk/brackets,tan9/brackets,SidBala/brackets,thr0w/brackets,keir-rex/brackets,jmarkina/brackets,michaeljayt/brackets,ForkedRepos/brackets,chinnyannieb/brackets,simon66/brackets,quasto/ArduinoStudio,Lojsan123/brackets,massimiliano76/brackets,resir014/brackets,adobe/brackets,Live4Code/brackets,Wikunia/brackets,alexkid64/brackets,eric-stanley/brackets,petetnt/brackets,wesleifreitas/brackets,eric-stanley/brackets,mjurczyk/brackets,robertkarlsson/brackets,srinivashappy/brackets,MahadevanSrinivasan/brackets,Mosoc/brackets,show0017/brackets,wangjun/brackets,dtcom/MyPSDBracket,Wikunia/brackets,ropik/brackets,zaggino/brackets-electron,GHackAnonymous/brackets,ForkedRepos/brackets,SidBala/brackets,cosmosgenius/brackets,baig/brackets,thehogfather/brackets,fastrde/brackets,cdot-brackets-extensions/nimble-htmlLint,Free-Technology-Guild/brackets,wakermahmud/brackets,shal1y/brackets,quasto/ArduinoStudio,massimiliano76/brackets,adobe/brackets,siddharta1337/brackets,rafaelstz/brackets,adrianhartanto0/brackets,keir-rex/brackets,Pomax/brackets,riselabs-ufba/RiPLE-HC-ExperimentalData,raygervais/brackets
|
7e84c0227dd793591188454e9cc1e3b63d6b8b9f
|
examples/example.tls.js
|
examples/example.tls.js
|
'use strict';
var spdyPush = require('..')
, spdy = require('spdy')
, express = require('express')
, path = require('path')
, fs = require('fs');
var app = express();
app.use(spdyPush.referrer());
app.use(express.static(path.join(__dirname, '../test/site')));
var options = {
key: fs.readFileSync(path.join(__dirname, '../test/keys/spdy-key.pem')),
cert: fs.readFileSync(path.join(__dirname, '../test/keys/spdy-cert.pem'))
};
options = {
key: fs.readFileSync(process.env.HOME + '/.ssh/localhost.key'),
cert: fs.readFileSync(process.env.HOME + '/.ssh/localhost.crt'),
ca: fs.readFileSync(process.env.HOME + '/.ca/cacert.pem')
};
var port = 8443;
spdy.createServer(options, app).listen(port);
|
'use strict';
var spdyPush = require('..')
, spdy = require('spdy')
, express = require('express')
, path = require('path')
, fs = require('fs');
var app = express();
app.use(spdyPush.referrer());
app.use(express.static(path.join(__dirname, '../test/site')));
var options = {
key: fs.readFileSync(path.join(__dirname, '../test/keys/spdy-key.pem')),
cert: fs.readFileSync(path.join(__dirname, '../test/keys/spdy-cert.pem'))
};
var port = 8443;
spdy.createServer(options, app).listen(port);
|
Fix location of SSL key and certificate
|
Fix location of SSL key and certificate
|
JavaScript
|
mit
|
halvards/spdy-referrer-push
|
54315706195e9280beccdaa7e7cffadef1cecdee
|
website/static/js/filerenderer.js
|
website/static/js/filerenderer.js
|
/*
* Refresh rendered file through mfr
*/
'use strict';
var $ = require('jquery');
var $osf = require('js/osfHelpers');
var FileRenderer = {
start: function(url, selector){
this.url = url;
this.tries = 0;
this.ALLOWED_RETRIES = 10;
this.element = $(selector);
this.getCachedFromServer();
},
getCachedFromServer: function() {
var self = this;
$.ajax({
method: 'GET',
url: self.url,
beforeSend: $osf.setXHRAuthorization
}).done(function(data) {
if (data) {
self.element.html(data.rendered);
} else {
self.handleRetry();
}
}).fail(self.handleRetry);
},
handleRetry: $osf.throttle(function() {
var self = FileRenderer;
self.tries += 1;
if(self.tries > self.ALLOWED_RETRIES){
self.element.html('Timeout occurred while loading, please refresh the page');
} else {
self.getCachedFromServer();
}
}, 1000)
};
module.exports = FileRenderer;
|
/*
* Refresh rendered file through mfr
*/
var $ = require('jquery');
var $osf = require('js/osfHelpers');
function FileRenderer(url, selector) {
var self = this;
self.url = url;
self.tries = 0;
self.selector = selector;
self.ALLOWED_RETRIES = 10;
self.element = $(selector);
self.start = function() {
self.getCachedFromServer();
};
self.reload = function() {
self.tries = 0;
self.start();
};
self.getCachedFromServer = function() {
$.ajax({
method: 'GET',
url: self.url,
beforeSend: $osf.setXHRAuthorization
}).done(function(data) {
if (data) {
self.element.html(data);
} else {
self.handleRetry();
}
}).fail(self.handleRetry);
};
self.handleRetry = $osf.throttle(function() {
self.tries += 1;
if(self.tries > self.ALLOWED_RETRIES){
self.element.html('Timeout occurred while loading, please refresh the page');
} else {
self.getCachedFromServer();
}
}, 1000);
}
module.exports = FileRenderer;
|
Refactor to OOP ish design
|
Refactor to OOP ish design
|
JavaScript
|
apache-2.0
|
wearpants/osf.io,monikagrabowska/osf.io,KAsante95/osf.io,cosenal/osf.io,doublebits/osf.io,abought/osf.io,mluo613/osf.io,ticklemepierce/osf.io,GageGaskins/osf.io,billyhunt/osf.io,KAsante95/osf.io,chennan47/osf.io,ZobairAlijan/osf.io,GageGaskins/osf.io,acshi/osf.io,ticklemepierce/osf.io,ckc6cz/osf.io,mluo613/osf.io,baylee-d/osf.io,arpitar/osf.io,haoyuchen1992/osf.io,Ghalko/osf.io,caseyrollins/osf.io,kwierman/osf.io,jmcarp/osf.io,CenterForOpenScience/osf.io,billyhunt/osf.io,brandonPurvis/osf.io,HarryRybacki/osf.io,reinaH/osf.io,SSJohns/osf.io,doublebits/osf.io,sbt9uc/osf.io,caseyrollins/osf.io,erinspace/osf.io,TomHeatwole/osf.io,cwisecarver/osf.io,kwierman/osf.io,doublebits/osf.io,jinluyuan/osf.io,GageGaskins/osf.io,TomHeatwole/osf.io,abought/osf.io,HarryRybacki/osf.io,samchrisinger/osf.io,chennan47/osf.io,crcresearch/osf.io,lyndsysimon/osf.io,ticklemepierce/osf.io,RomanZWang/osf.io,asanfilippo7/osf.io,GageGaskins/osf.io,jmcarp/osf.io,leb2dg/osf.io,mattclark/osf.io,jolene-esposito/osf.io,acshi/osf.io,HarryRybacki/osf.io,samanehsan/osf.io,billyhunt/osf.io,cslzchen/osf.io,billyhunt/osf.io,billyhunt/osf.io,RomanZWang/osf.io,cosenal/osf.io,pattisdr/osf.io,jnayak1/osf.io,fabianvf/osf.io,monikagrabowska/osf.io,HalcyonChimera/osf.io,jnayak1/osf.io,bdyetton/prettychart,mluo613/osf.io,ZobairAlijan/osf.io,bdyetton/prettychart,amyshi188/osf.io,zamattiac/osf.io,kch8qx/osf.io,KAsante95/osf.io,abought/osf.io,caneruguz/osf.io,danielneis/osf.io,asanfilippo7/osf.io,mluke93/osf.io,TomBaxter/osf.io,ckc6cz/osf.io,MerlinZhang/osf.io,sloria/osf.io,leb2dg/osf.io,ZobairAlijan/osf.io,doublebits/osf.io,kch8qx/osf.io,GageGaskins/osf.io,jnayak1/osf.io,HalcyonChimera/osf.io,lyndsysimon/osf.io,acshi/osf.io,samchrisinger/osf.io,DanielSBrown/osf.io,jeffreyliu3230/osf.io,Johnetordoff/osf.io,monikagrabowska/osf.io,HarryRybacki/osf.io,icereval/osf.io,ckc6cz/osf.io,asanfilippo7/osf.io,samchrisinger/osf.io,Johnetordoff/osf.io,sloria/osf.io,adlius/osf.io,zachjanicki/osf.io,Ghalko/osf.io,sbt9uc/osf.io,amyshi188/osf.io,binoculars/osf.io,erinspace/osf.io,dplorimer/osf,hmoco/osf.io,crcresearch/osf.io,haoyuchen1992/osf.io,brianjgeiger/osf.io,cwisecarver/osf.io,TomBaxter/osf.io,felliott/osf.io,chrisseto/osf.io,KAsante95/osf.io,zachjanicki/osf.io,caneruguz/osf.io,chrisseto/osf.io,binoculars/osf.io,zachjanicki/osf.io,bdyetton/prettychart,petermalcolm/osf.io,dplorimer/osf,brianjgeiger/osf.io,icereval/osf.io,barbour-em/osf.io,mfraezz/osf.io,MerlinZhang/osf.io,DanielSBrown/osf.io,ckc6cz/osf.io,Johnetordoff/osf.io,ticklemepierce/osf.io,Nesiehr/osf.io,laurenrevere/osf.io,alexschiller/osf.io,HalcyonChimera/osf.io,mluke93/osf.io,amyshi188/osf.io,brandonPurvis/osf.io,jolene-esposito/osf.io,binoculars/osf.io,lyndsysimon/osf.io,petermalcolm/osf.io,dplorimer/osf,kch8qx/osf.io,asanfilippo7/osf.io,adlius/osf.io,Ghalko/osf.io,haoyuchen1992/osf.io,jinluyuan/osf.io,reinaH/osf.io,cldershem/osf.io,TomHeatwole/osf.io,TomBaxter/osf.io,njantrania/osf.io,cldershem/osf.io,barbour-em/osf.io,jmcarp/osf.io,CenterForOpenScience/osf.io,reinaH/osf.io,brianjgeiger/osf.io,cldershem/osf.io,kch8qx/osf.io,RomanZWang/osf.io,caneruguz/osf.io,kch8qx/osf.io,cslzchen/osf.io,emetsger/osf.io,sloria/osf.io,cldershem/osf.io,danielneis/osf.io,Nesiehr/osf.io,acshi/osf.io,saradbowman/osf.io,jeffreyliu3230/osf.io,baylee-d/osf.io,jinluyuan/osf.io,jeffreyliu3230/osf.io,bdyetton/prettychart,caseyrygt/osf.io,alexschiller/osf.io,njantrania/osf.io,arpitar/osf.io,crcresearch/osf.io,MerlinZhang/osf.io,aaxelb/osf.io,arpitar/osf.io,KAsante95/osf.io,emetsger/osf.io,samchrisinger/osf.io,emetsger/osf.io,monikagrabowska/osf.io,aaxelb/osf.io,caneruguz/osf.io,rdhyee/osf.io,cwisecarver/osf.io,brandonPurvis/osf.io,felliott/osf.io,cosenal/osf.io,monikagrabowska/osf.io,wearpants/osf.io,caseyrygt/osf.io,reinaH/osf.io,amyshi188/osf.io,jolene-esposito/osf.io,petermalcolm/osf.io,danielneis/osf.io,caseyrygt/osf.io,chennan47/osf.io,danielneis/osf.io,jnayak1/osf.io,rdhyee/osf.io,fabianvf/osf.io,cwisecarver/osf.io,rdhyee/osf.io,wearpants/osf.io,alexschiller/osf.io,DanielSBrown/osf.io,felliott/osf.io,chrisseto/osf.io,RomanZWang/osf.io,arpitar/osf.io,brandonPurvis/osf.io,dplorimer/osf,fabianvf/osf.io,barbour-em/osf.io,felliott/osf.io,zamattiac/osf.io,mluke93/osf.io,mfraezz/osf.io,njantrania/osf.io,zachjanicki/osf.io,SSJohns/osf.io,Ghalko/osf.io,erinspace/osf.io,laurenrevere/osf.io,caseyrollins/osf.io,rdhyee/osf.io,cosenal/osf.io,baylee-d/osf.io,hmoco/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,caseyrygt/osf.io,laurenrevere/osf.io,CenterForOpenScience/osf.io,acshi/osf.io,leb2dg/osf.io,njantrania/osf.io,DanielSBrown/osf.io,barbour-em/osf.io,mluo613/osf.io,aaxelb/osf.io,leb2dg/osf.io,samanehsan/osf.io,MerlinZhang/osf.io,jmcarp/osf.io,mfraezz/osf.io,icereval/osf.io,mattclark/osf.io,kwierman/osf.io,sbt9uc/osf.io,wearpants/osf.io,hmoco/osf.io,cslzchen/osf.io,mattclark/osf.io,samanehsan/osf.io,adlius/osf.io,TomHeatwole/osf.io,alexschiller/osf.io,brianjgeiger/osf.io,RomanZWang/osf.io,SSJohns/osf.io,lyndsysimon/osf.io,saradbowman/osf.io,fabianvf/osf.io,kwierman/osf.io,abought/osf.io,adlius/osf.io,pattisdr/osf.io,chrisseto/osf.io,aaxelb/osf.io,Nesiehr/osf.io,SSJohns/osf.io,haoyuchen1992/osf.io,alexschiller/osf.io,ZobairAlijan/osf.io,Nesiehr/osf.io,zamattiac/osf.io,doublebits/osf.io,emetsger/osf.io,CenterForOpenScience/osf.io,mluo613/osf.io,pattisdr/osf.io,petermalcolm/osf.io,jolene-esposito/osf.io,jinluyuan/osf.io,sbt9uc/osf.io,HalcyonChimera/osf.io,hmoco/osf.io,mluke93/osf.io,brandonPurvis/osf.io,zamattiac/osf.io,cslzchen/osf.io,samanehsan/osf.io,jeffreyliu3230/osf.io
|
fb8ff704821e18be2a8aef117f69e32f408cfc5b
|
models/index.js
|
models/index.js
|
/*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
/* jslint node: true */
const fs = require('fs')
const path = require('path')
const sequelizeNoUpdateAttributes = require('sequelize-noupdate-attributes')
const Sequelize = require('sequelize')
const sequelize = new Sequelize('database', 'username', 'password', {
dialect: 'sqlite',
storage: ':memory:', // replace with 'data/juiceshop.sqlite' for debugging
logging: false
})
sequelizeNoUpdateAttributes(sequelize)
const db = {}
fs.readdirSync(__dirname)
.filter(file => (file.indexOf('.') !== 0) && (file !== 'index.js'))
.forEach(file => {
const model = sequelize.import(path.join(__dirname, file))
db[model.name] = model
})
Object.keys(db).forEach(modelName => {
if ('associate' in db[modelName]) {
db[modelName].associate(db)
}
})
db.sequelize = sequelize
db.Sequelize = Sequelize
module.exports = db
|
/*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
/* jslint node: true */
const fs = require('fs')
const path = require('path')
const sequelizeNoUpdateAttributes = require('sequelize-noupdate-attributes')
const Sequelize = require('sequelize')
const sequelize = new Sequelize('database', 'username', 'password', {
dialect: 'sqlite',
storage: 'data/juiceshop.sqlite',
logging: false
})
sequelizeNoUpdateAttributes(sequelize)
const db = {}
fs.readdirSync(__dirname)
.filter(file => (file.indexOf('.') !== 0) && (file !== 'index.js'))
.forEach(file => {
const model = sequelize.import(path.join(__dirname, file))
db[model.name] = model
})
Object.keys(db).forEach(modelName => {
if ('associate' in db[modelName]) {
db[modelName].associate(db)
}
})
db.sequelize = sequelize
db.Sequelize = Sequelize
module.exports = db
|
Revert SQLite to file-based instead of in-memory
|
Revert SQLite to file-based instead of in-memory
|
JavaScript
|
mit
|
bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop
|
2b37f7f163fa4eec831e72e1f876ffad3894e1df
|
pipeline/app/assets/javascripts/app.js
|
pipeline/app/assets/javascripts/app.js
|
'use strict';
var pathwayApp = angular.module('pathwayApp', ['ui.router', 'templates']);
pathwayApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
//Default route
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);
$stateProvider
.state('home', {
url: '/',
templateUrl: 'index.html',
// templateUrl: '../app/assets/templates/index.html',
controller: 'HomeController'
})
.state('login', {
url: '/user/login',
templateUrl: 'login.html',
controller: 'UserController'
})
});
|
'use strict';
var pathwayApp = angular.module('pathwayApp', ['ui.router', 'templates']);
pathwayApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
//Default route
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);
$stateProvider
.state('home', {
url: '/',
templateUrl: 'index.html',
controller: 'HomeController'
})
.state('logout', {
url: '/',
controller: 'UserController'
})
.state('login', {
url: '/user/login',
templateUrl: 'login.html',
controller: 'UserController'
})
.state('register', {
url: '/user/new',
tempalteUrl: 'register.html',
controller: 'UserController'
})
});
|
Add logout and register state, remove incorrect templateUrl
|
Add logout and register state, remove incorrect templateUrl
|
JavaScript
|
mit
|
aattsai/Pathway,aattsai/Pathway,aattsai/Pathway
|
884def1c71c748655bc294e2b3084c627973a848
|
test/db-helpers.js
|
test/db-helpers.js
|
const fs = require('fs');
const { promisify } = require('util');
const mongodb = require('mongodb');
const request = require('request');
async function readMongoDocuments(file) {
const ISODate = (d) => new Date(d);
const ObjectId = (id) => mongodb.ObjectID.createFromHexString(id);
return eval(await fs.promises.readFile(file, 'utf-8'));
}
async function insertTestData(url, users, posts) {
const mongoClient = await mongodb.MongoClient.connect(url);
const db = mongoClient.db();
await db.collection('user').deleteMany({});
await db.collection('post').deleteMany({});
await db.collection('user').insertMany(users);
await db.collection('post').insertMany(posts);
await mongoClient.close();
}
/* refresh openwhyd's in-memory cache of users, to allow this user to login */
async function refreshOpenwhydCache(urlPrefix = 'http://localhost:8080') {
await promisify(request.post)(urlPrefix + '/testing/refresh');
}
module.exports = {
readMongoDocuments,
insertTestData,
refreshOpenwhydCache,
};
|
const fs = require('fs');
const { promisify } = require('util');
const mongodb = require('mongodb');
const request = require('request');
async function readMongoDocuments(file) {
const ISODate = (d) => new Date(d);
const ObjectId = (id) => mongodb.ObjectID.createFromHexString(id);
return eval(await fs.promises.readFile(file, 'utf-8'));
}
async function insertTestData(url, docsPerCollection) {
const mongoClient = await mongodb.MongoClient.connect(url);
const db = mongoClient.db();
await Promise.all(
Object.keys(docsPerCollection).map(async (collection) => {
await db.collection(collection).deleteMany({});
await db.collection(collection).insertMany(docsPerCollection[collection]);
})
);
await mongoClient.close();
}
/* refresh openwhyd's in-memory cache of users, to allow this user to login */
async function refreshOpenwhydCache(urlPrefix = 'http://localhost:8080') {
await promisify(request.post)(urlPrefix + '/testing/refresh');
}
module.exports = {
readMongoDocuments,
insertTestData,
refreshOpenwhydCache,
};
|
Allow importing test data for any db collection
|
fix(tests): Allow importing test data for any db collection
|
JavaScript
|
mit
|
openwhyd/openwhyd,openwhyd/openwhyd,openwhyd/openwhyd,openwhyd/openwhyd,openwhyd/openwhyd
|
4a9a3246f633c3ddb358d3e79a38b39bb2a61bb1
|
src/fetch-error.js
|
src/fetch-error.js
|
/**
* fetch-error.js
*
* FetchError interface for operational errors
*/
/**
* Create FetchError instance
*
* @param String message Error message for human
* @param String type Error type for machine
* @param String systemError For Node.js system error
* @return FetchError
*/
export default function FetchError(message, type, systemError) {
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.type = type;
// when err.type is `system`, err.code contains system error code
if (systemError) {
this.code = this.errno = systemError.code;
}
}
require('util').inherits(FetchError, Error);
|
/**
* fetch-error.js
*
* FetchError interface for operational errors
*/
/**
* Create FetchError instance
*
* @param String message Error message for human
* @param String type Error type for machine
* @param String systemError For Node.js system error
* @return FetchError
*/
export default function FetchError(message, type, systemError) {
Error.call(this, message);
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
this.message = message;
this.type = type;
// when err.type is `system`, err.code contains system error code
if (systemError) {
this.code = this.errno = systemError.code;
}
}
FetchError.prototype = Object.create(Error.prototype);
FetchError.prototype.name = 'FetchError';
|
Remove dependency on Node.js' util module
|
Remove dependency on Node.js' util module
Closes #194.
|
JavaScript
|
mit
|
jkantr/node-fetch,bitinn/node-fetch
|
8114331a8425621e2eb98f39045289ed08bb2e0d
|
test/e2e/config/delays.js
|
test/e2e/config/delays.js
|
/*
* In order to prevent errors caused by e2e tests running too fast you can slow them down by calling the following
* function. Use higher values for slower tests.
*
* utils.delayPromises(30);
*
*/
var promisesDelay = 50;
function delayPromises(milliseconds) {
var executeFunction = browser.driver.controlFlow().execute;
browser.driver.controlFlow().execute = function() {
var args = arguments;
executeFunction.call(browser.driver.controlFlow(), function() {
return protractor.promise.delayed(milliseconds);
});
return executeFunction.apply(browser.driver.controlFlow(), args);
};
}
console.log("Set promises delay to " + promisesDelay + " ms.");
delayPromises(promisesDelay);
var ECWaitTime = 4500;
var shortRest = 200;
module.exports = {
ECWaitTime: ECWaitTime,
shortRest: shortRest
};
|
/*
* In order to prevent errors caused by e2e tests running too fast you can slow them down by calling the following
* function. Use higher values for slower tests.
*
* utils.delayPromises(30);
*
*/
var promisesDelay = 0;
function delayPromises(milliseconds) {
var executeFunction = browser.driver.controlFlow().execute;
browser.driver.controlFlow().execute = function() {
var args = arguments;
executeFunction.call(browser.driver.controlFlow(), function() {
return protractor.promise.delayed(milliseconds);
});
return executeFunction.apply(browser.driver.controlFlow(), args);
};
}
console.log("Set promises delay to " + promisesDelay + " ms.");
delayPromises(promisesDelay);
var ECWaitTime = 4500;
var shortRest = 200;
module.exports = {
ECWaitTime: ECWaitTime,
shortRest: shortRest
};
|
Set delay to zero for local development.
|
Set delay to zero for local development.
|
JavaScript
|
apache-2.0
|
codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client
|
d761c33ce8effc9640fccfb4e409bf6a6ee33a91
|
util/subtitles.js
|
util/subtitles.js
|
const parseTime = (s) => {
const re = /(\d{2}):(\d{2}):(\d{2}),(\d{3})/;
const [, hours, mins, seconds, ms] = re.exec(s);
return 3600*(+hours) + 60*(+mins) + (+seconds) + 0.001*(+ms);
};
export const parseSRT = (text) => {
const normText = text.replace(/\r\n/g, '\n'); // normalize newlines
const re = /(\d+)\n(\d{2}:\d{2}:\d{2},\d{3}) --> (\d{2}:\d{2}:\d{2},\d{3})\n((?:.+\n)+)/g;
const subs = [];
let found;
while (true) {
found = re.exec(normText);
if (!found) {
break;
}
const [full, , beginStr, endStr, lines] = found;
const begin = parseTime(beginStr);
const end = parseTime(endStr);
// TODO: Should verify that end time is >= begin time
// NOTE: We could check that indexes and/or time are in order, but don't really care
subs.push({
begin,
end,
lines,
});
re.lastIndex = found.index + full.length;
}
return subs;
};
|
const parseTime = (s) => {
const re = /(\d{2}):(\d{2}):(\d{2}),(\d{3})/;
const [, hours, mins, seconds, ms] = re.exec(s);
return 3600*(+hours) + 60*(+mins) + (+seconds) + 0.001*(+ms);
};
export const parseSRT = (text) => {
const normText = text.replace(/\r\n/g, '\n'); // normalize newlines
const re = /(\d+)\n(\d{2}:\d{2}:\d{2},\d{3}) --> (\d{2}:\d{2}:\d{2},\d{3})\n((?:.+\n)+)/g;
const subs = [];
let found;
while (true) {
found = re.exec(normText);
if (!found) {
break;
}
const [full, , beginStr, endStr, lines] = found;
const begin = parseTime(beginStr);
const end = parseTime(endStr);
// TODO: Should verify that end time is >= begin time
// NOTE: We could check that indexes and/or time are in order, but don't really care
subs.push({
begin,
end,
lines: lines.trim(),
});
re.lastIndex = found.index + full.length;
}
return subs;
};
|
Trim whitespace on subtitle import
|
Trim whitespace on subtitle import
|
JavaScript
|
mit
|
rsimmons/voracious,rsimmons/immersion-player,rsimmons/immersion-player,rsimmons/voracious,rsimmons/voracious
|
de74589c0323ad7d0323345fd9e214fb42498e8c
|
config/env/production.js
|
config/env/production.js
|
/**
* Production environment settings
*
* This file can include shared settings for a production environment,
* such as API keys or remote database passwords. If you're using
* a version control solution for your Sails app, this file will
* be committed to your repository unless you add it to your .gitignore
* file. If your repository will be publicly viewable, don't add
* any private information to this file!
*
*/
module.exports = {
facebookConfig: {
apiKey: '175967239248590',
callbackUrl: 'https://redrum-js-client.herokuapp.com/user/facebookcb',
secretKey: '319c7ed2f24fc1ac61269a319a19fe11'
},
githubConfig: {
apiKey: '9bab472b1f554514792f',
callbackUrl: 'https://redrum-js-client.herokuapp.com/user/githubcb',
secretKey: '914b62b2aac9c0506e0146f22bab345ffeb2588c'
},
redrumConfig: {
clientId: 'redrum-js-demo',
clientSecret: '847eacd8-d636-4aef-845d-512128dd09a4',
debug: false
}
};
|
/**
* Production environment settings
*
* This file can include shared settings for a production environment,
* such as API keys or remote database passwords. If you're using
* a version control solution for your Sails app, this file will
* be committed to your repository unless you add it to your .gitignore
* file. If your repository will be publicly viewable, don't add
* any private information to this file!
*
*/
module.exports = {
port: process.env.PORT || 1337,
facebookConfig: {
apiKey: '175967239248590',
callbackUrl: 'https://redrum-js-client.herokuapp.com/user/facebookcb',
secretKey: '319c7ed2f24fc1ac61269a319a19fe11'
},
githubConfig: {
apiKey: '9bab472b1f554514792f',
callbackUrl: 'https://redrum-js-client.herokuapp.com/user/githubcb',
secretKey: '914b62b2aac9c0506e0146f22bab345ffeb2588c'
},
redrumConfig: {
clientId: 'redrum-js-demo',
clientSecret: '847eacd8-d636-4aef-845d-512128dd09a4',
debug: false
}
};
|
Set port to environment variable.
|
Set port to environment variable.
|
JavaScript
|
mit
|
aug70/redrum-js-client,aug70/redrum-js-client
|
e5c01d6b96b1aec411017bf20069d6706623ff60
|
test/markup-frame-test.js
|
test/markup-frame-test.js
|
import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import MarkupFrame from '../src';
describe( '<MarkupFrame />', () => {
it( 'renders an iframe', () => {
const wrapper = mount( <MarkupFrame markup="" /> );
expect( wrapper.some( 'iframe' ) ).to.equal( true );
} );
it( 'injects props.markup into the iframe' );
it( 'calls props.onLoad with the iframe document' );
} );
|
import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import MarkupFrame from '../src';
describe( '<MarkupFrame />', function() {
it( 'renders an iframe', function() {
const wrapper = mount( <MarkupFrame markup="" /> );
expect( wrapper.find( 'iframe' ) ).to.have.length( 1 );
} );
it( 'injects props.markup into the iframe', function() {
const wrapper = mount( <MarkupFrame markup="<h1>Hello World</h1>" /> );
expect( wrapper.find( 'iframe' ).get( 0 ).innerHTML ).to.eql( '<h1>Hello World</h1>' )
} );
it( 'calls props.onLoad with the iframe document', function() {
const onLoad = doc => doc.querySelector( 'h1' ).innerHTML = 'greetings';
const wrapper = mount( <MarkupFrame markup="<h1>Hello World</h1>" onLoad={ onLoad } /> );
expect( wrapper.find( 'iframe' ).get( 0 ).innerHTML ).to.eql( '<h1>greetings</h1>' )
} );
} );
|
Update tests to cover most common cases
|
Update tests to cover most common cases
They don't work, of course, because (I think) some mix of React, jsdom, and
iframes don't work correctly together.
|
JavaScript
|
mit
|
sirbrillig/markup-frame
|
9578954c6b1817ff7a8e8bfa0a4532835c8040e9
|
client/js/app.js
|
client/js/app.js
|
console.log('Tokimeki Memorial');
|
console.log('Tokimeki Memorial');
var host = window.document.location.host.replace(/:.*/, '');
var ws = new WebSocket('ws://' + host + ':8000');
ws.onmessage = function (event) {
//console.log(event);
//console.log(JSON.parse(event.data));
};
|
Make WS connection in index page for testing purposes.
|
Make WS connection in index page for testing purposes.
|
JavaScript
|
apache-2.0
|
AI-comp/AILovers,AI-comp/AILovers,AI-comp/AILovers,AI-comp/AILovers,AI-comp/AILovers,AI-comp/AILovers
|
b8cf678c13325df71135b3e7cc5fc521a3a98b1b
|
polyfill/fetch.js
|
polyfill/fetch.js
|
import "mojave/polyfill/Promise";
import "unfetch/polyfill";
export default window.fetch;
|
import "mojave/polyfill/promise";
import "unfetch/polyfill";
export default window.fetch;
|
Fix case of promise polyfill
|
Fix case of promise polyfill
|
JavaScript
|
bsd-3-clause
|
Becklyn/mojave,Becklyn/mojave,Becklyn/mojave
|
cc0a3c204f59e1039cad5b592d969fac30c40fbf
|
src/components/Members/MemberDetail.js
|
src/components/Members/MemberDetail.js
|
import React, { Component, PropTypes } from 'react';
class MembersDetail extends Component {
render() {
const {displayName} = this.props;
return (
<div>
<h1>{displayName}</h1>
</div>
);
}
}
MembersDetail.propTypes = {
displayName: PropTypes.string.isRequired,
};
export default MembersDetail;
|
import React, { Component, PropTypes } from 'react';
class MembersDetail extends Component {
render() {
const {displayName, image} = this.props;
return (
<div>
<h1>{displayName}</h1>
<img src={image.uri} style={{
display: 'inline-block',
paddingRight: '10px',
}} />
</div>
);
}
}
MembersDetail.propTypes = {
displayName: PropTypes.string.isRequired,
image: PropTypes.shape({
uri: PropTypes.string.isRequired,
height: PropTypes.number,
width: PropTypes.number,
}),
intro: PropTypes.string,
slug: PropTypes.string.isRequired,
usState: PropTypes.string,
};
export default MembersDetail;
|
Add image and proptypes for member detail page
|
Add image and proptypes for member detail page
|
JavaScript
|
cc0-1.0
|
cape-io/acf-client,cape-io/acf-client
|
d794502bfcc0204aa7fdbe6d9f103a1099919718
|
kolibri/core/assets/src/state/modules/snackbar.js
|
kolibri/core/assets/src/state/modules/snackbar.js
|
export default {
state: {
isVisible: false,
options: {
text: '',
autoDismiss: true,
},
},
getters: {
snackbarIsVisible(state) {
return state.isVisible;
},
snackbarOptions(state) {
return state.options;
},
},
mutations: {
CORE_CREATE_SNACKBAR(state, snackbarOptions = {}) {
// reset
state.isVisible = false;
state.options = {};
// set new options
state.isVisible = true;
state.options = snackbarOptions;
},
CORE_CLEAR_SNACKBAR(state) {
state.isVisible = false;
state.options = {};
},
CORE_SET_SNACKBAR_TEXT(state, text) {
state.options.text = text;
},
},
};
|
export default {
state: {
isVisible: false,
options: {
text: '',
autoDismiss: true,
},
},
getters: {
snackbarIsVisible(state) {
return state.isVisible;
},
snackbarOptions(state) {
return state.options;
},
},
mutations: {
CORE_CREATE_SNACKBAR(state, snackbarOptions = {}) {
// reset
state.isVisible = false;
state.options = {};
// set new options
state.isVisible = true;
// options include text, autoDismiss, duration, actionText, actionCallback,
// hideCallback
state.options = snackbarOptions;
},
CORE_CLEAR_SNACKBAR(state) {
state.isVisible = false;
state.options = {};
},
CORE_SET_SNACKBAR_TEXT(state, text) {
state.options.text = text;
},
},
};
|
Add comment about autodismiss options
|
Add comment about autodismiss options
|
JavaScript
|
mit
|
lyw07/kolibri,indirectlylit/kolibri,mrpau/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,lyw07/kolibri,mrpau/kolibri,lyw07/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,lyw07/kolibri
|
23010015c762a1274597e2754d190fabad078cfe
|
src/components/SearchResultListItem.js
|
src/components/SearchResultListItem.js
|
import React from 'react';
import { connect } from 'react-redux';
const DocumentListItem = ({ title, collection, schema }) => (
<tr className={`result result--${schema}`}>
<td>{ title }</td>
<td className="result__collection">{ collection && collection.label }</td>
<td></td>
</tr>
);
const PersonListItem = ({ name, collection, schema }) => (
<tr className={`result result--${schema}`}>
<td className="result__name">{ name }</td>
<td className="result__collection">{ collection && collection.label }</td>
<td></td>
</tr>
);
const ListItems = {
'Document': DocumentListItem,
'Person': PersonListItem,
'LegalEntity': PersonListItem,
'Company': PersonListItem
};
const SearchResultListItem = ({ result, collection }) => {
const ListItem = ListItems[result.schema];
return <ListItem collection={collection} {...result} />;
};
const mapStateToProps = ({ collections }, { result }) => ({
collection: collections[result.collection_id]
});
export default connect(mapStateToProps)(SearchResultListItem);
|
import React from 'react';
import { connect } from 'react-redux';
const DocumentListItem = ({ title, collection, schema }) => (
<tr className={`result result--${schema}`}>
<td>{ title }</td>
<td className="result__collection">{ collection && collection.label }</td>
<td></td>
</tr>
);
const PersonListItem = ({ name, collection, schema }) => (
<tr className={`result result--${schema}`}>
<td className="result__name">{ name }</td>
<td className="result__collection">
{ collection ?
collection.label :
<span className="pt-skeleton">Loading collection</span>
}
</td>
<td></td>
</tr>
);
const ListItems = {
'Document': DocumentListItem,
'Person': PersonListItem,
'LegalEntity': PersonListItem,
'Company': PersonListItem
};
const SearchResultListItem = ({ result, collection }) => {
const ListItem = ListItems[result.schema];
return <ListItem collection={collection} {...result} />;
};
const mapStateToProps = ({ collections }, { result }) => ({
collection: collections[result.collection_id]
});
export default connect(mapStateToProps)(SearchResultListItem);
|
Add placeholder for loading collection names
|
Add placeholder for loading collection names
|
JavaScript
|
mit
|
alephdata/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph
|
be3331f24e7693c41e012a2eb935d474de224f1f
|
frontend/web/js/main.js
|
frontend/web/js/main.js
|
$(document).ready(function() {
$('#global-modal-container').on('show.bs.modal', function (event) {
sourceUrl = $(event.relatedTarget).attr('href');
getGlobalModalHtml(sourceUrl);
});
});
function getGlobalModalHtml(url) {
$.ajax({
url: url,
type: "post",
success: function(returnData) {
$('#global-modal-container .modal-body').html(returnData);
headerHtml = $('#global-modal-container .modal-body .apc-modal-header')[0].outerHTML;
$('#global-modal-container .modal-body .apc-modal-header').remove();
$('#global-modal-container .modal-header .apc-modal-header').remove();
$('#global-modal-container .modal-header').prepend(headerHtml);
//alert('success');
},
error: function(jqXHR, textStatus, errorThrown){
alert('Error loading Global Modal Container: ' + textStatus + ':' + errorThrown);
}
});
}
|
$(document).ready(function() {
$('#global-modal-container').on('show.bs.modal', function (event) {
sourceUrl = $(event.relatedTarget).attr('href');
getGlobalModalHtml(sourceUrl);
$('.tooltip').hide();
});
});
function getGlobalModalHtml(url) {
$.ajax({
url: url,
type: "post",
success: function(returnData) {
$('#global-modal-container .modal-body').html(returnData);
headerHtml = $('#global-modal-container .modal-body .apc-modal-header')[0].outerHTML;
$('#global-modal-container .modal-body .apc-modal-header').remove();
$('#global-modal-container .modal-header .apc-modal-header').remove();
$('#global-modal-container .modal-header').prepend(headerHtml);
//alert('success');
},
error: function(jqXHR, textStatus, errorThrown){
alert('Error loading Global Modal Container: ' + textStatus + ':' + errorThrown);
}
});
}
|
Hide all tooltips when showing a modal window
|
Hide all tooltips when showing a modal window
|
JavaScript
|
bsd-3-clause
|
gooGooGaJoob/banthecan,gooGooGaJoob/banthecan,gooGooGaJoob/banthecan
|
1faf99e332f94ab27fcef68f05ef8760c219bf4c
|
static-routes/stylesheets.js
|
static-routes/stylesheets.js
|
const sass = require('node-sass');
const path = require('path');
const config = require('../config');
const fs = require('fs');
const imdino = require('imdi-no');
const development = config.env === 'development';
module.exports = {
"/stylesheets/main.css": function (callback) {
const opts = {
file: path.join(__dirname, "/../stylesheets/main.scss"),
outFile: '/stylesheets/main.css',
includePaths: imdino.includePaths,
sourceMap: development,
sourceMapEmbed: development,
sourceMapContents: development,
sourceComments: development,
outputStyle: development ? 'nested' : 'compressed'
};
sass.render(opts, (err, result)=> {
if (err) {
return callback(err)
}
callback(null, result.css);
});
}
};
fs.readdirSync(imdino.paths.gfx).forEach(file => {
const fullPath = path.join(imdino.paths.gfx, file);
const httpPaths = [
path.join('/imdi-no/_themes/blank/gfx', file),
path.join('/gfx', file)
];
httpPaths.forEach(httpPath => {
module.exports[httpPath] = function() {
return fs.createReadStream(fullPath);
}
});
});
|
const sass = require('node-sass');
const path = require('path');
const config = require('../config');
const fs = require('fs');
const imdino = require('imdi-no');
const development = config.env === 'development';
module.exports = {
"/stylesheets/main.css": function (callback) {
const opts = {
file: require.resolve("../stylesheets/main.scss"),
outFile: '/stylesheets/main.css',
includePaths: imdino.includePaths,
sourceMap: development,
sourceMapEmbed: development,
sourceMapContents: development,
sourceComments: development,
outputStyle: development ? 'nested' : 'compressed'
};
sass.render(opts, (err, result)=> {
if (err) {
return callback(err)
}
callback(null, result.css);
});
}
};
fs.readdirSync(imdino.paths.gfx).forEach(file => {
const fullPath = path.join(imdino.paths.gfx, file);
const httpPaths = [
path.join('/imdi-no/_themes/blank/gfx', file),
path.join('/gfx', file)
];
httpPaths.forEach(httpPath => {
module.exports[httpPath] = function() {
return fs.createReadStream(fullPath);
}
});
});
|
Use require.resolve to locate main.scss
|
Use require.resolve to locate main.scss
|
JavaScript
|
mit
|
bengler/imdikator,bengler/imdikator
|
dc50cc1124f8c39b4000eba4d0914191ddd4245a
|
libs/oada-lib-arangodb/libs/exampledocs/tokens.js
|
libs/oada-lib-arangodb/libs/exampledocs/tokens.js
|
module.exports = [
{
"_key": "default:token-123",
"token": "xyz",
"scope": ["oada-rocks:all"],
"createTime": 1413831649937,
"expiresIn": 60,
"user": { "_id": "default:users-frank-123" },
"clientId": "[email protected]"
}
];
|
module.exports = [
{
"_key": "default:token-123",
"token": "xyz",
"scope": ["oada.rocks:all"],
"createTime": 1413831649937,
"expiresIn": 60,
"user": { "_id": "default:users-frank-123" },
"clientId": "[email protected]"
}
];
|
Add scope to token xyz.
|
Add scope to token xyz.
|
JavaScript
|
apache-2.0
|
OADA/oada-srvc-docker,OADA/oada-srvc-docker,OADA/oada-srvc-docker,OADA/oada-srvc-docker
|
ccd35fed533ac20783ccf70a09a81c1aaf611341
|
templates/javascript/FluxAction.js
|
templates/javascript/FluxAction.js
|
'use strict';
var <%= classedName %> = {
}
<% if (es6) { %> export default <%= classedName %>; <% }
else { %>module.exports = <%= classedName %>; <% } %>
|
'use strict';
var <%= classedName %> = {
};
<% if (es6) { %> export default <%= classedName %>; <% }
else { %>module.exports = <%= classedName %>; <% } %>
|
Add missing semicolon to avoid warnings
|
Add missing semicolon to avoid warnings
|
JavaScript
|
mit
|
mattludwigs/generator-react-redux-kit,mattludwigs/generator-react-redux-kit,react-webpack-generators/generator-react-webpack,newtriks/generator-react-webpack
|
bd5644d859ccb3639666afe46fda03d3610bb374
|
public/modules/slideshows/services/slideshows.client.service.js
|
public/modules/slideshows/services/slideshows.client.service.js
|
/*global angular*/
(function () {
'use strict';
//Slideshows service used to communicate Slideshows REST endpoints
angular.module('slideshows').factory('Slideshows', ['$resource',
function ($resource) {
return $resource('slideshows/:slideshowId',
{ slideshowId: '@_id' },
{ update:
{method: 'PUT'}
});
}]);
}());
|
/*global angular*/
(function () {
'use strict';
//Slideshows service used to communicate Slideshows REST endpoints
angular.module('slideshows').factory('Slideshows', ['$resource',
function ($resource) {
return $resource('slideshows/:slideshowId', {
slideshowId: '@_id'
}, {
update: {
method: 'PUT'
},
getDevices: {
method: 'GET',
url: 'slideshowDevices/:slideshowId',
isArray: true,
params: {name: '@name'}
},
setDevices: {
method: 'PUT',
url: 'slideshowDevices/:slideshowId'
}
});
}]);
}());
|
Add name as parameter when geting devices for a slideshow
|
Add name as parameter when geting devices for a slideshow
|
JavaScript
|
mit
|
tmol/iQSlideShow,tmol/iQSlideShow,tmol/iQSlideShow
|
dbee31c17ab6f6376683e97cb1904820d37fcd65
|
website/src/html.js
|
website/src/html.js
|
import React from 'react'
import PropTypes from 'prop-types'
export default function HTML(props) {
return (
<html {...props.htmlAttributes}>
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"
/>
{props.headComponents}
</head>
<body {...props.bodyAttributes}>
{props.preBodyComponents}
<noscript key="noscript" id="gatsby-noscript">
This app works best with JavaScript enabled.
</noscript>
<div key={`body`} id="___gatsby" dangerouslySetInnerHTML={{ __html: props.body }} />
{props.postBodyComponents}
</body>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"
/>
</html>
)
}
HTML.propTypes = {
htmlAttributes: PropTypes.object,
headComponents: PropTypes.array,
bodyAttributes: PropTypes.object,
preBodyComponents: PropTypes.array,
body: PropTypes.string,
postBodyComponents: PropTypes.array,
}
|
import React from 'react'
import PropTypes from 'prop-types'
export default function HTML(props) {
return (
<html {...props.htmlAttributes}>
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
{props.headComponents}
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"
/>
</head>
<body {...props.bodyAttributes}>
{props.preBodyComponents}
<noscript key="noscript" id="gatsby-noscript">
This app works best with JavaScript enabled.
</noscript>
<div key={`body`} id="___gatsby" dangerouslySetInnerHTML={{ __html: props.body }} />
{props.postBodyComponents}
</body>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"
/>
</html>
)
}
HTML.propTypes = {
htmlAttributes: PropTypes.object,
headComponents: PropTypes.array,
bodyAttributes: PropTypes.object,
preBodyComponents: PropTypes.array,
body: PropTypes.string,
postBodyComponents: PropTypes.array,
}
|
Revert "Move DocSearch styles before headComponents"
|
Revert "Move DocSearch styles before headComponents"
This reverts commit 1232ccbc0ff6c5d9e80de65cefb352c404973e2f.
|
JavaScript
|
mit
|
spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy
|
b8f6446ee6a1eb0a149a4f69182f2004b09500ea
|
app/angular/controllers/games_controller.js
|
app/angular/controllers/games_controller.js
|
'use strict';
module.exports = function(app) {
app.controller('GamesController', ['$scope', 'UserService', 'FriendService', 'GameService', 'SearchService', function($scope, UserService, FriendService, GameService, SearchService) {
let ctrl = this;
$scope.FriendService = FriendService;
$scope.allFriends = FriendService.data.allFriends;
ctrl.user = UserService.data.user;
ctrl.players = [];
ctrl.creating = false;
ctrl.editing = false;
ctrl.createGame = function(gameData) {
gameData.players = ctrl.players;
GameService.createGame(gameData)
.catch((err) => {
console.log('Error creating game.');
});
};
ctrl.addUserToGame = function(user) {
ctrl.players.push(user);
};
ctrl.removePlayer = function(user) {
let playersArray = ctrl.game.players;
let userIndex = playersArray.indexOf(user);
ctrl.friendsList.push(playersArray[userIndex]);
playersArray.splice(userIndex, 1);
};
ctrl.initCreate = function() {
let userData = {
_id: ctrl.user._id,
fullName: ctrl.user.fullName,
email: ctrl.user.email,
};
FriendService.getAllFriends(ctrl.user.email);
ctrl.players.push(userData);
ctrl.creating = true;
};
ctrl.init = function() {
};
// ctrl.init();
}]);
};
|
'use strict';
module.exports = function(app) {
app.controller('GamesController', ['$scope', 'UserService', 'FriendService', 'GameService', 'SearchService', function($scope, UserService, FriendService, GameService, SearchService) {
let ctrl = this;
$scope.FriendService = FriendService;
$scope.allFriends = FriendService.data.allFriends;
ctrl.user = UserService.data.user;
ctrl.players = [];
ctrl.creating = false;
ctrl.editing = false;
ctrl.createGame = function(gameData) {
gameData.players = ctrl.players;
GameService.createGame(gameData);
};
ctrl.addUserToGame = function(user) {
ctrl.players.push(user);
};
ctrl.removePlayer = function(user) {
let playersArray = ctrl.game.players;
let userIndex = playersArray.indexOf(user);
ctrl.friendsList.push(playersArray[userIndex]);
playersArray.splice(userIndex, 1);
};
ctrl.initCreate = function() {
let userData = {
_id: ctrl.user._id,
fullName: ctrl.user.fullName,
email: ctrl.user.email,
};
FriendService.getAllFriends(ctrl.user.email);
ctrl.players.push(userData);
ctrl.creating = true;
};
ctrl.init = function() {
};
// ctrl.init();
}]);
};
|
Remove catch from createGame method. Errors are handled by service layer of app.
|
Remove catch from createGame method. Errors are handled by service layer of app.
|
JavaScript
|
mit
|
sendjmoon/GolfFourFriends,sendjmoon/GolfFourFriends
|
2acffe782320c79648816c3a181138b71babb60c
|
config/webpack.common.js
|
config/webpack.common.js
|
const webpack = require('webpack');
const helpers = require('./helpers');
module.exports = {
entry: {
'index': './src/index.js',
// 'test': './src/test.js'
},
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js',
libraryTarget: 'umd',
library: 'Servable',
},
performance: {
hints: false
},
resolve: {
extensions: ['*', '.js'],
modules: [helpers.root('node_modules')],
},
resolveLoader: {
modules: [helpers.root('node_modules')]
},
module: {
loaders: [
{
test: /\.js?$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: [['es2015', {modules: false, loose: true}], 'stage-0'],
}
},
include: helpers.root('src')
},
]
},
};
|
const webpack = require('webpack');
const helpers = require('./helpers');
module.exports = {
entry: {
'index': './src/index.js',
// 'test': './src/test.js'
},
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js',
libraryTarget: 'umd',
library: 'Servable',
umdNamedDefine: true,
},
performance: {
hints: false
},
resolve: {
extensions: ['*', '.js'],
modules: [helpers.root('node_modules')],
},
resolveLoader: {
modules: [helpers.root('node_modules')]
},
module: {
loaders: [
{
test: /\.js?$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: [['es2015', {modules: false, loose: true}], 'stage-0'],
}
},
include: helpers.root('src')
},
]
},
};
|
Update UMD Named define to true
|
Update UMD Named define to true
|
JavaScript
|
mit
|
maniator/servable,maniator/servable
|
fc2c58045d1015187ab6c9cad4532238e6c90736
|
next-migrations/src/migrations/20180605215102_users.js
|
next-migrations/src/migrations/20180605215102_users.js
|
exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.createTable('next_users', table => {
table.bigIncrements()
table.string('email')
table.string('name')
table.string('password')
table.string('origin')
table.string('baseurl')
table.string('phone')
table.boolean('isVerified')
table.string('verifyToken')
table.string('verifyShortToken')
table.bigint('verifyExpires')
table.json('verifyChanges')
table.string('resetToken')
table.string('resetShortToken')
table.bigint('resetExpires')
table.timestamps()
table.unique(['email'])
})
])
}
exports.down = function(knex, Promise) {}
|
exports.up = function(knex, Promise) {
return Promise.all([
knex.schema.createTable('next_users', table => {
table.bigIncrements()
table.string('email')
table.string('name')
table.string('password')
table.string('origin')
table.string('baseurl')
table.string('phone')
table.boolean('isVerified')
table.string('verifyToken')
table.string('verifyShortToken')
table.timestamp('verifyExpires')
table.json('verifyChanges')
table.string('resetToken')
table.string('resetShortToken')
table.timestamp('resetExpires')
table.timestamps()
table.unique(['email'])
})
])
}
exports.down = function(knex, Promise) {}
|
Revert to using timestamps in database.
|
TeikeiNext: Revert to using timestamps in database.
|
JavaScript
|
agpl-3.0
|
teikei/teikei,teikei/teikei,teikei/teikei
|
aecf231cb6310fba9af5a07ffbcced2e084a799d
|
config/ember-try.js
|
config/ember-try.js
|
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
]
};
|
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember 1.13',
dependencies: {
'ember': '1.13.8'
},
resolutions: {
'ember': '1.13.8'
}
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
]
};
|
Add 1.13 to the test matrix
|
Add 1.13 to the test matrix
|
JavaScript
|
mit
|
cibernox/ember-power-select,chrisgame/ember-power-select,cibernox/ember-power-select,cibernox/ember-power-select,Dremora/ember-power-select,chrisgame/ember-power-select,esbanarango/ember-power-select,cibernox/ember-power-select,esbanarango/ember-power-select,Dremora/ember-power-select,esbanarango/ember-power-select
|
38aa4dc763e6903cce4ee66c4cbdfdd104b05cd7
|
config/processes.js
|
config/processes.js
|
'use strict';
const config = {};
/**
* Heroku makes it available to help calculate correct concurrency
* @see https://devcenter.heroku.com/articles/node-concurrency#tuning-the-concurrency-level
*/
config.memoryAvailable = parseInt(process.env.MEMORY_AVAILABLE, 10);
/**
* Expected MAX memory footprint of a single concurrent process in Megabytes.
*
* NOTE: This value is the basis to calculate the Procfile server flag: --max_old_space_size=<size>
* The value in the Procfile is 90% of the estimated processMemory here.
* Based on a Heroku recommendation. @see https://blog.heroku.com/node-habits-2016#7-avoid-garbage
*/
config.processMemory = 200;
/**
* Calculate total amount of concurrent processes to fork
* based on available memory and estimated process memory footprint
*/
config.total = config.memoryAvailable ?
Math.floor(config.memoryAvailable / config.processMemory) : 1;
module.exports = config;
|
'use strict';
const config = {};
/**
* Heroku makes it available to help calculate correct concurrency
* @see https://devcenter.heroku.com/articles/node-concurrency#tuning-the-concurrency-level
*/
config.memoryAvailable = parseInt(process.env.MEMORY_AVAILABLE, 10);
/**
* Expected MAX memory footprint of a single concurrent process in Megabytes.
*
* NOTE: This value is the basis to calculate the Procfile server flag: --max_old_space_size=<size>
* The value in the Procfile is 90% of the estimated processMemory here.
* Based on a Heroku recommendation. @see https://blog.heroku.com/node-habits-2016#7-avoid-garbage
*/
config.processMemory = 170;
/**
* Calculate total amount of concurrent processes to fork
* based on available memory and estimated process memory footprint
*/
config.total = config.memoryAvailable ?
Math.floor(config.memoryAvailable / config.processMemory) : 1;
module.exports = config;
|
Load test 170 per process
|
Load test 170 per process
|
JavaScript
|
mit
|
DoSomething/gambit,DoSomething/gambit
|
405acc213c0861d4aab21a568c5419d4a48a2b57
|
test/testHelper.js
|
test/testHelper.js
|
require("babel/register")({
stage: 1,
ignore: /node_modules/
});
global.Promise = require('bluebird')
global.Promise.onPossiblyUnhandledRejection((e) => { throw e; });
global.Promise.config({
// Enable warnings.
warnings: false,
// Enable long stack traces.
longStackTraces: true,
// Enable cancellation.
cancellation: true
});
GLOBAL.$redis = require('../config/database')
, GLOBAL.$database = $redis.connect()
, GLOBAL.$should = require('chai').should()
|
require("babel/register")({
stage: 1,
ignore: /node_modules/
});
global.Promise = require('bluebird')
global.Promise.onPossiblyUnhandledRejection((e) => { throw e; });
global.Promise.config({
// Enable warnings.
warnings: false,
// Enable long stack traces.
longStackTraces: true,
// Enable cancellation.
cancellation: true
});
GLOBAL.$redis = require('../config/database')
, GLOBAL.$database = $redis.connect()
, GLOBAL.$should = require('chai').should()
, GLOBAL.$postgres = require('../config/postgres')
, GLOBAL.$pg_database = $postgres.connect()
|
Add postgres connection and knex to global test variables.
|
Add postgres connection and knex to global test variables.
|
JavaScript
|
mit
|
golozubov/freefeed-server,golozubov/freefeed-server,SiTLar/freefeed-server,FreeFeed/freefeed-server,FreeFeed/freefeed-server,SiTLar/freefeed-server
|
79865e36fa70a52d04f586b24da14a216b883432
|
test/media-test.js
|
test/media-test.js
|
/* Global Includes */
var testCase = require('mocha').describe;
var pre = require('mocha').before;
var preEach = require('mocha').beforeEach;
var post = require('mocha').after;
var postEach = require('mocha').afterEach;
var assertions = require('mocha').it;
var assert = require('chai').assert;
var validator = require('validator');
var exec = require('child_process').execSync;
var artik = require('../lib/artik-sdk');
/* Test Specific Includes */
var media = artik.media();
var sound_file = '/usr/share/sounds/alsa/Front_Center.wav';
/* Test Case Module */
testCase('Media', function() {
pre(function() {
});
testCase('#play_sound_file', function() {
assertions('Play the sound file', function() {
media.play_sound_file(sound_file, function(response, status) {
console.log('Finished playing');
});
});
});
post(function() {
});
});
|
/* Global Includes */
var testCase = require('mocha').describe;
var pre = require('mocha').before;
var preEach = require('mocha').beforeEach;
var post = require('mocha').after;
var postEach = require('mocha').afterEach;
var assertions = require('mocha').it;
var assert = require('chai').assert;
var validator = require('validator');
var exec = require('child_process').execSync;
var artik = require('../lib/artik-sdk');
/* Test Specific Includes */
var media = artik.media();
var sound_file = '/usr/share/sounds/alsa/Front_Center.wav';
var start, end;
/* Test Case Module */
testCase('Media', function() {
pre(function() {
});
testCase('#play_sound_file', function() {
this.timeout(5000);
start = new Date();
assertions('Play the sound file', function(done) {
media.play_sound_file(sound_file, function(response, status) {
end = new Date();
var timeOfPlay = (end.getTime() - start.getTime())/1000;
console.log('Finished playing. Seconds ' + timeOfPlay);
assert.isAtLeast(timeOfPlay, 1);
done();
});
});
});
post(function() {
});
});
|
Use time duration of test to measure the success
|
Media: Use time duration of test to measure the success
Signed-off-by: Vaibhav Singh <[email protected]>
|
JavaScript
|
mit
|
hoondol/artik-sdk,hoondol/artik-sdk
|
a16b17307bd5658f6ce9eaea4002e7860cea908b
|
webpack.config.js
|
webpack.config.js
|
// Copyright 2018 Google LLC
//
// 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
//
// <https://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.
const fs = require("fs");
const path = require("path");
module.exports = fs
.readdirSync("src")
.filter(filename => filename.endsWith(".js"))
.map(filename => ({
context: path.resolve("src"),
entry: `./${filename}`,
output: {
filename,
path: path.resolve("dist")
},
optimization: {
minimize: false
}
}));
|
// Copyright 2018 Google LLC
//
// 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
//
// <https://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.
const fs = require("fs");
const path = require("path");
const webpack = require("webpack");
module.exports = fs
.readdirSync("src")
.filter(filename => filename.endsWith(".js"))
.map(filename => ({
context: path.resolve("src"),
entry: `./${filename}`,
output: {
filename,
path: path.resolve("dist")
},
optimization: {
minimize: false
},
plugins: [
new webpack.BannerPlugin({
banner:
"// Required for JavaScript engine shells.\n" +
"if (typeof console === 'undefined') {\n" +
" console = {log: print};\n" +
"}",
raw: true
})
]
}));
|
Support older JavaScript engine shells.
|
Support older JavaScript engine shells.
|
JavaScript
|
apache-2.0
|
v8/promise-performance-tests
|
d251916fa362ce6064bbcef28eaa009294e2271a
|
app/components/summer-note.js
|
app/components/summer-note.js
|
/*
This is just a proxy file requiring the component from the /addon folder and
making it available to the dummy application!
*/
import SummerNoteComponent from 'ember-cli-bootstrap3-wysiwyg/components/bs-wysihtml5';
export default SummerNoteComponent;
|
/*
This is just a proxy file requiring the component from the /addon folder and
making it available to the dummy application!
*/
import SummerNoteComponent from 'ember-cli-summernote/components/summer-note';
export default SummerNoteComponent;
|
Fix the import path error.
|
Fix the import path error.
|
JavaScript
|
mit
|
Flightlogger/ember-cli-summernote,brett-anderson/ember-cli-summernote,vsymguysung/ember-cli-summernote,Flightlogger/ember-cli-summernote,wzowee/ember-cli-summernote,wzowee/ember-cli-summernote,emoryy/ember-cli-summernote,vsymguysung/ember-cli-summernote,emoryy/ember-cli-summernote,brett-anderson/ember-cli-summernote
|
9a521faa76fd26b762f7b45096d5dc8ec1608429
|
assets/js/vendor/sb-admin-2.js
|
assets/js/vendor/sb-admin-2.js
|
$(function() {
$('#side-menu').metisMenu();
});
//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
// Sets the min-height of #page-wrapper to window size
$(function() {
$(window).bind("load resize", function() {
topOffset = 50;
width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
if (width < 768) {
$('div.navbar-collapse').addClass('collapse');
topOffset = 100; // 2-row-menu
} else {
$('div.navbar-collapse').removeClass('collapse');
}
height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
height = height - topOffset;
if (height < 1) height = 1;
if (height > topOffset) {
$("#page-wrapper").css("min-height", (height) + "px");
}
});
var url = window.location;
var element = $('ul.nav a').filter(function() {
return this.href == url;
}).addClass('active').parent().parent().addClass('in').parent();
if (element.is('li')) {
element.addClass('active');
}
});
|
$(function() {
$('#side-menu').metisMenu();
});
//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
// Sets the min-height of #page-wrapper to window size
$(function() {
$(window).bind("load resize", function() {
topOffset = 50;
width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
if (width < 768) {
$('div.navbar-collapse').addClass('collapse');
topOffset = 100; // 2-row-menu
} else {
$('div.navbar-collapse').removeClass('collapse');
}
height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
height = height - topOffset;
if (height < 1) height = 1;
if (height > topOffset) {
$("#page-wrapper").css("min-height", (height) + "px");
}
});
var url = window.location;
var element = $('ul.nav a').filter(function() {
return this.href == url || url.href.indexOf(this.href) == 0;
}).addClass('active').parent().parent().addClass('in').parent();
if (element.is('li')) {
element.addClass('active');
}
});
|
Fix highlighting of menu points for sub-routes.
|
Fix highlighting of menu points for sub-routes.
|
JavaScript
|
mit
|
kumpelblase2/modlab,kumpelblase2/modlab
|
3ba0a0fd6bacacb7328fbab9ef335d7697ebb1cb
|
js/lowlight.js
|
js/lowlight.js
|
"use strict";
/*
NOT a general purpose escaper! Only valid when *content* of a tag, not within an attribute.
*/
function escape(code) {
return code
.replace("&", "&", "g")
.replace("<", "<", "g")
.replace(">", ">", "g");
}
function lowlight(lang, lexer, code) {
var ret = "";
var lex = lexer.CeylonLexer(lexer.StringCharacterStream(code));
var cur;
while ((cur = lex.nextToken()) != null) {
if (cur.type.string == "whitespace") {
/*
don’t put whitespace in a span –
this way, styles can use CSS selectors
based on the immediately previous node
without worrying about whitespace
*/
ret += cur.text;
} else {
ret += "<span class=\"";
for (var type in cur.type.__proto__.getT$all()) {
if (type === undefined) break;
ret += type.replace(/.*:/, "");
if (type == "ceylon.lexer.core::TokenType") break;
ret += " ";
}
ret += "\">";
ret += escape(cur.text);
ret += "</span>";
}
}
return ret;
}
|
"use strict";
/*
NOT a general purpose escaper! Only valid when *content* of a tag, not within an attribute.
*/
function escape(code) {
return code
.replace("&", "&", "g")
.replace("<", "<", "g")
.replace(">", ">", "g");
}
function lowlight(lang, lexer, code) {
var ret = "";
var lex = lexer.CeylonLexer(lexer.StringCharacterStream(code));
var cur;
while ((cur = lex.nextToken()) != null) {
if (cur.type.string == "whitespace") {
/*
don’t put whitespace in a span –
this way, styles can use CSS selectors
based on the immediately previous node
without worrying about whitespace
*/
ret += cur.text;
} else {
ret += "<span class=\"";
for (var type in cur.type.__proto__.getT$all()) {
if (type === undefined) break;
ret += type.replace(/.*:/, "");
if (type == "ceylon.lexer.core::TokenType") break;
ret += " ";
}
var escaped = escape(cur.text);
ret += "\" content=\"";
ret += escaped;
ret += "\">";
ret += escaped;
ret += "</span>";
}
}
return ret;
}
|
Add span content as content attribute
|
Add span content as content attribute
This allows styles to use it in CSS `.foo[content*=bar]` selectors.
|
JavaScript
|
apache-2.0
|
lucaswerkmeister/ColorTrompon,lucaswerkmeister/ColorTrompon
|
707e854d6213dd9580c22a08a7e694f3923c723d
|
src/url_handler.js
|
src/url_handler.js
|
import { flashURLHandler } from './urlhandlers/flash_url_handler';
import { nodeURLHandler } from './urlhandlers/mock_node_url_handler';
import { XHRURLHandler } from './urlhandlers/xhr_url_handler';
function get(url, options, cb) {
// Allow skip of the options param
if (!cb) {
if (typeof options === 'function') {
cb = options;
}
options = {};
}
if (options.urlhandler && options.urlhandler.supported()) {
// explicitly supply your own URLHandler object
return options.urlhandler.get(url, options, cb);
} else if (typeof window === 'undefined' || window === null) {
return nodeURLHandler.get(url, options, cb);
} else if (XHRURLHandler.supported()) {
return XHRURLHandler.get(url, options, cb);
} else if (flashURLHandler.supported()) {
return flashURLHandler.get(url, options, cb);
} else {
return cb(
new Error(
'Current context is not supported by any of the default URLHandlers. Please provide a custom URLHandler'
)
);
}
}
export const urlHandler = {
get
};
|
import { flashURLHandler } from './urlhandlers/flash_url_handler';
import { nodeURLHandler } from './urlhandlers/mock_node_url_handler';
import { XHRURLHandler } from './urlhandlers/xhr_url_handler';
function get(url, options, cb) {
// Allow skip of the options param
if (!cb) {
if (typeof options === 'function') {
cb = options;
}
options = {};
}
if (typeof window === 'undefined' || window === null) {
return nodeURLHandler.get(url, options, cb);
} else if (XHRURLHandler.supported()) {
return XHRURLHandler.get(url, options, cb);
} else if (flashURLHandler.supported()) {
return flashURLHandler.get(url, options, cb);
} else {
return cb(
new Error(
'Current context is not supported by any of the default URLHandlers. Please provide a custom URLHandler'
)
);
}
}
export const urlHandler = {
get
};
|
Remove useless check from default urlhandler
|
[util] Remove useless check from default urlhandler
|
JavaScript
|
mit
|
dailymotion/vast-client-js
|
f5078515f9eea811adb79def7748350c37306c0a
|
packages/react-hot-boilerplate/webpack.config.js
|
packages/react-hot-boilerplate/webpack.config.js
|
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./scripts/index'
],
output: {
path: __dirname + '/scripts/',
filename: 'bundle.js',
publicPath: '/scripts/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{ test: /\.jsx?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ }
]
}
};
|
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./scripts/index'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/scripts/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['react-hot', 'babel'],
include: path.join(__dirname, 'scripts')
}]
}
};
|
Use include over exclude so npm link works
|
Use include over exclude so npm link works
|
JavaScript
|
mit
|
gaearon/react-hot-loader,gaearon/react-hot-loader
|
fa03a474f29e26078d0a9cd8700eca18c3107e50
|
js/stopwatch.js
|
js/stopwatch.js
|
(function(stopwatch){
var Game = stopwatch.Game = function(seconds){
this.target = 1000 * seconds; // in milliseconds
};
Game.prototype.current = function(){
return 0;
};
};
var GameView = stopwatch.GameView = function(game, container){
this.game = game;
this.container = container;
this.update();
};
GameView.prototype.update = function(){
var target = this.container.querySelector('#target');
target.innerHTML = this.game.target;
var current = this.container.querySelector('#current');
current.innerHTML = this.game.current();
};
})(window.stopwatch = window.stopwatch || {});
|
(function(stopwatch){
var Game = stopwatch.Game = function(seconds){
this.target = 1000 * seconds; // in milliseconds
this.started = false;
this.stopped = false;
};
Game.prototype.current = function(){
if (this.started) {
return (this.stopped ? this.stopTime: this.time) - this.startTime;
}
return 0;
};
Game.prototype.start = function(){
if (!this.started) {
this.started = true;
this.startTime = new Date().getTime();
this.time = this.startTime;
}
};
Game.prototype.stop = function(){
if (!this.stopped) {
this.stopped = true;
this.stopTime = new Date().getTime();
}
};
var GameView = stopwatch.GameView = function(game, container){
this.game = game;
this.container = container;
this.update();
};
GameView.prototype.update = function(){
var target = this.container.querySelector('#target');
target.innerHTML = this.game.target;
var current = this.container.querySelector('#current');
current.innerHTML = this.game.current();
};
})(window.stopwatch = window.stopwatch || {});
|
Create a start and stop method
|
Create a start and stop method
|
JavaScript
|
mit
|
dvberkel/StopWatch,dvberkel/StopWatch
|
3c9cf063b0578c85362a81d76b5e84bb6faae9b2
|
const_and_let.js
|
const_and_let.js
|
#!/usr/bin/env node
const constMessage = "Hello, World!";
console.log(constMessage);
let letMessage = "Hello, World!";
console.log(letMessage);
letMessage = "Goodbye, World!";
console.log(letMessage);
|
#!/usr/bin/env node
const constMessage = "Hello, World!";
console.log(constMessage);
let letMessage = "Hello, World!";
console.log(letMessage);
letMessage = "Goodbye, World!";
console.log(letMessage);
const é = "Accented";
console.log(é);
const 学习 = "Learn";
console.log(学习);
// const ∃ = "There exists"; CRASH
// const 💹 = "Market"; CRASH
// const 😱 = "Eep!"; CRASH
|
Add weird variable names to let and const example
|
Add weird variable names to let and const example
|
JavaScript
|
apache-2.0
|
peopleware/js-training-node-scripting,peopleware/js-training-node-scripting
|
06f6f2ff1dc60897f707e8a482a8ff1084ae8f7a
|
src/components/user/repo/trashbin.repo.js
|
src/components/user/repo/trashbin.repo.js
|
const { model: trashbinModel } = require('./db/trashbin.schema');
const createUserTrashbin = (userId) => {
// access trashbin model
const trashbin = trashbinModel({
userId,
});
return trashbin.save();
};
const updateUserTrashbin = (userId, data = {}) => {
// access trashbin model
return trashbinModel.updateOne({ userId }, data, { upsert: true });
};
module.exports = {
createUserTrashbin,
updateUserTrashbin,
};
|
const { model: trashbinModel } = require('./db/trashbin.schema');
const createUserTrashbin = (userId) => {
// access trashbin model
const trashbin = trashbinModel({
userId,
});
return trashbin.save();
};
const updateUserTrashbin = async (id, data = {}) => {
// access trashbin model
const trashbin = await trashbinModel.findById(id).exec();
trashbin.set(data);
return trashbin.save();
};
module.exports = {
createUserTrashbin,
updateUserTrashbin,
};
|
Use Mongoose functions for updating
|
Use Mongoose functions for updating
|
JavaScript
|
agpl-3.0
|
schul-cloud/schulcloud-server,schul-cloud/schulcloud-server,schul-cloud/schulcloud-server
|
2f5b013afcc40bd90ba26aed33c9c5c142237016
|
packages/soya-next/src/pages/createBasePage.js
|
packages/soya-next/src/pages/createBasePage.js
|
import React from "react";
import { compose } from "react-apollo";
import hoistStatics from "hoist-non-react-statics";
import BaseProvider from "../components/BaseProvider";
import applyRedirect from "../router/applyRedirect";
import withCookies from "../cookies/withCookiesPage";
import withLocale from "../i18n/withLocalePage";
export default Page =>
compose(withLocale, applyRedirect, withCookies)(
hoistStatics(
props => (
<BaseProvider
cookies={props.cookies}
locale={props.locale}
defaultLocale={props.defaultLocale}
siteLocales={props.siteLocales}
>
<Page {...props} />
</BaseProvider>
),
Page
)
);
|
import React from "react";
import { compose } from "redux";
import hoistStatics from "hoist-non-react-statics";
import BaseProvider from "../components/BaseProvider";
import applyRedirect from "../router/applyRedirect";
import withCookies from "../cookies/withCookiesPage";
import withLocale from "../i18n/withLocalePage";
export default Page =>
compose(withLocale, applyRedirect, withCookies)(
hoistStatics(
props => (
<BaseProvider
cookies={props.cookies}
locale={props.locale}
defaultLocale={props.defaultLocale}
siteLocales={props.siteLocales}
>
<Page {...props} />
</BaseProvider>
),
Page
)
);
|
Replace react-apollo with redux compose
|
Replace react-apollo with redux compose
|
JavaScript
|
mit
|
traveloka/soya-next
|
015f85622b33df01971ffc784f0f7594da30c889
|
app/controllers/name.controller.js
|
app/controllers/name.controller.js
|
'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
return $state.go('home', {room: room})
}
alert('Please name your band')
return false
}
});
|
'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
return $state.go('home', {room: room.toLowerCase()})
}
alert('Please name your band');
return false
}
});
|
Make room name lower case
|
Make room name lower case
|
JavaScript
|
mit
|
HouseBand/client,HouseBand/client
|
55e138a77becada80430cc7795bbb6bd23a66843
|
lib/index.js
|
lib/index.js
|
'use strict';
module.exports = (...trackers) => {
const tracker = {};
tracker.createEvent = (eventName, eventData) => {
trackers.forEach((tk) => {
tk.createEvent(eventName, eventData);
});
return tracker;
};
return tracker;
};
|
'use strict';
module.exports = function eventTracker() {
const tracker = {};
const trackers = Array.prototype.slice.call(arguments);
tracker.createEvent = (eventName, eventData) => {
trackers.forEach((tk) => {
tk.createEvent(eventName, eventData);
});
return tracker;
};
return tracker;
};
|
Remove destructuring and add arguments
|
Remove destructuring and add arguments
|
JavaScript
|
mit
|
ZimpFidelidade/universal-event-tracker
|
9f8fa2f067e7b91cac796268dbabacdce5a3fc6c
|
test/boost-field-test.js
|
test/boost-field-test.js
|
var mongoose = require('mongoose')
, elastical = require('elastical')
, esClient = new(require('elastical').Client)
, should = require('should')
, config = require('./config')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId
, mongoosastic = require('../lib/mongoosastic');
var TweetSchema = new Schema({
user: String
, post_date: {type:Date, es_type:'date'}
, message: {type:String}
, title: {type:String, es_boost:2.0}
});
TweetSchema.plugin(mongoosastic);
var BlogPost = mongoose.model('BlogPost', TweetSchema);
describe('Add Boost Option Per Field', function(){
before(function(done){
mongoose.connect(config.mongoUrl, function(){
BlogPost.remove(function(){
config.deleteIndexIfExists(['blogposts'], done)
});
});
});
it('should create a mapping with boost field added', function(done){
BlogPost.createMapping(function(err, mapping){
esClient.getMapping('blogposts', 'blogpost', function(err, mapping){
var props = mapping.blogposts.mappings.blogpost.properties;
props.title.type.should.eql('string');
props.title.boost.should.eql(2.0);
done();
});
});
});
});
|
var mongoose = require('mongoose')
, elastical = require('elastical')
, esClient = new(require('elastical').Client)
, should = require('should')
, config = require('./config')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId
, mongoosastic = require('../lib/mongoosastic');
var TweetSchema = new Schema({
user: String
, post_date: {type:Date, es_type:'date'}
, message: {type:String}
, title: {type:String, es_boost:2.0}
});
TweetSchema.plugin(mongoosastic);
var BlogPost = mongoose.model('BlogPost', TweetSchema);
describe('Add Boost Option Per Field', function(){
before(function(done){
mongoose.connect(config.mongoUrl, function(){
BlogPost.remove(function(){
config.deleteIndexIfExists(['blogposts'], done)
});
});
});
it('should create a mapping with boost field added', function(done){
BlogPost.createMapping(function(err, mapping){
esClient.getMapping('blogposts', 'blogpost', function(err, mapping){
/* elasticsearch 1.0 & 0.9 support */
var props =
mapping.blogpost != undefined ?
mapping.blogpost.properties: /* ES 0.9.11 */
mapping.blogposts.mappings.blogpost.properties; /* ES 1.0.0 */
props.title.type.should.eql('string');
props.title.boost.should.eql(2.0);
done();
});
});
});
});
|
Correct boost test field (support ES 0.9 and 1.0).
|
Correct boost test field (support ES 0.9 and 1.0).
In my tests, the mapping format returned by the getMapping function is
not the same between 0.90.11 and 1.0
|
JavaScript
|
mit
|
mongoosastic/mongoosastic,teambition/mongoosastic,ennosol/mongoosastic,francesconero/mongoosastic,ennosol/mongoosastic,guumaster/mongoosastic,francesconero/mongoosastic,mongoosastic/mongoosastic,avastms/mongoosastic,guumaster/mongoosastic,teambition/mongoosastic,mallzee/mongoosastic,guumaster/mongoosastic,mallzee/mongoosastic,hdngr/mongoosastic,mallzee/mongoosastic,hdngr/mongoosastic,hdngr/mongoosastic,avastms/mongoosastic,mongoosastic/mongoosastic
|
1569457c708195ea017fb047beab7ade7ed918ab
|
common/components/constants/ProjectConstants.js
|
common/components/constants/ProjectConstants.js
|
export const Locations = {
OTHER: "Other",
PRESET_LOCATIONS: [
"Seattle, WA",
"Redmond, WA",
"Kirkland, WA",
"Bellevue, WA",
"Tacoma, WA",
"Olympia, WA",
"Bay Area, CA",
"Baltimore, MD",
"Other"
]
};
|
export const Locations = {
OTHER: "Other",
PRESET_LOCATIONS: [
"Seattle, WA",
"Redmond, WA",
"Kirkland, WA",
"Bellevue, WA",
"Tacoma, WA",
"Olympia, WA",
"Portland, OR",
"Bay Area, CA",
"Baltimore, MD",
"Other"
]
};
|
Add Portland, OR to location list
|
Add Portland, OR to location list
|
JavaScript
|
mit
|
DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange
|
38eb816b54300fec9ccf2ed3978f0dc66624981a
|
lib/index.js
|
lib/index.js
|
module.exports = {
'Unit': require('./unit'),
'Lexer': require('./lexer'),
};
|
module.exports = {
// Objects
'Unit': require('./unit'),
'Lexer': require('./lexer'),
// Methods
'math': require('./math'),
};
|
Add math & clean up.
|
Add math & clean up.
|
JavaScript
|
mit
|
jamen/craze
|
51ca67b91d6256ce48171b912e649a08ec7638c1
|
cosmoz-bottom-bar-view.js
|
cosmoz-bottom-bar-view.js
|
/*global Polymer, Cosmoz*/
(function () {
'use strict';
Polymer({
is: 'cosmoz-bottom-bar-view',
behaviors: [
Cosmoz.ViewInfoBehavior,
Polymer.IronResizableBehavior
],
properties: {
overflowing: {
type: Boolean,
value: false,
reflectToAttribute: true
},
scroller: {
type: Object
}
},
listeners: {
'iron-resize': '_onResize'
},
attached: function () {
this.scroller = this.$.scroller;
},
_onResize: function () {
var scrollerSizer = this.$.scrollerSizer;
// HACK(pasleq): ensure scrollerSizer is sized correctly.
scrollerSizer.style.minHeight = '';
this.async(function () {
if (scrollerSizer.scrollHeight > scrollerSizer.offsetHeight) {
scrollerSizer.style.minHeight = scrollerSizer.scrollHeight + 'px';
}
});
},
_getPadding: function (desktop) {
// if (desktop) {
// return;
// }
return 'padding-bottom: ' + this.$.bar.barHeight + 'px';
},
_getBarHeight: function (desktop) {
return 'min-height: ' + this.$.bar.barHeight + 'px';
}
});
}());
|
/*global Polymer, Cosmoz*/
(function () {
'use strict';
Polymer({
is: 'cosmoz-bottom-bar-view',
behaviors: [
Cosmoz.ViewInfoBehavior,
Polymer.IronResizableBehavior
],
properties: {
overflowing: {
type: Boolean,
value: false,
reflectToAttribute: true
},
scroller: {
type: Object
}
},
listeners: {
'iron-resize': '_onResize'
},
attached: function () {
this.scroller = this.$.scroller;
},
_onResize: function () {
var scrollerSizer = this.$.scrollerSizer;
// HACK(pasleq): ensure scrollerSizer is sized correctly.
scrollerSizer.style.minHeight = '';
this.async(function () {
if (scrollerSizer.scrollHeight > scrollerSizer.offsetHeight) {
scrollerSizer.style.minHeight = scrollerSizer.scrollHeight + 'px';
}
});
},
_getPadding: function (desktop) {
// if (desktop) {
// return;
// }
return 'padding-bottom: ' + this.$.bar.barHeight + 'px';
},
_getBarHeight: function (desktop) {
var height = this.$.bar.barHeight;
return [
'max-height: ' + height + 'px',
'min-height: ' + height + 'px'
].join(';');
}
});
}());
|
Fix bug where the placeholder would flex out
|
Fix bug where the placeholder would flex out
Might be related to shady DOM or <slot> hybrid mode.
|
JavaScript
|
apache-2.0
|
Neovici/cosmoz-bottom-bar,Neovici/cosmoz-bottom-bar
|
aea77bd5b10e00005b0df08bd59ac427e19c4f89
|
karma.conf.js
|
karma.conf.js
|
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'app/**/*_test.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome', 'PhantomJS', 'Safari', 'Firefox'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
});
};
|
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'app/**/*_test.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
});
};
|
Use Phantom JS alone for speed and ease.
|
Use Phantom JS alone for speed and ease.
|
JavaScript
|
mit
|
blinkboxbooks/marvin-frontend.js
|
d1c78416c722a0cf8e1107c8b3a640129f19197a
|
js/lib/get-absolute-url.js
|
js/lib/get-absolute-url.js
|
export function getAbsoluteUrl({ path, getSassFileGlobPattern, glob }, url, includePaths = []) {
const { dir, base } = path.parse(url);
const baseGlobPattern = getSassFileGlobPattern(base);
includePaths.some((includePath) => {
glob.sync(path.resolve(includePath, dir, baseGlobPattern));
return false;
});
}
export default function getAbsoluteUrlFactory() {
return getAbsoluteUrl.bind(null);
}
|
import globModule from 'glob';
import pathModule from 'path';
import getSassFileGlobPatternModule from './get-sass-file-glob-pattern';
export function getAbsoluteUrl({ path, getSassFileGlobPattern, glob }, url, includePaths = []) {
const { dir, base } = path.parse(url);
const baseGlobPattern = getSassFileGlobPattern(base);
includePaths.some((includePath) => {
glob.sync(path.resolve(includePath, dir, baseGlobPattern));
return false;
});
}
export default getAbsoluteUrl.bind(null, {
path: pathModule,
getSassFileGlobPattern: getSassFileGlobPatternModule,
glob: globModule,
});
|
Implement the simplified testable module pattern.
|
Implement the simplified testable module pattern.
Read more about the pattern here: https://markus.oberlehner.net/blog/2017/02/the-testable-module-pattern/
|
JavaScript
|
mit
|
maoberlehner/node-sass-magic-importer,maoberlehner/node-sass-magic-importer,maoberlehner/node-sass-magic-importer
|
72b517762e82d421e989f5c30b30c8f7ce18f013
|
test/test.js
|
test/test.js
|
'use strict';
var grunt = require('grunt');
/**
* Constructs a test case.
*
* @param {string} file The `package.json` file to be tested.
* @param {boolean} valid Flag indicating whether the test is
* expected to pass.
* @param {Array} [args] Additional arguments to pass to `grunt`.
* @return {function(Object)} Testing function for `nodeunit`.
*/
function test(file, valid, args) {
return function(test) {
test.expect(2);
grunt.util.spawn({
grunt: true,
args: [
'--gruntfile', 'test/Gruntfile.js',
'--pkgFile', file
].concat(args || []).concat('npm-validate')
}, function(error, result, code) {
if (valid) {
test.equal(error, null);
test.equal(code, 0);
} else {
test.notEqual(error, null);
test.notEqual(code, 0);
}
test.done();
});
};
}
module.exports = {
empty: test('fixtures/empty.json', false),
force: test('fixtures/empty.json', true, ['--force', true]),
minimal: test('fixtures/minimal.json', true),
package: test('../package.json', true),
strict: test('fixtures/minimal.json', false, ['--strict', true])
};
|
'use strict';
var grunt = require('grunt');
/**
* Constructs a test case.
*
* @param {string} file The `package.json` file to be tested.
* @param {boolean} valid Flag indicating whether the test is
* expected to pass.
* @param {Array} [args] Additional arguments to pass to `grunt`.
* @return {function(Object)} Testing function for `nodeunit`.
*/
function test(file, valid, args) {
return function(test) {
test.expect(2);
grunt.util.spawn({
grunt: true,
args: [
'--gruntfile', 'test/Gruntfile.js',
'--pkgFile', file
].concat(args || []).concat('npm-validate')
}, function(error, result, code) {
if (valid) {
test.ifError(error);
test.equal(code, 0);
} else {
test.notEqual(error, null);
test.notEqual(code, 0);
}
test.done();
});
};
}
module.exports = {
empty: test('fixtures/empty.json', false),
force: test('fixtures/empty.json', true, ['--force', true]),
minimal: test('fixtures/minimal.json', true),
package: test('../package.json', true),
strict: test('fixtures/minimal.json', false, ['--strict', true])
};
|
Use `ifError` assertion instead of `equal`.
|
Use `ifError` assertion instead of `equal`.
|
JavaScript
|
mit
|
joshuaspence/grunt-npm-validate
|
dda90c0bcf7f32e70d9143327bd8e0d91e5a6f00
|
lib/index.js
|
lib/index.js
|
/**
* dubdrop compatible task for reading an image file and creating a thumbnail.
*
* @package thumbdrop
* @author drk <[email protected]>
*/
// readAsDataURL
/**
* Constructor
*/
function createThumbdrop (_callback) {
return function thumbdrop (file, callback) {
var reader = new FileReader();
reader.onload = function (e) {
var $img = document.createElement('img');
$img.setAttribute('src', e.target.result);
callback(null, file);
_callback(null, $img)
};
reader.readAsDataURL(file);
};
};
/**
* Export
*/
module.exports = createThumbdrop;
|
/**
* dubdrop compatible task for reading an image file and creating a thumbnail.
*
* @package thumbdrop
* @author drk <[email protected]>
*/
// readAsDataURL
/**
* Constructor
*/
function createThumbdrop (callback) {
return function thumbdrop (file) {
var reader = new FileReader();
reader.onload = function (e) {
var $img = document.createElement('img');
$img.setAttribute('src', e.target.result);
callback(null, $img)
};
reader.readAsDataURL(file);
};
};
/**
* Export
*/
module.exports = createThumbdrop;
|
Remove async handling to comply w/ dubdrop 0.0.3
|
Remove async handling to comply w/ dubdrop 0.0.3
|
JavaScript
|
mit
|
derekr/thumbdrop
|
eaef0b0012eacbb4994345fd0f45e6e54e58e583
|
lib/index.js
|
lib/index.js
|
'use strict'
let consistentEnv
module.exports = function() {
if (!consistentEnv) {
consistentEnv = require('consistent-env')
}
return consistentEnv().PATH || ''
}
module.exports.async = function() {
if (!consistentEnv) {
consistentEnv = require('consistent-env')
}
return consistentEnv.async().then(function(env) {
return env.PATH || ''
})
}
|
'use strict'
let consistentEnv
module.exports = function() {
if (process.platform === 'win32') {
return process.env.PATH || process.env.Path
}
if (!consistentEnv) {
consistentEnv = require('consistent-env')
}
return consistentEnv().PATH || ''
}
module.exports.async = function() {
if (process.platform === 'win32') {
return Promise.resolve(process.env.PATH || process.env.Path)
}
if (!consistentEnv) {
consistentEnv = require('consistent-env')
}
return consistentEnv.async().then(function(env) {
return env.PATH || ''
})
}
|
Handle different names of PATH on windows
|
:bug: Handle different names of PATH on windows
|
JavaScript
|
mit
|
steelbrain/consistent-path
|
51ffd24a0035fe03157ad34e4a0c014e2a4fda04
|
lib/index.js
|
lib/index.js
|
'use strict';
var rump = module.exports = require('rump');
var configs = require('./configs');
var originalAddGulpTasks = rump.addGulpTasks;
rump.addGulpTasks = function(options) {
originalAddGulpTasks(options);
require('./gulp');
return rump;
};
rump.on('update:main', function() {
configs.rebuild();
rump.emit('update:less');
});
Object.defineProperty(rump.configs, 'less', {
get: function() {
return configs.less;
}
});
|
'use strict';
var rump = module.exports = require('rump');
var configs = require('./configs');
var originalAddGulpTasks = rump.addGulpTasks;
// TODO remove on next major core update
rump.addGulpTasks = function(options) {
originalAddGulpTasks(options);
require('./gulp');
return rump;
};
rump.on('update:main', function() {
configs.rebuild();
rump.emit('update:less');
});
rump.on('gulp:main', function(options) {
require('./gulp');
rump.emit('gulp:less', options);
});
Object.defineProperty(rump.configs, 'less', {
get: function() {
return configs.less;
}
});
|
Handle future event emit for gulp tasks
|
Handle future event emit for gulp tasks
|
JavaScript
|
mit
|
rumps/rump-less
|
3e96edbd86dc6f233d34edfcf3d57de693a202ac
|
lib/index.js
|
lib/index.js
|
var mongoose = require('mongoose');
var ShortId = require('./shortid');
var defaultSave = mongoose.Model.prototype.save;
mongoose.Model.prototype.save = function(cb) {
for (fieldName in this.schema.tree) {
if (this.isNew && this[fieldName] === undefined) {
var idType = this.schema.tree[fieldName];
if (idType === ShortId || idType.type === ShortId) {
var idInfo = this.schema.path(fieldName);
var retries = idInfo.retries;
var self = this;
function attemptSave() {
idInfo.generator(idInfo.generatorOptions, function(err, id) {
if (err) {
cb(err);
return;
}
self[fieldName] = id;
defaultSave.call(self, function(err, obj) {
if (err &&
err.code == 11000 &&
err.err.indexOf(fieldName) !== -1 &&
retries > 0
) {
--retries;
attemptSave();
} else {
// TODO check these args
cb(err, obj);
}
});
});
}
attemptSave();
return;
}
}
}
defaultSave.call(this, cb);
};
module.exports = exports = ShortId;
|
var mongoose = require('mongoose');
var ShortId = require('./shortid');
var defaultSave = mongoose.Model.prototype.save;
mongoose.Model.prototype.save = function(cb) {
for (key in this.schema.tree) {
var fieldName = key
if (this.isNew && this[fieldName] === undefined) {
var idType = this.schema.tree[fieldName];
if (idType === ShortId || idType.type === ShortId) {
var idInfo = this.schema.path(fieldName);
var retries = idInfo.retries;
var self = this;
function attemptSave() {
idInfo.generator(idInfo.generatorOptions, function(err, id) {
if (err) {
cb(err);
return;
}
self[fieldName] = id;
defaultSave.call(self, function(err, obj) {
if (err &&
err.code == 11000 &&
err.err.indexOf(fieldName) !== -1 &&
retries > 0
) {
--retries;
attemptSave();
} else {
// TODO check these args
cb(err, obj);
}
});
});
}
attemptSave();
return;
}
}
}
defaultSave.call(this, cb);
};
module.exports = exports = ShortId;
|
Create a variable in scope to avoid being override
|
Create a variable in scope to avoid being override
|
JavaScript
|
mit
|
jjwchoy/mongoose-shortid,dashersw/mongoose-shortid,jouke/mongoose-shortid,hoist/mongoose-shortid
|
43fbb8eddf92a3e6b0fd7125b8e91537f6d21445
|
lib/index.js
|
lib/index.js
|
var createJob = require('./createJob');
module.exports = function (sails) {
return {
jobs: {},
defaults: {cron: {}},
initialize: function (cb) {
var config = sails.config.cron;
var tasks = Object.keys(config);
tasks.forEach(function (time) {
this.jobs[time] = createJob({
cronTime: time,
onTick: config[time] instanceof Function ? config[time] : config[time].onTick,
onComplete: config[time].onComplete,
start: typeof config[time].start === 'boolean' ? config[time].start : true,
timezone: config[time].timezone,
context: config[time].context
});
}.bind(this));
cb();
}
};
};
|
var createJob = require('./createJob');
module.exports = function (sails) {
return {
jobs: {},
defaults: {cron: {}},
initialize: function (cb) {
var config = sails.config.cron;
var tasks = Object.keys(config);
tasks.forEach(function (name) {
this.jobs[name] = createJob({
cronTime: config[name].schedule,
onTick: config[name].onTick,
onComplete: config[name].onComplete,
start: typeof config[name].start === 'boolean' ? config[name].start : true,
timezone: config[name].timezone,
context: config[name].context
});
}.bind(this));
cb();
}
};
};
|
Replace schedule as a key with named job
|
Replace schedule as a key with named job
|
JavaScript
|
mit
|
ghaiklor/sails-hook-cron
|
5056f8a50db6d6d17d1b29428fdc90f3abe92a1e
|
karma.conf.js
|
karma.conf.js
|
module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'browserify'],
files: [
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['browserify']
},
browsers: ['PhantomJS'],
browserify: {
debug: true
}
});
};
|
module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'browserify'],
files: [
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['browserify']
},
browsers: ['PhantomJS'],
browserify: {
debug: true
},
singleRun: true
});
};
|
Update karma, it will run once with npm test
|
Update karma, it will run once with npm test
|
JavaScript
|
mit
|
vudduu/key-enum
|
98add101bfda0dd235f2675cfd9ffff04e56b9ba
|
test/acceptance/global.nightwatch.js
|
test/acceptance/global.nightwatch.js
|
module.exports = {
waitForConditionPollInterval: 1000,
waitForConditionTimeout: 6000,
pauseDuration: 5000,
retryAssertionTimeout: 2500,
}
|
module.exports = {
waitForConditionPollInterval: 2000,
waitForConditionTimeout: 12000,
pauseDuration: 7500,
retryAssertionTimeout: 5000,
}
|
Increase timeouts to improve test runs
|
Increase timeouts to improve test runs
Attempts to address issue with a high perecentage
of acceptance test runs failing.
|
JavaScript
|
mit
|
uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2
|
ba17d882e72582d5396fa3a3dfb6292656f63b30
|
lib/index.js
|
lib/index.js
|
'use strict';
// VARIABLES //
var FLOAT32_VIEW = new Float32Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT32_VIEW.buffer );
// 0 11111111 00000000000000000000000 => 2139095040 => 0x7f800000
var PINF = 0x7f800000;
// Set the ArrayBuffer bit sequence:
UINT32_VIEW[ 0 ] = PINF;
// EXPORTS //
module.exports = FLOAT32_VIEW[ 0 ];
|
'use strict';
// VARIABLES //
var FLOAT32_VIEW = new Float32Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT32_VIEW.buffer );
// 0 11111111 00000000000000000000000 => 2139095040 => 0x7f800000 (see IEEE 754-2008)
var PINF = 0x7f800000;
// Set the ArrayBuffer bit sequence:
UINT32_VIEW[ 0 ] = PINF;
// EXPORTS //
module.exports = FLOAT32_VIEW[ 0 ];
|
Add code comment re: IEEE 754-2008
|
Add code comment re: IEEE 754-2008
|
JavaScript
|
mit
|
const-io/pinf-float32
|
edca7f5559e256606c7bc4ece9ffcf1f845c8ee7
|
src/c/big-input-card.js
|
src/c/big-input-card.js
|
import m from 'mithril';
const bigInputCard = {
view(ctrl, args) {
const cardClass = '.w-row.u-marginbottom-30.card.card-terciary.padding-redactor-description.text.optional.project_about_html.field_with_hint';
return m(cardClass, [
m('div', [
m('label.field-label.fontweight-semibold.fontsize-base', args.label),
(args.label_hint ? m('label.hint.fontsize-smallest.fontcolor-secondary', args.label_hint) : '')
]),
m('div', args.children)
]);
}
}
export default bigInputCard;
|
import m from 'mithril';
const bigInputCard = {
view(ctrl, args) {
const cardClass = args.cardClass || '.w-row.u-marginbottom-30.card.card-terciary.padding-redactor-description.text.optional.project_about_html.field_with_hint';
return m(cardClass, {style: (args.cardStyle||{})}, [
m('div', [
m('label.field-label.fontweight-semibold.fontsize-base', args.label),
(args.label_hint ? m('label.hint.fontsize-smallest.fontcolor-secondary', args.label_hint) : '')
]),
m('div', args.children)
]);
}
}
export default bigInputCard;
|
Adjust bigInputCard to receive a cardStyle and cardClass args
|
Adjust bigInputCard to receive a cardStyle and cardClass args
|
JavaScript
|
mit
|
catarse/catarse_admin,vicnicius/catarse_admin,vicnicius/catarse.js,mikesmayer/cs2.js,catarse/catarse.js,sushant12/catarse.js
|
8cdbc23c71c69d628b9f034c11727423c218cf87
|
db/migrations/20131216232955-external-transactions.js
|
db/migrations/20131216232955-external-transactions.js
|
var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('bank_transactions', {
id: { type: 'int', primaryKey: true, autoIncrement: true },
deposit: { type: 'boolean', notNull: true },
currency: { type: 'string', notNull: true },
cashAmount: { type: 'decimal', notNull: true },
accountId: { type: 'int', notNull: true },
rippleTxId: { type: 'int'},
createdAt: { type: 'datetime', notNull: true },
updatedAt: { type: 'datetime' }
}, callback);
};
exports.down = function(db, callback) {
db.dropTable('bank_transactions', callback);
};
|
var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.createTable('external_transactions', {
id: { type: 'int', primaryKey: true, autoIncrement: true },
deposit: { type: 'boolean', notNull: true },
currency: { type: 'string', notNull: true },
cashAmount: { type: 'decimal', notNull: true },
externalAccountId: { type: 'int', notNull: true },
rippleTxId: { type: 'int'},
createdAt: { type: 'datetime', notNull: true },
updatedAt: { type: 'datetime' }
}, callback);
};
exports.down = function(db, callback) {
db.dropTable('bank_transactions', callback);
};
|
Change accountId to externalAccountId in external transactions migration
|
[FEATURE] Change accountId to externalAccountId in external transactions migration
|
JavaScript
|
isc
|
whotooktwarden/gatewayd,zealord/gatewayd,xdv/gatewayd,Parkjeahwan/awegeeks,Parkjeahwan/awegeeks,crazyquark/gatewayd,whotooktwarden/gatewayd,xdv/gatewayd,crazyquark/gatewayd,zealord/gatewayd
|
04182efe223fb18e3678615c024ed3ecd806afb9
|
packages/nova-core/lib/containers/withMutation.js
|
packages/nova-core/lib/containers/withMutation.js
|
/*
HoC that provides a simple mutation that expects a single JSON object in return
Example usage:
export default withMutation({
name: 'getEmbedlyData',
args: {url: 'String'},
})(EmbedlyURL);
*/
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
export default function withMutation({name, args}) {
const args1 = _.map(args, (type, name) => `$${name}: ${type}`); // e.g. $url: String
const args2 = _.map(args, (type, name) => `${name}: $${name}`); // e.g. $url: url
return graphql(gql`
mutation ${name}(${args1}) {
${name}(${args2})
}
`, {
props: ({ownProps, mutate}) => ({
[name]: (vars) => {
return mutate({
variables: vars,
});
}
}),
});
}
|
/*
HoC that provides a simple mutation that expects a single JSON object in return
Example usage:
export default withMutation({
name: 'getEmbedlyData',
args: {url: 'String'},
})(EmbedlyURL);
*/
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
export default function withMutation({name, args}) {
let mutation;
if (args) {
const args1 = _.map(args, (type, name) => `$${name}: ${type}`); // e.g. $url: String
const args2 = _.map(args, (type, name) => `${name}: $${name}`); // e.g. $url: url
mutation = `
mutation ${name}(${args1}) {
${name}(${args2})
}
`
} else {
mutation = `
mutation ${name} {
${name}
}
`
}
return graphql(gql`${mutation}`, {
props: ({ownProps, mutate}) => ({
[name]: (vars) => {
return mutate({
variables: vars,
});
}
}),
});
}
|
Make mutation hoc accept mutations without arguments
|
Make mutation hoc accept mutations without arguments
|
JavaScript
|
mit
|
manriquef/Vulcan,SachaG/Zensroom,SachaG/Gamba,bshenk/projectIterate,manriquef/Vulcan,rtluu/immersive,HelloMeets/HelloMakers,dominictracey/Telescope,bshenk/projectIterate,Discordius/Telescope,acidsound/Telescope,dominictracey/Telescope,SachaG/Gamba,VulcanJS/Vulcan,Discordius/Lesswrong2,acidsound/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,JstnEdr/Telescope,JstnEdr/Telescope,TodoTemplates/Telescope,HelloMeets/HelloMakers,VulcanJS/Vulcan,dominictracey/Telescope,TodoTemplates/Telescope,manriquef/Vulcan,SachaG/Gamba,acidsound/Telescope,Discordius/Telescope,rtluu/immersive,rtluu/immersive,SachaG/Zensroom,SachaG/Zensroom,HelloMeets/HelloMakers,TodoTemplates/Telescope,bshenk/projectIterate,bengott/Telescope,Discordius/Lesswrong2,Discordius/Telescope,bengott/Telescope,JstnEdr/Telescope,bengott/Telescope
|
23737870dcc77538cf7a094d4f5521c8580f965b
|
lib/models/UserInstance.js
|
lib/models/UserInstance.js
|
/* WePay API for Node.js
* (c)2012 Matt Farmer
* Release without warranty under the terms of the
* Apache License. For more details, see the LICENSE
* file at the root of this project.
*/
var UserInstance = function(params) {
//TODO
}
module.exports = UserInstance;
|
/* WePay API for Node.js
* (c)2012 Matt Farmer
* Release without warranty under the terms of the
* Apache License. For more details, see the LICENSE
* file at the root of this project.
*/
var UserInstance = function(params) {
// Populate any params passed in.
if (params && ! params instanceof Object)
throw "Parameters passed to an instance constructor must be an object or undefined.";
if (params){
for (key in params) {
this[key] = params[key];
}
}
}
module.exports = UserInstance;
|
Implement the User instance constructor.
|
Implement the User instance constructor.
|
JavaScript
|
apache-2.0
|
farmdawgnation/wepay-api-node
|
b27452b32f6be2bb6544833b422b60a9f1d00e0c
|
generators/app/templates/gulp_tasks/systemjs.js
|
generators/app/templates/gulp_tasks/systemjs.js
|
const gulp = require('gulp');
const replace = require('gulp-replace');
const Builder = require('jspm').Builder;
const conf = require('../conf/gulp.conf');
gulp.task('systemjs', systemjs);
gulp.task('systemjs:html', updateIndexHtml);
function systemjs(done) {
const builder = new Builder('./', 'jspm.config.js');
builder.config({
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
packageConfigPaths: [
'npm:@*/*.json',
'npm:*.json',
'github:*/*.json'
]
});
builder.buildStatic(
<%- entry %>,
conf.path.tmp('index.js')
).then(() => done(), done);
}
function updateIndexHtml() {
return gulp.src(conf.path.src('index.html'))
.pipe(replace(
/<script>\n\s*System.import.*\n\s*<\/script>/,
`<script src="index.js"></script>`
))
.pipe(gulp.dest(conf.path.tmp()));
}
|
const gulp = require('gulp');
const replace = require('gulp-replace');
const Builder = require('jspm').Builder;
const conf = require('../conf/gulp.conf');
gulp.task('systemjs', systemjs);
gulp.task('systemjs:html', updateIndexHtml);
function systemjs(done) {
const builder = new Builder('./', 'jspm.config.js');
builder.config({
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
packageConfigPaths: [
'npm:@*/*.json',
'npm:*.json',
'github:*/*.json'
]
});
builder.buildStatic(
<%- entry %>,
conf.path.tmp('index.js')
).then(() => done(), done);
}
function updateIndexHtml() {
return gulp.src(conf.path.src('index.html'))
.pipe(replace(
/<script src="jspm_packages\/system.js">[\s\S]*System.import.*\n\s*<\/script>/,
`<script src="index.js"></script>`
))
.pipe(gulp.dest(conf.path.tmp()));
}
|
Remove jspm scripts on build
|
Remove jspm scripts on build
|
JavaScript
|
mit
|
FountainJS/generator-fountain-systemjs,FountainJS/generator-fountain-systemjs
|
827eb5533a6e7f967a40f82871647902dc6b833b
|
karma.conf.js
|
karma.conf.js
|
const base = require('skatejs-build/karma.conf');
module.exports = function (config) {
base(config);
// Remove all explicit IE definitions.
config.browsers = config.browsers.filter(name => !/^internet_explorer/.test(name));
// Only test IE latest.
config.browsers.push('internet_explorer_11');
// Shims for testing.
config.files = [
'node_modules/es6-shim/es6-shim.js'
].concat(config.files);
// Ensure mobile browsers have enough time to run.
config.browserNoActivityTimeout = 60000;
};
|
const base = require('skatejs-build/karma.conf');
module.exports = function (config) {
base(config);
// Setup IE if testing in SauceLabs.
if (config.sauceLabs) {
// Remove all explicit IE definitions.
config.browsers = config.browsers.filter(name => !/^internet_explorer/.test(name));
// Only test IE latest.
config.browsers.push('internet_explorer_11');
}
// Shims for testing.
config.files = [
'node_modules/es6-shim/es6-shim.js',
].concat(config.files);
// Ensure mobile browsers have enough time to run.
config.browserNoActivityTimeout = 60000;
};
|
Fix tests so that it only tries to run IE11 if running in Sauce Labs.
|
chore(test): Fix tests so that it only tries to run IE11 if running in Sauce Labs.
For some reason it just started happening that it would try to run IE11 outside of Sauce Labs.
|
JavaScript
|
mit
|
chrisdarroch/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs,skatejs/skatejs
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.