This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ExampleAPIHandler(downChainResponse, otherdata, next) { | |
var promiseArray = []; | |
var respJSON = { | |
body: {}, | |
success: true, | |
warnings: [], | |
errors: [] | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Access Token model in loopback doesn't support Promises out-the-box, and it won't work with Bluebird Promisify | |
*/ | |
util.tokenValidateAsync = function(token) { | |
return new Promise(function(resolve, reject) { | |
token.validate(function(err, isValid){ | |
if (!err) { | |
resolve(isValid); | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(N) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
var b = N.toString(2); | |
var gap = 0, biggestGap = 0; | |
console.log(b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ $# -eq 0 ]; then | |
echo "USAGE: $0 plugin1 plugin2 ..." | |
exit 1 | |
fi | |
plugin_dir=~/jenkins/plugins |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const withContext = <P extends {}>(Component: React.ComponentType<P>) => | |
class WithContext extends React.PureComponent<P & IAppContext> { | |
render() { | |
return ( | |
<AppContext.Consumer> | |
{(context: any) => <Component {...this.props} {...context} />} | |
</AppContext.Consumer> | |
); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mapEnum = (type: any, value: any) => { | |
const x = findKey(type, (v: any,i: any, a: any) => { | |
// console.log(v,i,a,v2); | |
return v === value | |
}); | |
console.log(x); | |
return x; | |
} |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"SeedCode": "8212627", | |
"LA Name": "North Ayrshire", | |
"Centre Type": "Local Authority", | |
"School Name": "Abbey Primary School", | |
"Address 1": "Claremont Crescent", | |
"Address 2": "", | |
"Address 3": "KILWINNING", | |
"Post code": "KA13 7HG", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<svg xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink"> | |
<use xlink:href="https://gist.github.com/stephenwil/b0ec7b72daecdbe562ec248ee9b4480e#file-openweather-api" x="100" y="300" /> | |
</svg> | |
</body> | |
</html> |