Skip to content

Instantly share code, notes, and snippets.

View sajoku's full-sized avatar
🏠
Working from home

Sander sajoku

🏠
Working from home
View GitHub Profile
@johnthethird
johnthethird / cap_notify.rb
Created May 4, 2011 20:02 — forked from rtekie/cap_notify.rb
Capistrano deployment email notifier for Rails 3
=begin
Capistrano deployment email notifier for Rails 3
Do you need to send email notifications after application deployments?
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html.
Here is Rails 3 port of the notifier.
The notifier sends an email after application deployment has been completed.
@phaer
phaer / coffeescript_converter.rb
Created May 6, 2011 22:39
A trivial CoffeeScript.org -> Javascript plugin for jekyll ( https://github.com/mojombo/jekyll ). Put this file in '_plugins/' and write a YAML header to your .coffee files (i.e. "---\n---\n")
module Jekyll
require 'coffee-script'
class CoffeeScriptConverter < Converter
safe true
priority :normal
def matches(ext)
ext =~ /coffee/i
end
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@earlonrails
earlonrails / mock_tcp_socket.rb
Created December 13, 2011 01:57
Mock tcp socket for spec tests with ruby!!!
require 'socket'
require 'mocks'
TCP_NEW = TCPSocket.method(:new) unless defined? TCP_NEW
#
# Example:
# mock_tcp_next_request("<xml>junk</xml>")
#
class FakeTCPSocket
@bradmontgomery
bradmontgomery / rvm_apache_passenger.txt
Created January 10, 2012 04:45
RVM + Apache + passenger setup for Ubuntu
# Install rvm system-wide
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
# Update the packages
apt-get update
apt-get upgrade
apt-get install build-essential
# get the packages required by ruby
rvm pkg install zlib
@saetia
saetia / gist:1623487
Last active March 20, 2025 09:04
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@msabramo
msabramo / git_prompt_info.zsh
Created April 11, 2012 00:07
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@wndxlori
wndxlori / settings_view_controller.rb
Created July 4, 2012 17:12
RubyMotion with UILocalNotification
def setup_alarm_notification(for_day, with_switch)
alarm_date = App::Persistence[for_day]
alarm_is_set = App::Persistence[with_switch];
if (alarm_is_set && alarm_date && (alarm_date > Time.now))
local_notification = UILocalNotification.alloc.init
local_notification.fireDate = NSDate.dateWithString( alarm_date.to_s )
local_notification.alertBody = "Time to get up! #{alarm_date.strftime('%H:%M')}"
local_notification.soundName = UILocalNotificationDefaultSoundName
local_notification.applicationIconBadgeNumber = 1
@MattiSG
MattiSG / brewv
Created July 9, 2012 14:05
Install a previous version of a formula with Homebrew
#!/bin/bash
#
# Installs the previous version of a Homebrew formula
#
# Usage: brewv formula_name desired_version
#
# Based on http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula#9832084
#
# Author: Matti Schneider <[email protected]> (http://mattischneider.fr)