Skip to content

Instantly share code, notes, and snippets.

View nordringrayhide's full-sized avatar

Nodrin Grayhide nordringrayhide

  • home
  • Worldwide
View GitHub Profile
@willurd
willurd / web-servers.md
Last active May 13, 2025 13:11
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@oivoodoo
oivoodoo / routes.rake
Created March 5, 2013 10:06
rake task for printing grape routes.
namespace :grape do
desc 'Print compiled grape routes'
task :routes => :environment do
API.routes.each do |route|
puts route
end
end
end
@ngauthier
ngauthier / README.md
Last active December 8, 2023 13:56
install ruby 2.0.0-p0 on ubuntu
@robertsosinski
robertsosinski / db.rake
Created December 25, 2012 15:23
Database rake tasks for Sequel
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
@scottandrus
scottandrus / gist:4081316
Created November 15, 2012 21:15
AFNetworking Image Downloads with Download Progress Block
- (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];
@nordringrayhide
nordringrayhide / vimify.sh
Created March 19, 2012 09:16
My vimrc file
#!/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
@finack
finack / application.rb
Created March 17, 2012 06:18
Example Chef Deploy Revision for Rails 3+
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]
@fetep
fetep / config
Created March 6, 2012 14:45
sample logstash config for rails log line
input {
stdin {
type => rails
}
}
filter {
grok {
type => "rails"
pattern => "Completed %{GREEDYDATA:operation} in %{NUMBER:time:int}ms"
@manuelvanrijn
manuelvanrijn / database.rake
Created January 19, 2012 14:54
Retrieve and convert PostgreSQL database to SQLite database (with ssh)
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
@xeron
xeron / haproxy.cnf
Created September 21, 2011 16:50 — forked from asabirov/haproxy.cnf
haproxy.cnf
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