Skip to content

Instantly share code, notes, and snippets.

View renanra's full-sized avatar

Renan de Azevedo renanra

  • Rio de Janeiro - Brazil
View GitHub Profile
@dommmel
dommmel / dokku-pg-backup.sh
Last active September 16, 2020 08:03
dokku postgres backup cronjob (using https://github.com/Kloadut/dokku-pg-plugin)
#! /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
@edubkendo
edubkendo / RubyNext.tmLanguage
Created August 10, 2013 03:58
A better ruby syntax highlighter for sublime text. Combines the ruby bundle with ST, recent updates to the textmate bundle, and a tmLanguage file called "Experimental Ruby".
<?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:
@ilyakatz
ilyakatz / Readme.md
Last active March 5, 2020 12:19
MixPanel job for Dashing

Description

Simple Dashing job to display total number of events in MixPanel .

##Preview

##Dependencies

@tommysundstrom
tommysundstrom / sitemap.xml.builder
Last active January 1, 2022 23:21
Middleman xml sitemap (to aid Google and other search engines)
# 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
#
@paulmillr
paulmillr / brunch-heroku-deploy.md
Last active March 29, 2019 23:12
Build & deploy brunch applications on Heroku.
  1. Add to .gitignore:

    node_modules
    public
    
  2. Add to your app dependencies of package.json:

@marcomd
marcomd / gist:3129118
Created July 17, 2012 12:18
Authenticate your API with devise, token by header
#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
@cookrn
cookrn / _readme.md
Created June 27, 2012 04:19
Compile *.ejs Templates

EJS Compiler

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

@FreakDev
FreakDev / gist:2309378
Created April 5, 2012 09:09 — forked from Victa/gist:2309363
fetch.sublime-settings
{
"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",
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# 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
@holman
holman / gemspec-usage.md
Created February 12, 2012 07:02
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'