Skip to content

Instantly share code, notes, and snippets.

View frznk-tank's full-sized avatar
👌
¯\_(ツ)_/¯

Frznk frznk-tank

👌
¯\_(ツ)_/¯
View GitHub Profile
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
@frznk-tank
frznk-tank / nginx.conf
Created November 20, 2011 16:32
Bare-bone nginx.conf with mass hosts
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
@frznk-tank
frznk-tank / unicorn.rb
Created November 27, 2011 08:59
Basic Unicorn Setup
# unicorn_rails -c config/unicorn.rb -D
app_name = "dojo"
app_root = "/Users/frank/Projects/rails/#{app_name}"
working_directory app_root
pid "/tmp/unicorn.#{app_name}.pid"
stderr_path "#{app_root}/log/unicorn.log"
stdout_path "#{app_root}/log/unicorn.log"
@frznk-tank
frznk-tank / application.rb
Created December 21, 2011 12:19
Fix for "File to import not found or unreadable: compass"
#...
require 'rails/all'
require 'sass-rails'
#...
module App
class Application < Rails::Application
config.sass.load_paths ||= []
config.sass.load_paths << "#{Rails.root}/app/assets/stylesheets"
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
@frznk-tank
frznk-tank / Haml.tmLanguage
Created February 18, 2012 10:57 — forked from unixmonkey/Haml.tmLanguage
Haml Language definition file for TextMate; modified to work with Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>haml</string>
<string>sass</string>
</array>
<key>foldingStartMarker</key>
@frznk-tank
frznk-tank / application.html.slim
Created February 25, 2012 12:36
View helper for adding IE conditional classes to the <html> tag.
doctype 5
= ie_conditional_classes do
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"
title Cool App
meta name="viewport" content="width=device-width"
= stylesheet_link_tag "application", media: "all"
= javascript_include_tag "modernizr"
@frznk-tank
frznk-tank / Gemfile
Created February 26, 2012 00:49
Adding IE version specific class names to the <html> tag without using conditional comments.
gem "slim"
gem "useragent"
{
"auto_complete": false,
"close_windows_when_empty": false,
"color_scheme": "Packages/Solarized/Solarized (dark).tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": true,
"find_selected_text": true,
"fold_buttons": true,
"folder_exclude_patterns":
#!/usr/bin/env bash
# Usage: curl -L https://raw.github.com/gist/3277326/ubuntu_bootstrap.sh | bash
RUBY=1.9.3-p327
echo "Updating Packages"; echo
apt-get -y update && apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev libgdbm-dev libxml2 libxml2-dev libxslt-dev git-core
@frznk-tank
frznk-tank / ergo-proxy.sh
Created November 14, 2012 21:18
Configure proxies in OSX and open an SSH tunnel
# Usage: bash ergo-proxy.sh <on off>
# Hitting ctrl-c while tunneled will exit the tunnel and turn the proxies off
STATE=$1
# Get a list of network services: networksetup -listallnetworkservices
NETWORKSERVICE=Wi-Fi
# Local port
PORT=3128