Skip to content

Instantly share code, notes, and snippets.

View coty's full-sized avatar

Coty Rosenblath coty

View GitHub Profile
#!/usr/bin/env python
import os
import sys
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]
@coty
coty / better_logger.rb
Created October 18, 2012 06:25 — forked from indirect/better_logger.rb
Rails 3 logs with severity and PIDs
# You must require this file in application.rb, above the Application
# definition, for this to work. For example:
#
# # Syslog-like Rails logs
# if Rails.env.production?
# require File.expand_path('../../lib/better_logger', __FILE__)
# end
#
# module MyApp
# class Application < Rails::Application
@coty
coty / gist:2423766
Created April 19, 2012 20:00 — forked from munhitsu/gist:1034876
python 2.7 install on OSX (10.6.7) using brew (pip, easy_install, virtualenv, virtualenvwrapper)
#NOTE: .pydistutils.cfg seems to be not compatible with brew install python
#areas I needed to clean before installation
#clean up ~/Library/Python
#clean up .local
brew install python --framework
easy_install pip
pip install virtualenv
pip install virtualenvwrapper
mkdir $HOME/.virtualenvs
@coty
coty / deploy.rb
Created April 18, 2012 13:47 — forked from netzpirat/deploy.rb
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
@coty
coty / hack.sh
Created April 1, 2012 19:46 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@coty
coty / gist:2167303
Created March 23, 2012 05:39 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@coty
coty / installation.sh
Created March 13, 2012 22:01 — forked from mikhailov/installation.sh
Nginx+passenger application config: ssl redirection, http headers, passenger optimal settings. see details: http://mikhailov.posterous.com/nginx
$ cd /usr/src
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz
$ tar xzvf ./nginx-0.8.52.tar.gz
$ rm ./nginx-0.8.52.tar.gz
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc
$ passenger-install-nginx-module
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52
# Where do you want to install Nginx to?: /opt/nginx
@coty
coty / snippet.rb
Created January 10, 2012 15:21 — forked from indirect/snippet.rb
Rack middleware so NewRelic shows time as ruby
# This adds a request header so NewRelic knows when the middleware stack
# started processing. Hopefully this means we'll get better metrics, split
# between actual request queueing and time spent in the middlewares.
module Plex
class MiddlewareStart
def initialize(app)
@app = app
end
def call(env)
@coty
coty / .irbrc
Created November 29, 2011 04:22 — forked from adamcrown/.irbrc
My Bundler proof .irbrc file including wirble, awesome_print, hirb, console logging and route helpers
require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
def unbundled_require(gem)
loaded = false
if defined?(::Bundler)
Gem.path.each do |gems_path|
gem_path = Dir.glob("#{gems_path}/gems/#{gem}*").last
@coty
coty / crosenblath.json
Created October 3, 2011 14:59
Hacker Hub Profile
{
"settings" : {
"id" : "coty",
"name" : "Coty Rosenblath",
"avatar" : "https://twimg0-a.akamaihd.net/profile_images/60343034/Head_Shot_reasonably_small.jpg",
"enable_search" : true
},
"content" : {
"twitter":{
"title" : "Coty's Twitter",