Skip to content

Instantly share code, notes, and snippets.

View vosechu's full-sized avatar

Chuck Lauer Vose vosechu

View GitHub Profile
@vosechu
vosechu / Sublime Config
Last active April 19, 2016 22:57
Sublime Preferences
{
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/User/SublimeLinter/Solarized (Light) (SL).tmTheme",
"detect_slow_plugins": false,
"dictionary": "Packages/Language - English/en_US.dic",
"draw_indent_guides": true,
"ensure_newline_at_eof_on_save": false,
"file_exclude_patterns":
[
@vosechu
vosechu / gist:6176479
Created August 7, 2013 17:39
Quick email class for Rebecca and Hakimu
class Email
def initialize
Pony.options = { :from => '[email protected]', :via => :smtp, :via_options => { :host => 'smtp.yourserver.com' } }
end
def self.email_admins
opts = {
:to => ['[email protected]', '[email protected]'],
:from => '[email protected]',
:subject => 'hi',
@vosechu
vosechu / gist:5985859
Last active December 19, 2015 16:39
Sample inputs for cipher breaker code challenge
Sample 1:
d jrrg jodvv lq wkh elvkrsv krvwho lq wkh ghylov vhdw vwrs iruwb rqh ghjuhhv dqg wkluwhhq plqxwhv qruwkhdvw dqg eb qruwk vwrs pdlq eudqfk vhyhqwk olpe hdvw vlgh vkrrw iurp wkh ohiw hbh ri wkh ghdwkv khdg vwrs d ehh olqh iurp wkh wuhh wkurxjk wkh vkrw iliwb ihhw rxw vwrs
Sample 2:
y xqlu tufeiyjut yd jxu sekdjo ev rutveht qrekj vekh cybui vhec rkvehti yd qd unsqlqjyed eh lqkbj iyn vuuj rubem jxu ikhvqsu ev jxu whekdt jxu vebbemydw qhjysbui rubedwydw zeydjbo je jxu fqhjyui mxeiu dqcui qhu wylud yd dkcruh jxhuu xuhumyjx jxu vyhij tufeiyj sediyijut ev jud xkdthut qdt vekhjuud fekdti ev webt qdt jxyhjo uywxj xkdthut qdt jmublu fekdti ev iybluh tufeiyjut del ijef uywxjuud dydujuud ijef jxu iusedt mqi cqtu tus ijef uywxjuud jmudjo edu qdt sediyijut ev dydujuud xkdthut qdt iulud fekdti ev webt qdt jmublu xkdthut qdt uywxjo uywxj ev iybluh ijef qbie zumubi erjqydut yd ij ijef bekyi yd unsxqdwu veh iybluh je iqlu jhqdifehjqjyed qdt lqbkut qj jxyhjuud jxekiqdt tebbqhi ijef jxu qrelu yi iuskhubo fqsaut yd yhed
@vosechu
vosechu / scrabble.rb
Created June 13, 2013 18:13
Scrabble scorer via regex
module ScrabbleScorer
POINTS = {
/[aeiou]/ => 1,
/[j]/ => 8,
/[qx]/ => 10
}
def self.score(word)
sum = 0
POINTS.each do |key, value|
sum += word.scan(key).length * value
@vosechu
vosechu / gist:5710491
Created June 4, 2013 23:26
Factorial call tree
def factorial num
if num == 1
return 1
else
return num * factorial(num-1)
end
end
factorial(5)
5 * factorial(4)
@vosechu
vosechu / test_hq9f.rb
Created May 27, 2013 19:30
Test-first code to create an interview question object
require 'minitest/autorun'
class TestHQ9F < MiniTest::Unit::TestCase
def test_h
# assert_output takes a block. Anything that is output inside the
# block is captured and matched.
assert_output "Hello World!\n" do
h
end
end
@vosechu
vosechu / gist:5658490
Last active December 17, 2015 19:09
Dog/cat get in fight
class Dog
def bark_at(cat)
"Curse you #{cat}!!"
end
end
class Cat
def initialize(name)
@name = name
end
@vosechu
vosechu / gist:5384468
Created April 14, 2013 22:14
IRC in Adium instructions
Account settings / new connection:
http://d.pr/i/e62O
Joining a chat:
http://d.pr/i/pmGV
http://d.pr/i/iUm7
Turning off join/leave messages once you've joined a chat:
http://d.pr/i/8bMG
@vosechu
vosechu / gist:5238890
Created March 25, 2013 17:27
Adium settings for IRC
Account settings / new connection:
http://d.pr/i/e62O
Joining a chat:
http://d.pr/i/pmGV
http://d.pr/i/iUm7
Turning off join/leave messages once you've joined a chat:
http://d.pr/i/8bMG
@vosechu
vosechu / cah.sh
Last active December 14, 2015 15:49
(NSFW) Generator for a Cards Against Humanity Rails app for use in the Portland Code School
export DB_UN="root"
export DB_PW=""
gem install rails
rails new humanitywar-rails --skip-test-unit --skip-bundle --database=mysql
cd humanitywar-rails
echo "gem 'haml-rails'" >> Gemfile
echo "group :development, :test do
gem 'rspec-rails'
end" >> Gemfile
bundle