sudo apt-get update
sudo apt-get install git
cd ~
git clone --recursive https://github.com/CartoDB/cartodb20.git
# Modify this file accordingly for your specific requirement. | |
# http://www.thegeekstuff.com | |
# 1. Delete all existing rules | |
iptables -F | |
# 2. Set default chain policies | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT DROP |
var monkeypatch = function(io) { | |
io.configure(function(){ | |
io.set("transports", ["xhr-polling"]); | |
io.set("polling duration", 10); | |
}); | |
io.handleRequest = _.wrap(io.handleRequest, function(next, req, res) { | |
res.writeHead = _.wrap(res.writeHead, function(next, status, headers) { | |
if (headers) { delete headers.Connection; } | |
return next.call(this, status, headers); | |
}); |
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
[ | |
{ | |
"keys": ["super+alt+left"], | |
"command": "set_layout", | |
"args": | |
{ | |
"cols": [0.0, 0.33, 1.0], | |
"rows": [0.0, 1.0], | |
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]] | |
} |
Autobahn on dotCloud! | |
This code is 99% Autobah example code, 1% dotCloud adaptation. | |
To test this on dotCloud: | |
- create a dotCloud account at http://www.dotcloud.com/ | |
(free, no credit card) | |
- install dotCloud CLI, see http://docs.dotcloud.com/ |
def run_pg_fouine(): | |
info = host_info[env.host_string] | |
db_name = info.tags.get('Name') | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
time.sleep(30) | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
run('gzip -f /tmp/pgfouine.txt') |
begin; | |
create table user_ratings ( | |
id serial primary key, | |
user_id integer not null, | |
rating integer not null check (rating >= 0 and rating <= 5), | |
ratable_id integer not null | |
); | |
create function random_int(max integer) returns integer as $$ |
sudo apt-get update
sudo apt-get install git
cd ~
git clone --recursive https://github.com/CartoDB/cartodb20.git
#!/usr/bin/env node | |
var cordova_util = require('cordova/src/util'); | |
var projectRoot = cordova_util.isCordova(process.cwd()); | |
var projectXml = cordova_util.projectConfig(projectRoot); | |
var projectConfig = new cordova_util.config_parser(projectXml); | |
projectConfig.name(); | |
var fs = require ('fs'); |
// Reloading modules from the repl in Node.js | |
// Benjamin Gleitzman ([email protected]) | |
// | |
// Inspired by Ben Barkay | |
// http://stackoverflow.com/a/14801711/305414 | |
// | |
// Usage: `node reload.js` | |
// You can load the module as usual | |
// var mymodule = require('./mymodule') | |
// And the reload it when needed |