Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
namespace :grape do | |
desc 'Print compiled grape routes' | |
task :routes => :environment do | |
API.routes.each do |route| | |
puts route | |
end | |
end | |
end |
Installs ruby-2.0.0-p0 on ubuntu via checkinstall so it's in your package manager and you can remove it.
Quick install:
curl -L https://gist.github.com/ngauthier/5039249/raw/1868bf4714052b40e2bb7fdf3f40fbeb5d730bca/ruby-2-install-ubuntu.sh | bash -s
namespace :db do | |
desc "Migrates the database to the target version, or to the lastest version if no target is given" | |
task :migrate, [:target, :current] => :environment do |t, args| | |
opts = {} | |
opts[:target] = args[:target].to_i if args[:target] | |
opts[:current] = args[:current].to_i if args[:current] | |
Sequel::Migrator.run(DB, "db/migrate", opts) | |
Rake::Task["db:dump"].invoke if Rails.env.development? | |
end |
- (void)downloadMultiAFN { | |
// Basic Activity Indicator to indicate download | |
UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; | |
[loading startAnimating]; | |
[self.imageView.superview addSubview:loading]; | |
loading.center = self.imageView.center; | |
// Create a request from the url, make an AFImageRequestOperation initialized with that request | |
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.picUrl]]; | |
AFImageRequestOperation *op = [[AFImageRequestOperation alloc] initWithRequest:request]; |
#!/bin/sh | |
mkdir -p ~/.vim/bundle/vundle | |
git clone git://github.com/gmarik/vundle.git ~/.vim/bundle/vundle | |
wget https://raw.github.com/gist/2104598/fb27ed1e0434575ede483df96692d93a626b1116/vimrc-with-vandle-support.vim \ | |
-O ~/.vimrc | |
vim +BundleInstall +qall |
app = node[:rails][:app] | |
rails_base app[:name] do | |
ruby_ver app[:ruby_ver] | |
gemset app[:gemset] | |
end | |
%w{config log pids cached-copy bundle system}.each do |dir| | |
directory "#{app[:app_root]}/shared/#{dir}" do | |
owner app[:deploy_user] |
input { | |
stdin { | |
type => rails | |
} | |
} | |
filter { | |
grok { | |
type => "rails" | |
pattern => "Completed %{GREEDYDATA:operation} in %{NUMBER:time:int}ms" |
require 'fileutils' | |
namespace :db do | |
desc 'pull the production PostgreSQL database into the development SQLite' | |
task :pull do | |
Rake::Task['db:download_pg_dump'].invoke | |
Rake::Task['db:optimze_pg_dump_for_sqlite'].invoke | |
Rake::Task['db:recreate_with_dump'].invoke | |
end |
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local0 notice | |
maxconn 4096 | |
nbproc 1 | |
pidfile /var/run/haproxy.pid | |
user haproxy | |
group haproxy |