Skip to content

Instantly share code, notes, and snippets.

@thenickcox
thenickcox / project_euler_1.rb
Created November 17, 2012 05:51
Project Euler Problem 1
# solves http://projecteuler.net/problem=1
# not the shortest solution, but one with a more versatile and reusable method
def divisibles(up_to, divisible_by_a, divisible_by_b)
rangeArray = (1..(up_to -1)).to_a
just_multiples = []
rangeArray.each do |x|
if ( x % divisible_by_a == 0 || x % divisible_by_b == 0 )
just_multiples << x
end
@thenickcox
thenickcox / project_euler_1a.rb
Created November 17, 2012 06:11
Project Euler Problem 1 Quick and Dirty
multiples = []
(1..999).to_a.each { |x| multiples << x if x % 3 == 0 || x % 5 == 0 }
multiples.inject { |x, sum| sum + x }
# => 233168
@thenickcox
thenickcox / vimrc
Last active December 14, 2015 03:09
My .vimrc
set nocompatible
filetype off
syntax enable
" Set , to be leader key
let mapleader = ","
set background=dark
colorscheme Monokai
set guifont=Monaco:h12
$ mvim ~/.vim/bundle/
Rename/ ctrlp.vim/ supertab/ vim-coffee-script/ vim-repeat/ vim-unimpaired/
ZoomWin/ nerdcommenter/ tlib_vim/ vim-fugitive/ vim-snipmate/ vundle/
ack.vim/ snipmate-snippets/ vim-addon-mw-utils/ vim-rails/ vim-surround/
# create rvmrc file
create_file ".rvmrc", "rvm gemset use #{app_name}"
# Because Rails always seems to fail without it locally
gem 'pysch'
gem "haml-rails"
# hpricot and ruby_parser required by haml
gem "hpricot", :group => :development
@thenickcox
thenickcox / solarized-dark-modified.itermcolors
Last active December 15, 2015 05:09
A modified version of the Soliarized theme for iTerm2, which makes the greens, blues, and yellows truer. Now with better highlighting.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC20kexRfWivkFMn1tE45j1lvA3pUEkBGRfj9bwO781m9BZKqTce1h3tOY8NkZRBdjO1K+CJzWWYa3MC6FnzfCWQ8MHvX2s/eastSAtW8VHMw7uiCZGJaZ8VBpafv3FHob5pS1K8NlniuvI4myUMc370vlQ6blLh3rF2ewENHhB1I1ZGk1hEpOnCDZZxvDFPRk8fjj72ajpGinhZGUsgTnjeSiJNidJEEeMyXvhovt098fY9kjr0ti5LnYTdpG4N3iErxHKvC5EVYCGYZxoVkAaR2Ky9hkc+zAg1ZkFBGnnWSUQzu0r6XObSnhW3oA2JGBZ++AMvX/3iisBrzD4ANEx GitHub@thenickcox
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKOX5Ju9rCfOA5gIBcNM/rtbDgZZtVRhWE3/vxFswstVCbRZ1iPm+8BUfNciwCCYeuBVKB1Se2e94b+2WVtq9CiTrxieAf4zed+kre4+JjY3LU3QWEYzBIjK9Ec6vSNvy6Idlq5HkPWmRfAjCzW6neky8V2YG5t378KDOHTt5u0kE/e+hqxXdY9T0PYgKZsQIeVn4x6upxTKv2seltVbtVGv7HwDCWppy/sFzAB5kvBj+gQFtR0loIqB50ZoLI1W6vadqpDsZnvoq6YrEDF3b40VMmWeDHPOmH8ckFvPR2HsbPWyZGUC4vQErqvM1q4M/l1UbtEhQJTVlyDYOWcT7D macbookpro@Nick-Coxs-Macbook-Pro.local
@thenickcox
thenickcox / Interview Questions
Last active December 18, 2015 18:29
Questions I would want to ask a company
#Questions I would Have About a Company
* How would you describe your code review process?
* Do you practice pair programming?
* What does professional development look like in your organization? Is there a budget for books, conferences, etc.?
Apple_PubSub_Socket_Render=/tmp/launch-FRCk2R/Render
Apple_Ubiquity_Message=/tmp/launch-vyS1ut/Apple_Ubiquity_Message
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_REMATCH=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="2" [2]="48" [3]="1" [4]="release" [5]="x86_64-apple-darwin11")
BASH_VERSION='3.2.48(1)-release'