Skip to content

Instantly share code, notes, and snippets.

View nesquena's full-sized avatar

Nathan Esquenazi nesquena

View GitHub Profile
@nesquena
nesquena / .bash_profile
Created May 31, 2009 07:17
simple git branch ps1 with colored dirty state
# COLORS
LIGHT_GRAY="\[\033[0;37m\]"; BLUE="\[\033[1;36m\]"; RED="\[\033[0;31m\]"; LIGHT_RED="\[\033[1;31m\]";
GREEN="\[\033[0;32m\]"; WHITE="\[\033[1;37m\]"; LIGHT_GRAY="\[\033[0;37m\]"; YELLOW="\[\033[1;33m\]";
# GIT PROMPT (http://gist.github.com/120804)
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/';
}
function parse_git_status {
git status 2> /dev/null | sed -e '/(working directory clean)$/!d' | wc -l;
}
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@nesquena
nesquena / autotest_install
Created June 30, 2010 22:23
Autotest Instructions
# http://ph7spot.com/musings/getting-started-with-autotest
$ gem install redgreen autotest-standalone autotest-fsevent autotest-growl autotest-rails-pure
$ mate ~/.autotest
require 'redgreen/autotest'
require 'autotest/timestamp'
require 'autotest/growl'
require 'autotest/fsevent'
require "autotest/restart"
@nesquena
nesquena / .bash_profile
Created July 1, 2010 21:16
Git Config .gitconfig file
# brew install git bash-completion
# Completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Editor
export EDITOR='mate -w'
@nesquena
nesquena / dj_multi.god
Last active December 5, 2019 17:41
god configuration
# delayed job priority ranges. Higher values represent lower priority.
PRIORITY_RANGES = [(0..9), (10..19)]
2.times do |num|
God.watch do |w|
w.name = "dj-#{num}"
w.group = 'dj'
w.interval = 30.seconds
w.start = "rake -f #{RAILS_ROOT}/Rakefile RAILS_ENV=production MIN_PRIORITY=#{PRIORITY_RANGES[num].first} MAX_PRIORITY=#{PRIORITY_RANGES[num].last} jobs:work"
w.log = "/var/log/god/god.log"
@nesquena
nesquena / base.conf
Last active February 28, 2020 11:35
nginx configuration
include mime.types;
default_type application/octet-stream;
access_log logs/access.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
tcp_nopush on;
@nesquena
nesquena / .gemrc
Created July 26, 2010 20:58
Gem RC file
---
:update_sources: true
:sources:
- http://gems.rubyforge.org/
- http://gems.github.com
:benchmark: false
:bulk_threshold: 1000
:backtrace: false
:verbose: true
gem: --no-ri --no-rdoc
@nesquena
nesquena / compile_redis_ubuntu.txt
Created July 26, 2010 22:05
Redis installation instructions
# http://antonio.ognio.com/2010/07/28/installing-redis-on-linux-and-mac-os-x/
wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
tar -xzvf redis-2.2.2.tar.gz
cd redis-2.2.2 && sudo make && sudo make install
Five binaries will be installed to /usr/local/bin, redis-server, redis-benchmark, redis-cli, redis-check-dump and redis-check-aof. You’ll have to manually copy the Redis configuration file to /etc like this:
sudo mkdir /etc/redis
sudo cp redis.conf /etc/redis/redis.conf
@nesquena
nesquena / mac_setup.txt
Last active February 10, 2019 17:58
Setup Local Mac
- Run software update
- Install Purchased Apps from App Store
- Disable caps lock key (Sys Pref => Keyboard => Modifier Keys)
- System Pref -> Expose -> Setup corners for spaces and expose
+ System Pref -> Security -> Sleep Password
- Setup Dropbox to Get Files
- Install 1Password
- Use dropbox synced file for keychain
- Install browser extension for chrome
- Install Prey
@nesquena
nesquena / custom.cnf
Created August 3, 2010 22:21
MySQL Configuration
[mysqld]
#
# * Networking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 192.168.xxxx.xxxx
#