Simple Dashing job to display total number of events in MixPanel .
##Preview
##Dependencies
#! /bin/bash | |
# directory to save backups in, must be rwx by postgres user | |
BASE_DIR="/var/backups/postgres" | |
YMD=$(date "+%Y-%m-%d") | |
DIR="$BASE_DIR/$YMD" | |
mkdir -p $DIR | |
cd $DIR | |
# make database backup |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>comment</key> | |
<string> | |
TODO: unresolved issues | |
text: |
# encoding: utf-8 | |
xml.instruct! | |
# Drop this file in your source directory | |
# | |
# Uses the builder gem. | |
# Add | |
# gem 'builder', '~> 2.0' | |
# to the Gemfile, and run builder install | |
# |
#Session controller provides a token | |
#/controllers/api/sessions_controller.rb | |
class Api::SessionsController < Devise::SessionsController | |
before_filter :authenticate_user!, :except => [:create] | |
before_filter :ensure_params_exist, :except => [:destroy] | |
respond_to :json | |
def create | |
resource = User.find_for_database_authentication(:email => params[:user_login][:email]) | |
return invalid_login_attempt unless resource |
This is used to generate a templates.js
file where the keys are template identifiers and the values are the raw, escaped EJS templates.
Templates are semi-compiled server side. Results of compilation are memoized on the client side using Underscore.
This is useful for maintaining multiple template files server-side and compiling them into a client-side script.
This requires the use of the ejs
client side library. Requires ejs
to be available on window
. See: https://github.com/visionmedia/ejs#client-side-support
{ | |
"files": { | |
"jQuery min": "http://code.jquery.com/jquery.min.js", | |
"Eric Meyer's reset": "http://meyerweb.com/eric/tools/css/reset/reset.css", | |
"normalize.css": "https://raw.github.com/necolas/normalize.css/master/normalize.css", | |
"Backbone.js": "http://documentcloud.github.com/backbone/backbone-min.js", | |
"Underscore.js": "http://documentcloud.github.com/underscore/underscore-min.js", | |
"Prefix free": "https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.min.js", | |
"jQuery Transit": "https://raw.github.com/rstacruz/jquery.transit/master/jquery.transit.js", | |
"plinejs": "http://labs.svn.octaveoctave.com/mathias/plinejs/build/plinejs-0.4-n.js", |
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.
For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.