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
/* Custom radio input */ | |
input[type="radio"] { | |
position:absolute; | |
clip: rect(0,0,0,0); | |
clip: rect(0 0 0 0); | |
} | |
input[type="radio"] + label::before { | |
content: url('radio.png'); | |
} |
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
//data type with length | |
var x = [1,2,3,4,5,5,5,5,5,5,5,5,5,5,5,6,7,7,10]; | |
var i | |
,content; | |
for(i = 0; xlength; i < content; i ++){ | |
console.log(x[i]); | |
} |
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
//largest value in array | |
Array.max = function( array ){ | |
return Math.max.apply( Math, array ); | |
}; | |
//add multiple array values | |
function addArrayValues(arrayNameHere){ | |
var i | |
, max | |
, statTotal = []; |
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 x = ["blue", "yellow", "red", "green", "brown", "grey", "gray", "orange"]; | |
var y = ["james", "john", "robert", "michael", "william", "david", "richard", "wayne"]; | |
function merge2array(a, b) { | |
var obj = {}; | |
var l = a.length; | |
var i; | |
for (i = 0; i < l; i++) { | |
obj[a[i]] = b[i]; |
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": "HackAthon", | |
"description": "North Festival Hackathon 2013 WBURG BK", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "nodemon app.js", | |
"debug": "nodemon --debug app.js" | |
}, | |
"dependencies": { |
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 fs = require('fs') | |
, http = require('http') | |
, util = require('util') | |
, path = require('path') | |
, Combinatorics = require('./combinatorics.js').Combinatorics | |
, request = require('request') | |
, ipContainer = [], url2Test, ipContainer2 = [] | |
, cmb = Combinatorics.permutation(['0','1','8','16','46','74','96','106','109','126','127','186','192','255'], 4); | |
cmb = cmb.toArray(); |
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
//get image with request and pipe it to client. | |
var http = require('http'); | |
var request = require('/usr/local/share/npm/lib/node_modules/request'); | |
var server = http.createServer(function (req, res) { | |
request.get('http://www.1up.com/images/Elements/carouselNav.png').pipe(res); | |
}); | |
server.listen(8000); |
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 app = require('express')() | |
, server = require('http').createServer(app) | |
, express = require('express') | |
, http = require('http') | |
, port = 3000; | |
/* | |
* Express : Configure |
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
aardvark | |
aardwolf | |
aaron | |
aback | |
abacus | |
abaft | |
abalone | |
abandon | |
abandoned | |
abandonment |
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
// Ever needed to escape '\n' as '\\n'? This function does that for any character, | |
// using hex and/or Unicode escape sequences (whichever are shortest). | |
// Demo: http://mothereff.in/js-escapes | |
function unicodeEscape(str) { | |
return str.replace(/[\s\S]/g, function(character) { | |
var escape = character.charCodeAt().toString(16), | |
longhand = escape.length > 2; | |
return '\\' + (longhand ? 'u' : 'x') + ('0000' + escape).slice(longhand ? -4 : -2); | |
}); | |
} |