Skip to content

Instantly share code, notes, and snippets.

@chriseppstein
chriseppstein / unique.rb
Created May 27, 2013 19:59
Sass function that returns a unique value each time it is called within the scope of a single css file compilation.
module Sass::Script::Functions
def unique
options[:unique_values] ||= Set.new
r = rand(100000)
r = rand(100000) while options[:unique_values].include?(r)
options[:unique_values] << r
Sass::Script::String.new("u#{r.to_s(36)}") #we add a u to the font to ensure this is a legal css identifier.
end
end
@EtienneDepaulis
EtienneDepaulis / Gemfile
Created April 23, 2013 08:25
Intégration de Paymill dans une appli Rails + Twitter Bootstrap
gem "paymill"
@simonjodet
simonjodet / iPhoto_launcher.sh
Last active December 11, 2015 18:48
This code mounts the USB Hard Drive where the iPhoto library is stored, launch iPhoto then unmount the drive when iPhoto is closed.
VOL='/dev/'$(diskutil list | grep -Eo '.*Apple_HFS Pictures.*' | grep -Eo 'disk.s.')
hdiutil mountvol $VOL
open -W /Applications/iPhoto.app
hdiutil detach $VOL
@lukaskonarovsky
lukaskonarovsky / gist:3924338
Created October 20, 2012 18:58
SSH SOCKS proxy script for OS X inspired by goulas
#!/bin/bash
# add yourself before use to sudoerrs
# Cmnd_Alias PROXY = /usr/sbin/networksetup -setsocksfirewallproxy*
# your_login ALL=NOPASSWD: PROXY
SSH_HOST="somehostname"
PORT=9999 # configured in System Preferences
NET_SERVICE="Wi-Fi" # on MacBook Air
SSH_OPTS="-C2qTnNfD"
@catwell
catwell / active.md
Last active December 21, 2023 09:47
Speakerdecks
@mikhailov
mikhailov / ruby_gc.sh
Created March 11, 2011 10:33
Ruby’s GC Configuration
- http://www.coffeepowered.net/2009/06/13/fine-tuning-your-garbage-collector/
- http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
article’s settings: ("spec spec" took 17-23!sec)
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_INCREMENT=100000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=30000000
export RUBY_HEAP_FREE_MIN=12500