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> | |
<script type="text/javascript" src="jquery-1.6.1.min.js"></script> | |
<script type="text/javascript" src="processing-1.2.1.min.js"></script> | |
<script type="text/javascript" src="websocket_processing.js"></script> | |
</head> | |
<body> | |
<canvas id="processing"></canvas> | |
</body> | |
</html> |
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
The pizza recipe is based on the book "My Bread" by Jim Lahey, which I | |
HIGHLY recommend. It has bunch of recipes based around the idea of | |
"no knead" bread - basically long fermentation times take place of | |
lengthy, annoying kneading. You can make great loaves with a similar | |
technique to the pizza recipe below. This is a kind of "Roman" style | |
pizza where you stretch the dough very thin on two 13" x 18" sheet | |
pans, cut the ingredients very thinly, layer it, and bake it hot for | |
about 25 minutes. To make two pies: | |
3 3/4 cups or 500 grams Bread Flour |
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
require('zappa') -> | |
@get '/': -> @render 'index', layout: no | |
@view index: -> | |
doctype 5 | |
html -> | |
head -> | |
title 'Zappa + CoffeeKup + Processing' | |
style '''body { background-image:url('http://icanhasnoise.com/1d0b07-4a2219/40x1500/4'); text-align: center; } header { font-family: 'Lobster Two', cursive; font-size: 28px; color: white; text-shadow: 3px 3px 3px brown; }''' | |
link rel: 'stylesheet', href: 'http://fonts.googleapis.com/css?family=Lobster+Two&v2' | |
script src: 'http://processingjs.org/content/download/processing-js-1.3.6/processing-1.3.6-api.min.js' |
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
/** | |
* npm install jsdom | |
* npm install jquery | |
*/ | |
var html = "<!doctype html><html><body><h1>Hello world!</h1></body></html>"; | |
/* parse the html and create a dom window */ | |
var window = require('jsdom').jsdom(html, null, { | |
// standard options: disable loading other assets |
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
sys = require "sys"; | |
http = require "http"; | |
url = require "url"; | |
connect = require "connect"; | |
redis = require "redis"; | |
hashRing = require "hash_ring"; | |
Sharding = { | |
servers = { "127.0.0.1 10000 6378": 1 }; | |
ring = new hashRing.HashRing servers; |
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
// | |
// This server will start a bash shell and expose it | |
// over socket.io to a browser. See ./term.html for the | |
// client side. | |
// | |
// You should probably: | |
// | |
// npm install socket.io | |
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js | |
// |
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
express = require 'express' | |
RedisStore = require('connect-redis')(express) | |
# Heroku redistogo connection | |
if process.env.REDISTOGO_URL | |
rtg = require('url').parse process.env.REDISTOGO_URL | |
redis = require('redis').createClient rtg.port, rtg.hostname | |
redis.auth rtg.auth.split(':')[1] # auth 1st part is username and 2nd is password separated by ":" | |
# Localhost | |
else |
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
#!/usr/bin/env coffee | |
# Call the program with: coffee phantom.coffee http://url.to/screengrab | |
phantom = require 'phantom' # npm install phantom | |
child_process = require 'child_process' | |
url = process.argv[2] | |
createScreenshot = (page, filename) -> |
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
.DS_Store | |
node_modules |
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> | |
<title>Node.js chat</title> | |
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" /> | |
<script type="text/javascript" src="jquery-1.7.2.js"></script> | |
<script type="text/javascript" src="/nowjs/now.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
now.receiveMessage = function(time, name, message) { |
NewerOlder