Skip to content

Instantly share code, notes, and snippets.

@EricR
EricR / fetlife_erlang_engineer.erl
Last active August 29, 2015 14:05
Silly little job applicant program
-module(fetlife_erlang_engineer).
-compile(export_all).
start_interviewer() ->
spawn(?MODULE, interviewer, []).
apply_for_job(Level) ->
Ref = make_ref(),
interview ! {self(), Ref, {skillz, Level}},
receive
104.131.107.113 25565
@EricR
EricR / gist:9022b368b814b1374181
Created September 28, 2014 00:08
backup_failure.txt
Starting 2014_09_27 mysql full backup at hour 04_01
Backup filename 2014_09_27.tar.lzo
Finished with success 2014_09_27 mysql backup at hour 06_29
Mysql backup is written in root@backup.sea.pro:/disk3/mysql-backups/2014_09_27.tar.lzo
Beginning to Test 2014_09_27 full backup 2014_09_27.tar.lzo at 06_29
+ backup_type=full
+ filename=2014_09_27.tar.lzo
+ backup_date=2014_09_27
++ date +%Y_%m_%d
+ today=2014_09_27
@EricR
EricR / caesar.rb
Created November 22, 2011 03:30
Caesar Cypher in Ruby
class Caesar
def self.encrypt(shift, message)
apply_algorithm(:encrypt, shift, message)
end
def self.decrypt(shift, message)
apply_algorithm(:decrypt, shift, message)
end
private
fred = Person.new
fred.thing # returns "I'm a person!"
joe = Person.new
joe.name = "Joe Smith"
joe.name # returns "Joe Smith"
class Person
def thing
"I'm a person!"
end
end
return @name
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: raptor [app_directory] [options]"
end.parse!
class ProjectParser
def initialize
set_project_directory
@EricR
EricR / fizzbuzz.go
Last active December 15, 2015 09:39
FizzBuzz using `switch`, as per exercise of "The Way to Go".
// fizzbuzz
// A program that counts from 1 to 100, replacing numbers divisible by 3 with "Fizz",
// those divisible by 5 with "Buzz", and those divisble by both 3 and 5 with "FizzBuzz".
package main
import "fmt"
import "strconv"
func main() {