Skip to content

Instantly share code, notes, and snippets.

View dwayne's full-sized avatar

Dwayne Crooks dwayne

View GitHub Profile
@dwayne
dwayne / continued-fractions.rkt
Created August 31, 2011 18:41
Useful functions for working with continued fractions
#lang racket
(define (continued-fraction p q)
(letrec ([cf (lambda (p q)
(cond [(= p 1) (list q)]
[(< p q)
(cons (quotient q p)
(cf (remainder q p) p))]
[else
(cons (quotient p q)
@dwayne
dwayne / playwhe.rb
Created May 26, 2012 09:09
Get Play Whe results using Ruby
require 'net/http'
month = 'Apr' # Mmm
year = '11' # yy
host = 'nlcb.co.tt'
path = 'search/pwq/countdateCash.php'
uri = URI("http://#{host}/#{path}")
@dwayne
dwayne / index.coffee
Created June 2, 2012 12:12
A way to structure CoffeeScript applications
# References
# * https://github.com/sstephenson/stitch
# * http://arcturo.github.com/library/coffeescript/06_applications.html
# A possible directory structure
#
# app [application code]
# |-- model
# |-- view
# |-- controller
@dwayne
dwayne / .excludes
Created June 11, 2012 08:27
Deploying Sinatra/Thin to WebFaction
# Exclude files that don't need to be on the server
# Used by rsync when deploying code to the server
.excludes
.git
.gitignore
log/
tmp/
@dwayne
dwayne / 00-install-on-64-bit-ubuntu-14.04.md
Last active January 12, 2024 17:48
Installing node and npm on Ubuntu 12.04 LTS and 64-bit Ubuntu 14.04 LTS.
  1. Navigate to http://nodejs.org/download/ and on the Linux Binaries (.tar.gz) row click to download the 64-bit version of the current latest release.

  2. Say you've downloaded node-v0.10.7-linux-x64.tar.gz into the Downloads directory. Then, open the terminal and type the following:

$ cd ~/Downloads
$ mkdir -p ~/local/node
$ tar xzf node-v0.10.7-linux-x64.tar.gz -C ~/local/node --strip-components=1
$ echo '# Node Enviroment Setup' >> ~/.bashrc
$ echo 'export PATH=$HOME/local/node/bin:$PATH' &gt;&gt; ~/.bashrc
@dwayne
dwayne / gedit-setup.md
Created June 24, 2012 18:26
My Gedit setup
@dwayne
dwayne / .nanorc
Created June 27, 2012 12:14
Setting up nano
set autoindent
set tabsize 2
@dwayne
dwayne / git-setup.md
Last active December 24, 2016 23:30
Setting up Git

Git Quick Start

Install git

$ sudo apt-get install git

User settings

$ git config --global user.name "Dwayne R. Crooks"

$ git config --global user.email "me@dwaynecrooks.com"

@dwayne
dwayne / django-quickly.md
Created July 21, 2012 11:16
Getting up and running with Django as quickly as possible

Django Quick Start

Create a directory for Python development

$ mkdir -p ~/sandbox/python
$ cd ~/sandbox/python

Setup a virtual Python environment (http://pypi.python.org/pypi/virtualenv/)

$ sudo apt-get install curl

@dwayne
dwayne / rvm-ruby-install.md
Last active October 7, 2015 14:38
Installing RVM and Ruby on Ubuntu 12.04/13.04
  1. Install RVM. See http://rvm.io/rvm/install for details.

    IMPORTANT: Add to .bashrc the following

     # Load RVM into a shell session *as a function*
     [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
    
  2. Install a version of Ruby.

$ rvm install 2.1