Skip to content

Instantly share code, notes, and snippets.

View colindensem's full-sized avatar
🏠
Working from home

Fynn.Codes colindensem

🏠
Working from home
View GitHub Profile
@colindensem
colindensem / introrx.md
Created June 12, 2016 19:15 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@colindensem
colindensem / Makefile
Last active August 29, 2015 14:21 — forked from h4cc/Makefile
#
# Ubuntu 14.04 LTS (Trusty Tahr)
#
# Basic packages i usually install
#
# Author: Julius Beckmann <github@h4cc.de>
#
.PHONY: all preparations update upgrade graphics darktable networking google_chrome dropbox archives media pandoc system harddisk docker ansible filesystem apache2 php mysql memcached mongodb tools encfs_manager nautilus httpie erlang elixir openoffice owncloud x230_fingerprint couchdb google-cloud-print-install google-cloud-print-setup
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
.run(['$cookies', 'user', 'forge', function($cookies, user, forge){
//Check for cookies.
var token = $cookies["X-Shrug-Token"];
if( token ) {
forge.sessions.get({id: token},
function success(data) {
user.login(data);
},
function error() {
@colindensem
colindensem / deploy.rake
Created November 1, 2012 10:47 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@colindensem
colindensem / Gemfile
Created April 4, 2012 17:47 — forked from simi/Gemfile
Refinery + Twitter Bootstrap WIP
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@colindensem
colindensem / generate_markets.rb
Created September 1, 2011 10:04 — forked from mbleigh/generate_markets.rb
The model and generation code to pull the 100 biggest US cities out as geographical models for a Rails app.
# Data culled from Wikipedia. Could be cleaner, but this is nice and simple.
major_cities = [["New York", "New York"], ["Los Angeles", "California"], ["Chicago", "Illinois"], ["Houston", "Texas"], ["Philadelphia", "Pennsylvania"], ["Phoenix", "Arizona"], ["San Antonio", "Texas"], ["San Diego", "California"], ["Dallas", "Texas"], ["San Jose", "California"], ["Jacksonville", "Florida"], ["Indianapolis", "Indiana"], ["San Francisco", "California"], ["Austin", "Texas"], ["Columbus", "Ohio"], ["Fort Worth", "Texas"], ["Charlotte", "North Carolina"], ["Detroit", "Michigan"], ["El Paso", "Texas"], ["Memphis", "Tennessee"], ["Baltimore", "Maryland"], ["Boston", "Massachusetts"], ["Seattle", "Washington"], ["Washington", "District of Columbia"], ["Nashville", "Tennessee"], ["Denver", "Colorado"], ["Louisville", "Kentucky"], ["Milwaukee", "Wisconsin"], ["Portland", "Oregon"], ["Las Vegas", "Nevada"], ["Oklahoma City", "Oklahoma"], ["Albuquerque", "New Mexico"], ["Tucson", "Arizona"], ["Fresno", "California"], ["Sacrame
@colindensem
colindensem / couchdb_attachments.rb
Created July 24, 2011 09:53 — forked from wildchild/couchdb_attachments.rb
Serving CouchDB attachments with Rails 3
module CouchDBAttachments
def attachment(*args)
lambda do |env|
request = ActionDispatch::Request.new(env)
doc = DocWithAttachments.get(request.params[:doc])
serve_attachment(doc, request.params[:path])
end
end
private
@colindensem
colindensem / rspec-syntax-cheat-sheet.rb
Created July 20, 2011 21:23 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh