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
/** @return A hash keyed by URI param name, values always being arrays */ | |
function paramsFromURI(){ | |
var p = {}; | |
var a = document.location.search.substring(1).split(/[;&]+/); | |
for (var i=0; i<a.length; i++){ | |
var kv = a[i].split(/=/); | |
p[kv[0]] = p[kv[0]] || []; | |
p[kv[0]].push( decodeURIComponent( kv[1] ) ); | |
} | |
return p; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Mocha Test Suite Runner</title> | |
<link rel="stylesheet" media="all" href="vendor/mocha/mocha.css"> | |
<script src='../vendor/require.js'></script> | |
<script> | |
/** Needed to run the tests */ |
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
# set -o verbose | |
# set -x | |
export ES_HOST=localhost:9200 | |
export INDEX_NAME="people" | |
export SUGGEST_INDEX_NAME="suggestions" | |
export DELETE="curl -XDELETE $ES_HOST" | |
export POST="curl -XPOST $ES_HOST" | |
export PUT="curl -XPUT $ES_HOST" | |
export GET="curl -XGET $ES_HOST" |
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
/** Vertically scrolling slide show, cf Valentino | |
<script src='js/scroll2next.js'></script> | |
<script> | |
jQuery(document).ready( function () { | |
document.body.scrollTop = document.documentElement.scrollTop = 0; | |
new Scroll2Next({ | |
container: '#container', | |
selector: 'img' | |
}); | |
}); |
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
// https://en.wikipedia.org/wiki/Hue#Computing_hue_from_RGB | |
else if ((r >= g) && (g >= b)) { | |
rvXy[x][y] = 60 * ( (g-b) / (r-b) ); | |
} | |
else if ((g > r) && (r >= b)) { | |
rvXy[x][y] = 60 * (2 - ( (r-b) / (g-b) )); | |
} | |
else if ((g >= b) && (g > r)) { | |
rvXy[x][y] = 60 * (2 + ( (b-r) / (g-r) )); | |
} |
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
/* | |
Take a screenshot with Phantom.js under Node.js | |
APIs | |
* Phantom https://github.com/ariya/phantomjs/wiki/API-Reference | |
* Webpage https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage | |
*/ |
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 mysql = require('mysql'); | |
var express = require('express'); | |
var app = express(); | |
var controllers = module.exports.controllers = {}; | |
var models = module.exports.models = {}; | |
if (!process.env.dbpass){ | |
app.use(express.logger('dev')); | |
} |
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 mysql = require('mysql'); | |
var express = require('express'); | |
var app = express(); | |
var controllers = module.exports.controllers = {}; | |
var models = module.exports.models = {}; | |
if (!process.env.dbpass){ | |
app.use(express.logger('dev')); | |
} |
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
beforeEach( module('thinMonitor') ); | |
beforeEach( inject( function ($injector, $rootScope) { | |
rootScope = $rootScope; | |
scope = $rootScope.$new(); | |
scope.grid = MOCKS.grid; | |
controller = $injector.get('$controller')('templateDialogController', { | |
$rootScope : $rootScope, | |
$scope : scope, | |
dialogInstance : MOCKS.dialogInstance, |
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
jasmine.addMatchers( jasmine.XXX.customMatchers ); | |
// This must load before any tests are run. | |
jasmine.XXX.customMatchers = { | |
toEqualNice: function(util, customEqualityTesters) { | |
return { | |
compare: function(actual, expected) { | |
if (expected === undefined) { | |
expected = ''; | |
} |
OlderNewer