This file contains hidden or 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 middlware = function (req, res, next) { | |
// store flashes incase we need them | |
var flashes = req.session.flash; | |
// when flashes are accessed clear them from the session | |
req.flashes = function() { | |
req.session.flash = [] | |
return flashes; | |
} |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 1 column, instead of 10 in line 5.
This file contains hidden or 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
# ---------------------------------------- | |
# All Web Site Data | |
# Browser & OS | |
# 20141201-20150217 | |
# ---------------------------------------- | |
Screen Resolution,Sessions,% New Sessions,New Users,Bounce Rate,Pages / Session,Avg. Session Duration,Goal Conversion Rate,Goal Completions,Goal Value | |
1366x768,166,87.95%,146,87.95%,1.81,00:02:47,0.00%,0,$0.00 | |
1920x1080,121,91.74%,111,90.08%,1.16,00:00:06,0.00%,0,$0.00 | |
1440x900,59,93.22%,55,88.14%,1.12,00:00:03,0.00%,0,$0.00 |
This file contains hidden or 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
// (cos allows smooth transitions from 0->1->0) | |
// 0 -> 1 stepped sin frequency from 1 -> 5 | |
function stepper(i){ | |
var t = 2*Math.PI* ~~(i * 10); | |
return Math.cos(i*10*t) | |
} | |
// generalised version |
This file contains hidden or 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
// helper method for creating functions with | |
// all arguments mapped through a map_fn | |
function argument_map(map_fn){ | |
return function(fn){ | |
return function(){ | |
return fn.apply(this, | |
Array.prototype.slice.call(arguments) | |
.map(map_fn) | |
) | |
} |
This file contains hidden or 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
table[sort=up]:after:extend(.icon-arrow-down-12x12-white); | |
table[sort=down]:after:extend(.icon-arrow-up-12x12-white); |
This file contains hidden or 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> | |
<script src="http://code.jquery.com/jquery-git2.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> |
This file contains hidden or 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> | |
<script src="http://code.jquery.com/jquery-git2.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> |
This file contains hidden or 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 pubnub = PUBNUB.init({ | |
publish_key : 'pub-c-your-key', | |
subscribe_key : 'sub-c-your-key', | |
}); | |
/*---- setup - paste in console a few times to put some messages in A */ | |
pubnub.publish({ | |
channel:'A', | |
message:'testing-' + Math.random() |