Because loading gems can take longer than you think
Now available as a gem - get it here
/* ============================================================= | |
* bootstrap-typeahead.js v2.2.2 | |
* http://twitter.github.com/bootstrap/javascript.html#typeahead | |
* ============================================================= | |
* Copyright 2012 Twitter, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
# Add these two gems | |
gem 'ice_cube', '0.9.3' | |
gem 'squeel', '1.0.16' |
Because loading gems can take longer than you think
Now available as a gem - get it here
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})" |
# 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 |
#!/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 |
Person:
# 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 |
This is copy of Debugging with ipython and ipdb.
which easy_install
license: gpl-3.0 |