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 express = require('express'); | |
var app = express(); | |
var server = require('http').createServer(app); | |
var io = require('socket.io').listen(server); | |
app.use(express.static(__dirname + '/')); | |
server.listen(8000); | |
app.get('/', function (req, res) { |
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 arr = [1,2,3,4,5,6]; | |
var step = 3; | |
arr.forEach(function (el, i) { | |
if (i % step === 0) { | |
var c = arr.slice(i, i+step); | |
console.log(c) | |
} | |
}); |
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.replace(/[^<]*(<a href="([^"]+)">([^<]+)<\/a>)/g, function() { | |
matches.push(arguments[2]); | |
}); |
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://stackoverflow.com/a/12254857 | |
app.use(function(req, res, next) { | |
var session = req.session; | |
var messages = session.messages || (session.messages = []); | |
req.flash = function(type, message) { | |
messages.push([type, message]); | |
}; | |
next(); | |
}); |
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
.overview-panel .overview-header, .lightbox-panel .lightbox-header { | |
-moz-border-radius: 6px 6px 0px 0px; | |
-ms-border-radius: 6px 6px 0px 0px; | |
-o-border-radius: 6px 6px 0px 0px; | |
-webkit-border-radius: 6px 6px 0px 0px; | |
border-radius: 6px 6px 0px 0px; | |
-moz-box-shadow: 0px 3px 3px rgba(200, 200, 200, .4); | |
-ms-box-shadow: 0px 3px 3px rgba(200, 200, 200, .4); | |
-o-box-shadow: 0px 3px 3px rgba(200, 200, 200, .4); | |
-webkit-box-shadow: 0px 3px 3px rgba(200, 200, 200, .4); |
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
Show hidden characters
{ | |
"color_scheme": "Packages/User/Monokai (SL).tmTheme", | |
"font_size": 14, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"draw_white_space": "all" |
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 loc = location.href; | |
var baseurl = loc.substring(0,loc.lastIndexOf('/')); |
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> | |
<style type="text/css"> | |
canvas{ border:#666 1px solid;} | |
</style> | |
<script type ="application/javascript" language="javascript"> | |
var canvas; | |
var ctx; | |
var dx = 1; | |
var dy = 2; |
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> | |
<style type="text/css"> | |
canvas{ border:#666 1px solid;} | |
</style> | |
</head> | |
<body> | |
<script type ="application/javascript" language="javascript"> | |
// requestAnim shim layer by Paul Irish |
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> | |
<style type="text/css"> | |
#anim { | |
position:absolute; | |
left:0px; | |
width:150px; | |
height:150px; | |
background: blue; | |
font-size: larger; |