Skip to content

Instantly share code, notes, and snippets.

// Activate WM+
Serial.println("Intitializing MP");
Wire.beginTransmission(0x52);
Serial.println("1");
Wire.send(0xf0);
Serial.println("2");
Wire.send(0x55);
Serial.println("3");
Wire.endTransmission();
Serial.println("4");
hunter@ws1:/var/node/gtg$ echo $NODE_ENV
production
hunter@ws1:/var/node/gtg$ sudo echo $NODE_ENV
production
hunter@ws1:/var/node/gtg$ node server.js single
Starting in environment: production
Opening server on port 443...
Error in unix_dgram bind of /var/node/gtg/cluster.21657.server.sock
Error: EACCES, Permission denied
at dgram.js:125:19
server.use(stylus.middleware({
src: server.set('views'),
dest: server.set('public'),
debug: false,
compileMethod: function(str) {
return stylus(str)
.set('compress', options.compressCss);
},
force: true
}));
HEADERS:
{ host: '192.168.2.4',
'x-requested-with': 'XMLHttpRequest',
'user-agent': 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_8 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8E401 Safari/6533.18.5',
'content-type': 'application/x-www-form-urlencoded',
accept: 'application/json',
referer: 'http://192.168.2.4/mobile/index.html',
'accept-language': 'en-us',
'accept-encoding': 'gzip, deflate',
cookie: 'session=cV9CXtS4w5jOKX0Frx3XOeRV.MPq6pHXem1kslr3w%2FeJdtBgCAX0jGy8P3CI5upNFV%2BI',
@hunterloftis
hunterloftis / gist:1025903
Created June 14, 2011 21:14
prepare linode server
# This should be run on a new Linode Ubuntu 32-bit image to prepare it for hosting GTG
# To start, something like this works:
# scp prepare_server.sh [email protected]:/root
# First, install basic linux utilities (compilers, git, libssl)
cd /root
apt-get update
server.configure(function() {
// Settings
server.set('app root', root + '/app');
server.set('view engine', options.view_engine || 'jade');
server.set('views', server.set('app root') + '/views');
server.set('public', server.set('app root') + '/public');
server.set('port', options.port);
server.set('host', options.host);
server.use(stylus.middleware({
src: server.set('views') + '/stylus',
dest: server.set('public') + '/styles'
}));
@hunterloftis
hunterloftis / gist:973973
Created May 16, 2011 05:25
Zepto + Mustache + KnockoutJS starting point
ko.mustacheTemplateEngine = function () {
this['getTemplateNode'] = function (template) {
var templateNode = document.getElementById(template);
if (templateNode == null)
throw new Error("Cannot find template with ID=" + template);
return templateNode;
}
this['renderTemplate'] = function (templateId, data, options) {
# serve static files
location /images {
root /var/rapp/labs/app/public/;
expires 30d;
}
# pass dynamic content to node
location / {
proxy_pass http://127.0.0.1:90/;
}
#title
h1
span.lead our incredible
strong capabilities
span.tail make us both look good.
#demos
- for(var i = 0; i < 5; i++)
.demo
a(href='/max')