Skip to content

Instantly share code, notes, and snippets.

@thenoseman
thenoseman / git-aliasses
Created February 16, 2011 21:40
My git aliasses
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.st status
@shaliko
shaliko / gist:963270
Created May 9, 2011 20:06
git config
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
@marzocchi
marzocchi / config.ru
Created July 1, 2011 09:15
Run Symfony apps with Rack (rackup! pow!)
# vim:se filetype=ruby
# vim:se foldlevel=3
#
# Hacks and monkeys to run Symfony 1.4 applications as Rack apps using
# the rack-legacy and rack-rewrite gems.
#
# A couple of rack-rewrite rules take care of handing requests to the
# default front controller (index.php) and a subclass of rack-legacy's
# Php fixes PATH_INFO for Symfony routing.
#
@pweldon
pweldon / install_rabbitmq_management.sh
Created October 13, 2011 20:26
Install rabbitmq_management plugins
#!/bin/bash
set -e
cd /usr/lib/rabbitmq/lib/rabbitmq_server-2.6.1/plugins
wget \
--timestamping \
http://www.rabbitmq.com/releases/plugins/v2.6.1/\
{\
mochiweb-1.3-rmq2.6.1-git9a53dbd.ez,\
@thermistor
thermistor / assets.rake
Created October 20, 2011 13:55 — forked from shedd/assets.rake
Check asset encoding for valid UTF-8
namespace :assets do
desc "Check that all assets have valid encoding"
task :check => :environment do
paths = ["app/assets", "lib/assets", "vendor/assets"]
extensions = ["js", "coffee", "css", "scss"]
paths.each do |path|
dir_path = Rails.root + path
@coodix
coodix / CIAN.RU Add photos at List page
Last active December 16, 2015 07:59
Add flat photos thumbnails with zoom by mouseover at search result page at cian.ru Run this js code in browser console at cian.ru search result page
$.getScript('http://cdn.jsdelivr.net/jquery.lazyload/1.8.4/jquery.lazyload.js', function() {
var $popup = $('<div></div>').css({
position: 'fixed'
});
$('body').append($popup);
$('a[href*="/rent/flat/"]').lazyload({
threshold : 200,
appear: function(elements_left, settings) {
var $container = $(this).closest('div');
$.get($(this).attr('href'), function (data) {
@mudge
mudge / unicorn.conf.rb
Last active February 9, 2017 21:55
Unicorn configuration for Rails 3.2 application to log to a different file per worker (to stop logs interleaving with one another).
after_fork do |server, worker|
# Override the default logger to use a separate log for each Unicorn worker.
# https://github.com/rails/rails/blob/3-2-stable/railties/lib/rails/application/bootstrap.rb#L23-L49
Rails.logger = ActiveRecord::Base.logger = ActionController::Base.logger = begin
path = Rails.configuration.paths["log"].first
f = File.open(path.sub(".log", "-#{worker.nr}.log"), "a")
f.binmode
f.sync = true
logger = ActiveSupport::TaggedLogging.new(ActiveSupport::BufferedLogger.new(f))
@bhyde
bhyde / establish-routing-to-boot2docker-container-network
Last active November 2, 2019 18:59
Boot2docker - teach the mac how to connect to the containers by adjusting it's routing.
#!/bin/bash
# Script to instruct the Mac how to route packets to the
# software defined network where containers created via boot2docker
# reside. This lets you casually directly to ports (ssh, http, etc. etc.)
# on those containers.
function ERROR(){ echo "ERROR: $*" ; }
function FAIL(){ echo "FAILING: $*" ; exit 1; }
if [[ 'running' != $(boot2docker status) ]]
then FAIL "boot2docker's VM not running" ; fi
IP_OF_DOCKER_HOST=$(boot2docker ip 2> /dev/null)
@mtrovilho
mtrovilho / Aircrack Commands
Last active January 11, 2020 21:08 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
// Install the latest Xcode, with the Command Line Tools.
// Install Homebrew
// Install aircrack-ng:
brew install aircrack-ng
// Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/sbin/airport
// Figure out which channel you need to sniff:
sudo airport -s
@technicalpickles
technicalpickles / deploy.rb
Created August 28, 2009 04:57
Capistrano recipe for using yaml_db to pull data into local database
namespace :db do
task :pull do
run "cd #{current_release} && RAILS_ENV=#{rails_env} rake db:data:dump"
download "#{current_release}/db/data.yml", "db/data.yml"
`rake db:reset db:data:load`
end
end