This is copy of Debugging with ipython and ipdb.
- http://pypi.python.org/pypi/setuptools/
- Try to run
which easy_install
- Should return something like: /usr/local/share/python/easy_install
#! /usr/bin/env python2 | |
# Requires: PIL, colormath | |
# | |
# Improved algorithm now automatically crops the image and uses much | |
# better color matching | |
from PIL import Image, ImageChops | |
from colormath.color_conversions import convert_color | |
from colormath.color_objects import LabColor | |
from colormath.color_objects import sRGBColor as RGBColor |
upstream unicorn { | |
server unix:/tmp/unicorn.app.sock fail_timeout=0; | |
} | |
# HTTP server | |
# | |
server { | |
listen localhost:8080; | |
server_name app.me; |
license: gpl-3.0 |
This is copy of Debugging with ipython and ipdb.
which easy_install
# 1.install gource using HomeBrew | |
$ brew install gource | |
# 2.install avconv | |
git clone git://git.libav.org/libav.git | |
cd libav | |
# it will take 3-5 minutes to complie, be patient. | |
./configure --disable-yasm | |
make && make install |
Person:
#!/bin/bash | |
#encrypt files with aes-256-cbc cipher using openssl | |
#install: | |
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc | |
# sudo chmod +x /usr/bin/enc | |
# enc --help | |
#encrypt files | |
if [ $1 == "-e" ]; | |
then |
# DelayedJob | |
@user.delay.activate!(@device) # Delay any object | |
Notifier.delay.signup(@user) # Delay ActionMailer | |
#DelayedJob supports a number of ways to make methods async | |
def send_mailer | |
# Some other code | |
end | |
handle_asynchronously :send_mailer, :priority => 20 |
module ActiveRecord::UnionScope | |
def self.included(base) | |
base.send :extend, ClassMethods | |
end | |
module ClassMethods | |
def union_scope(*scopes) | |
id_column = "#{table_name}.#{primary_key}" | |
sub_query = scopes.map { |s| s.select(id_column).to_sql }.join(" UNION ") | |
where "#{id_column} IN (#{sub_query})" |
Because loading gems can take longer than you think
Now available as a gem - get it here