Skip to content

Instantly share code, notes, and snippets.

View blithe's full-sized avatar

Blithe Rocher blithe

View GitHub Profile
@blithe
blithe / .zshrc
Last active October 5, 2015 16:03 — forked from burtlo/.zshrc
This is a shortcut to change into my journal directory, create a new article, and then immediately start editing it.
read () {
open "http://blitherocher.com"
}
article () {
# change in to the directory where I keep my journal project
cd /projects/personal_projects/personal_site
echo "Creating article '$@'"
@blithe
blithe / FizzBuzz.js
Created January 31, 2013 18:53
FizzBuzz in JavaScript
// for the numbers 1 through 20,
for (i=1; i<=100; i++) {
// if the number is divisible by both 3 and 5, write "FizzBuzz"
if ( i % 3 ==0 && i % 5 == 0 ) {
console.log("FizzBuzz");
}
// if the number is divisible by 3, write "Fizz"
else if ( i % 3 === 0 ) {
@blithe
blithe / FizzBuzz.rb
Created January 31, 2013 18:43
FizzBuzz in Ruby
def FizzBuzz
# for numbers 1 to 100, print Fizz for multiples of 3, Buzz for multiples of 5, FizzBuzz for both
(1..100).each do |n|
print "#{n} = "
if n % 3 == 0 && n % 15 == 0
puts "FizzBuzz"
elsif n % 5 == 0
puts "Buzz"
elsif n % 3 == 0
puts "Fizz"