Skip to content

Instantly share code, notes, and snippets.

View zakgrant's full-sized avatar
🎯
Focusing

Zak Grant zakgrant

🎯
Focusing
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@davidjrice
davidjrice / README.md
Created June 6, 2012 17:00
Vagrantfile for an Ubuntu lucid 32 or 64 bit VM with couchbase 2.0.0.dp4.1

Install Virtualbox

wget http://download.virtualbox.org/virtualbox/4.1.16/VirtualBox-4.1.16-78094-OSX.dmg
open VirtualBox-4.1.16-78094-OSX.dmg
# double click .pkg to install

Install vagrant

gem install vagrant --no-ri --no-rdoc
@balexand
balexand / xip_hack.rb
Created June 8, 2012 06:23
xip.io request hack
if Rails.env.development?
class XipIoMiddleware
def initialize(app)
@app = app
end
def call(env)
%w{HTTP_HOST SERVER_NAME SERVER_ADDR HTTP_X_FORWARDED_HOST}.each do |key|
env[key] = env[key].sub(/myapp\.\d+\.\d+\.\d+\.\d+\.xip\.io/, "myapp.dev") if env[key].present?
end
@mperham
mperham / after.rb
Created July 4, 2012 19:30
Thread-friendly shared connection
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection }
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@iolloyd
iolloyd / Spot the Hijack
Created September 2, 2012 20:09
Use Audio Hijack Pro to record Spotify tracks while you listen
* Script to record and tag spotify tracks, by Lloyd Moore *)
(* Make sure you are already recording in Audio Hijack Pro with a session called 'spotifySession' *)
tell application "Spotify"
set currentTrack to (current track)
set trackName to (name of currentTrack)
tell application "Audio Hijack Pro"
set theSession to my getSession()
end tell
repeat
@Couto
Couto / raspberrypi_archlinux.md
Last active August 27, 2017 17:06
Raspberry Pi with ArchLinux
@dannyduc
dannyduc / gist:3694578
Created September 10, 2012 22:57
Maven Integration Test
<project>
<properties>
<jetty.port>8123</jetty.port>
</properties>
<build>
<plugins>
<plugin>
@hamstarr
hamstarr / tunnel.sh
Created October 17, 2012 12:31
tunnel.sh
#!/bin/sh
# tunnel.sh
# Configure
LOCAL_HOST=127.0.0.1;
USERNAME="your_username";
# set your remote address and SSH port.
TUNNEL_PORT="2022"
REMOTE_HOST="my.homedomainorip.com -p $TUNNEL_PORT";