Skip to content

Instantly share code, notes, and snippets.

View robraux's full-sized avatar

Rob robraux

  • Raux Software, LLC
  • Ann Arbor, MI
View GitHub Profile
{{? app.filters && app.filters.length > 0 }}
{{~app.filters :value:index2}}
.filter("{{=app.key}}{{=value.js_function_name}}", function() {
{{=value.content}}
})
{{~}}
{{?}}
[alias]
st = status
ci = commit
br = branch
brr = "!f(){ git push origin origin:refs/heads/$1 && git checkout --track -b $1 origin/$1; };f"
df = diff
lg = log
co = checkout
m = checkout master
@robraux
robraux / gist:6594832
Created September 17, 2013 14:11
All open CORS S3
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
robr@atty:~/api git:(deployment) $ npm install nodetime
npm http GET https://registry.npmjs.org/nodetime
npm http 200 https://registry.npmjs.org/nodetime
npm http GET https://registry.npmjs.org/nodetime/-/nodetime-0.8.3.tgz
npm http 200 https://registry.npmjs.org/nodetime/-/nodetime-0.8.3.tgz
npm ERR! Error: EPERM, chown '/home/robr/.npm/nodetime/0.8.3/package.tgz'
npm ERR! { [Error: EPERM, chown '/home/robr/.npm/nodetime/0.8.3/package.tgz']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: '/home/robr/.npm/nodetime/0.8.3/package.tgz' }
[program:staging-api]
command=/usr/local/bin/node index.js
directory=/home/dreams/do/come/true
environment=NODE_ENV=production,USER=ubuntu,PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/game"
user=ubuntu
-- lua has no split string, so we need to write our own
-- explode(seperator, string)
local explode = function(d,p)
local t, ll, l
t={}
ll=0
if(#p == 1) then return {p} end
while true do
l=string.find(p,d,ll,true) -- find the next d in the string
if l~=nil then -- if "not not" found then..
local res
local mover
-- step 1: ensure the target database is flushed
redis.call('select', ARGV[1])
redis.call('flushdb')
-- step 2: fetch keys to transfer from database 0, that is one and only master
redis.call('select', 0)
res = redis.call('keys', '*')
for key, value in pairs(res)
do
@robraux
robraux / gist:2143639
Created March 21, 2012 02:00
Example of using Duplicity in Ubuntu
#1 Install it (example of linking to RackSpace Cloud), ubuntu example
apt-get install duplicity
apt-get install python-setuptools
git clone git://github.com/rackspace/python-cloudfiles.git
python setup.py install
#2 Create a simple shell script (put this in a shell script)
export CLOUDFILES_USERNAME=YOURNAME
export CLOUDFILES_APIKEY=YOURKEY