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
{"name": "Dale", "age": 6} |
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
var Node = function() { | |
this.data = arguments[0]; | |
this.next = arguments[1] === undefined ? null : arguments[1]; | |
this.prev = arguments[2] === undefined ? null : arguments[2]; | |
}; | |
var LinkedList = function() { | |
this.head = null; | |
this.tail = null; | |
this.length = 0; |
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
//http://api.nytimes.com/svc/search/v2/articlesearch.json?q=israel+iran&fq=source:("The New York Times")&api-key=f25c99da2f24daefca165f7a452d05ec:1:35029882 | |
var pagesOfStoriesToRequest = 9; | |
var requestsPromises = []; | |
var keywordsArray = []; | |
var uniqueKeywordsArray; | |
var templateVectorMap = {}; | |
var featureVectorsRaw = []; | |
var coordinates = []; //array of arrays for d3 to scatterplot... |
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
//http://api.nytimes.com/svc/search/v2/articlesearch.json?q=israel+iran&fq=source:("The New York Times")&api-key=f25c99da2f24daefca165f7a452d05ec:1:35029882 | |
var pagesOfStoriesToRequest = 9; | |
var requestsPromises = []; | |
var keywordsArray = []; | |
var uniqueKeywordsArray; | |
var templateVectorMap = {}; | |
var featureVectorsRaw = []; | |
var coordinates = []; //array of arrays for d3 to scatterplot... |
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
if (typeof Object.assign != 'function') { | |
(function () { | |
Object.assign = function (target) { | |
'use strict'; | |
if (target === undefined || target === null) { | |
throw new TypeError('Cannot convert undefined or null to object'); | |
} | |
var output = Object(target); |
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
filename="package.json" | |
pattern=' "version": "([0-9]+\.[0-9]+\.[0-9]+).*' | |
git log --pretty="format:%H" -- package.json | { | |
while read current_hash; do | |
if [ -n "$previous_hash" ]; then | |
new_version=`git diff $previous_hash $current_hash -- $filename | sed -n -E -e "s/^\-$pattern/\1/p"` | |
if [ -n "$new_version" ]; then | |
echo version bumped to $new_version with $previous_hash | |
fi |
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/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
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/sh | |
# Cisco Anyconnect CSD wrapper for OpenConnect | |
CSTUB="$HOME/.cisco/hostscan/bin/cstub" | |
$ARCH=$(uname -m) | |
if [[ "$ARCH" == "x86_64" ]] | |
then |
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
{ | |
"type": "Program", | |
"body": [ | |
{ | |
"type": "ExpressionStatement", | |
"expression": { | |
"type": "CallExpression", | |
"callee": { | |
"type": "FunctionExpression", | |
"id": null, |
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 only difference between a stub and a spy is this: | |
// - a spy wraps existing function and allows you to assert against its behavior | |
// - a stub replaces an existing function and allows you to assert against its behavior | |
// This creates a normal function that can be invoked. | |
const spy = sandbox.spy(); | |
// Do something with it... and then you can make assertions against it later. | |
expect(spy).to.have.been.calledOnce; | |
// This wraps `someObject.someMethod` in another function. After wrapping, |
OlderNewer