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 http = require('http'); | |
var server = http.createServer(function (request, response) { | |
response.writeHead(200, {"Content-Type": "text/html"}); | |
response.write('<h1>Hello World</h1>'); | |
response.end(); | |
console.log('Request: '+request.url); | |
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 | |
express = require('express'), | |
io = require('socket.io').listen(server, {log: false}), | |
mongoose = require('mongoose'), | |
morgan = require('morgan'), | |
app = express() | |
app.listen(8000); |
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
{ | |
"name" : "appname", | |
"version" : "0.0.1", | |
"description" : "Description goes here.", | |
"main" : "app.js", | |
"author" : "Nick Sheffield", | |
"dependencies" : { | |
"express" : "~4.7.2", | |
"mongoose" : "~3.6.2", | |
"morgan" : "~1.2.2" |
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
http://sachagreif.com/flat-pixels/ | |
http://speckyboy.com/2013/11/21/flat-design-vs-minimalism/ | |
http://sixrevisions.com/user-interface/when-flat-design-falls-flat/ |
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
.sprite{ | |
background-image: url(button_sprite.png); | |
background-repeat: no-repeat; | |
width: 198px; /* width of one button */ | |
height: 54px; /* height of one button */ | |
margin: 2em 0; | |
/* optional, makes the background slide */ | |
-webkit-transition: background-position 0.1s ease-out; | |
transition: background-position 0.1s ease-out; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
$(window).scroll(function(){ | |
var scrollY = window.scrollY // how far you are scrolled down | |
$('section').each(function(){ | |
var e = $(this), // element | |
height = e.height() // height of element | |
eTop = e.offset().top // element top offset, | |
h1 = e.find('h1') // title element | |
// if the screen is scrolled down past the top of the section |
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
// es6 | |
const at = { | |
angle: (a,b)=>Math.atan2(b.y-a.y,b.x-a.x)/Math.PI*180, | |
dist: (a,b)=>Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)), | |
step: (a,s)=>({x:s*Math.cos(a*Math.PI/180),y:s*Math.sin(a*Math.PI/180)}) | |
} | |
// es5 | |
var at = { | |
angle: function(a,b){return Math.atan2(b.y-a.y,b.x-a.x)/Math.PI*180}, |
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
CanvasRenderingContext2D.prototype.circle = function (x, y, r) { | |
this.beginPath(); | |
this.arc(x, y, r, 0, 2 * Math.PI, false); | |
this.closePath(); | |
} |
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 ngSocket = angular.module('ngSocket', []); | |
ngSocket.factory('socket', ['$rootScope', function ($rootScope) { | |
var socket = io.connect(location.origin+':9001'); | |
return { | |
on: function (eventName, callback) { | |
socket.on(eventName, function () { | |
var args = arguments; | |
$rootScope.$apply(function () { | |
callback.apply(socket, args); |