Skip to content

Instantly share code, notes, and snippets.

View mzaragoza's full-sized avatar

Moises Zaragoza mzaragoza

View GitHub Profile
@mzaragoza
mzaragoza / prepare-commit-msg
Last active August 29, 2015 14:05
Prepare Commit Message Hook Script
#!/usr/bin/php
<?php
# Git Prepare Commit Message Hook Script
#
# Location: <repository>/.git/hooks/prepare-commit-msg
#
# This script will automatically add the correct
# Pivotal Ticket ID to the beginning of each commit message
# When the branch ID is starts with the Pivotal Message ID.
export PATH=${PATH}:/Applications/adt-bundle-mac/sdk/tools
export PATH=${PATH}:/Applications/adt-bundle-mac/sdk/platform-tools
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
[[ -r $rvm_path/scripts/completion ]] && source $rvm_path/scripts/completion
#opexport PS1="\u:~$ "
vim() {
(unset GEM_PATH GEM_HOME; command vim "$@")
}
class Users::RegistrationsController < Devise::RegistrationsController
layout :choose_layout
expose(:selected_plan) { Plan.find_by_slug(params[:plan]) }
after_filter :after_registration, :only => [:create]
def choose_layout
if params[:action] == 'edit' or params[:action] =='update' or params[:action] =='change_password'
'users/default'
@mzaragoza
mzaragoza / gist:d86af1859711f8efb8cf
Created January 22, 2015 21:31
alias for ~/.bashrc.local
alias git_reset_all='git reset --hard HEAD'
alias find_large_files='find . -type f -size +10000k -exec ls -lh {} \;'
alias push_github="gp"
alias db_up="up"
alias bashrc="vim ~/.bashrc.local"
alias up="rake db:migrate db:test:prepare"
alias down="rake db:rollback"
alias cucumber='bundle exec cucumber'
alias bottle="git add . && git stash"
alias poop="git stash pop"
i have a repo set up but its been a while sines i have done anything i see that i am set (devise_admin) but when i want to do a git pull i get
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
any idea what to do?
test
@mzaragoza
mzaragoza / gist:2936939
Created June 15, 2012 15:11 — forked from netzpirat/gist:238162
Running webrat and celerity parallel
We couldn’t find that file to show.
@mzaragoza
mzaragoza / gist:5221795
Created March 22, 2013 14:44
MYSQL FIND ANYTHING IN DB
<?php
session_start();
define("mz_DB_USERNAME", "XXXXXX");
define("mz_DB_PASSWORD", "XXXXXX");
define("mz_DB_HOST", "XXXXXX");
define("mz_DB_DATABASE", "XXXXXX");
require_once('config.inc.php');
require_once('__database_class.php');
$db = new mz_database();
@mzaragoza
mzaragoza / gist:5490145
Created April 30, 2013 17:03
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
Note: I am not using the Heroku Zerigo DNS add-on, instead I have a separate Zerigo account for my DNS needs. I do this because Zerigo offers 30 hosts on free direct accounts, versus only 10 hosts on the free Heroku add-on.
I. Getting a GoDaddy SSL Certificate (Part I)
@mzaragoza
mzaragoza / gist:6437255
Created September 4, 2013 13:55
exclude personal files
Here is where you exclude personal files
.git/info/exclude