Skip to content

Instantly share code, notes, and snippets.

View sxua's full-sized avatar
🇺🇦

Oleksandr Skrypnyk sxua

🇺🇦
View GitHub Profile
@jamiew
jamiew / unicorn.rb
Created October 14, 2010 17:58 — forked from jimmysoho/gist:534668
Unicorn config for use with bundler and capistrano - fixes issues with environment pollution.rb
# My pimped out unicorn config, with incremental killof
# and all the latest capistrano & bundler-proofing
# @jamiew :: http://github.com/jamiew
application = "000000book.com"
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production'
app_path = "/srv/#{application}"
bundle_path = "#{app_path}/shared/bundle"
timeout 30
@anthonyherron
anthonyherron / ThreeFinderGesturesBackInXcode.txt
Created August 8, 2011 15:53
Enable 3 finger swipe to switch between .h & .m in Xcode
Three finger gestures are awesome in Xcode, but they disappeared in Lion :(
You can bring them back to life however...
Inspired by a post from @gordonhughes (http://geeksinkilts.com/?p=67), explaining how to bring them back on an external trackpad, I started digging around for a way to get it working on the internal trackpads for the mbp/mba models.
*edit*
Perhaps an easier way of doing this found by @gordonhughes again is just this 1 line in Terminal, haven't confirmed this yet though
defaults -currentHost write -g "com.apple.trackpad.threeFingerVertSwipeGesture" -int 1
@jcasimir
jcasimir / better_rails_through_better_ruby.markdown
Created September 13, 2011 18:32
Better Rails Through Better Ruby

The Problem is Your Ruby

(Intro)

Stop Trying

Stop trying to be an expert at Rails.

Is it Hard?

@jasoncodes
jasoncodes / gist:1223731
Created September 17, 2011 07:45
Installing Ruby 1.9.3 with rbenv on OS X
# The latest version of this script is now available at
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh
VERSION=1.9.3-p286
brew update
brew install rbenv ruby-build rbenv-vars readline ctags
if [ -n "${ZSH_VERSION:-}" ]; then
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc
else
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
@danro
danro / pretty-date.js
Created October 16, 2011 06:45
JavaScript Pretty Date
/*
* JavaScript Pretty Date
* Copyright (c) 2008 John Resig (jquery.com)
* Licensed under the MIT license.
*/
// Takes an ISO time and returns a string representing how
// long ago the date represents.
// modified to return DD MM format instead of undefined.
@k33g
k33g / make-manifest.js
Created October 23, 2011 14:41
Nodejs script -> create manifest (cache)
var lib = require("./manifest.js");
lib.mkmanifest({
filename : "cache"
,path : "../coffee"
,version : "02"
,exclude : ['/.DS_Store', '/.htaccess', '/cache.manifest']
/*
,network : ['/connect.php','/read.php']
,fallback : ['/offline.html']
@peteonrails
peteonrails / geos
Created November 10, 2011 22:34
Updating the Homebrew formula for geos, when Mac OS X Lion complains about LLVM / gcc-4.2
require 'formula'
class Geos < Formula
url 'http://download.osgeo.org/geos/geos-3.3.1.tar.bz2'
homepage 'http://trac.osgeo.org/geos/'
md5 'b1ceefe205c9ee520b99f2b072c345f7'
def skip_clean? path
path.extname == '.la'
end
innerWidth / innerHeight tests @ http://sandbox.thewikies.com/orientation/
--------------------------------------------------------------------------------
Tested (14 devices, 28 browsers):
Droid 2 Global Android 2.2
iPhone 4 iOS5 (Safari, Opera Mini)
Motorola Atrix Android 2.3.4 (Stock browser, Dolphin, Skyfire, Opera Mini, Firefox)
Samsung Galaxy S9000 Android 2.3 (Webkit, Opera Mobile)
Samsung Galaxy Y Android 2.3.5
@kevinansfield
kevinansfield / 20111218135715_globalize_models.rb
Created December 21, 2011 12:17
Globalize3 support with tabs in Active Admin
# db/migrate/20111218135715_globalize_models.rb
class GlobalizeModels < ActiveRecord::Migration
def up
NewsItem.create_translation_table!(
{:title => :string, :body => :text},
{:migrate_data => true}
)
end
@bbonamin
bbonamin / event.rb
Created December 23, 2011 20:59
Globalize3 implementation on ActiveAdmin with nested forms
#app/models/event.rb
class Event < ActiveRecord::Base
translates :title, :description
has_many :event_translations
accepts_nested_attributes_for :event_translations, :allow_destroy => true
end