Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@beakr
beakr / cow.rb
Created December 3, 2011 19:42
First Class. It butchers cows…
class Cow
@@num_legs_butchered = 0
def initialize(num_legs = 4)
@num_legs = num_legs
end
def legs
return @num_legs
end
@beakr
beakr / gist:1565283
Created January 5, 2012 13:34
Lisp test
(+ 4 5 )
(print "Hello world!")
@beakr
beakr / gist:1565348
Created January 5, 2012 13:52
Lisp math
;; Adding multiple nums ;;
(+ 2 3) ;; Adds 2 & 3 together...
(* 3 3) ;; 3 x 3, 9.
;; Just a lil' warm up...
(float (/ 7 10)) ;; Don't mistake all these semicolons for Javascript...*wink*
;; Algebra:
@beakr
beakr / gist:1634288
Created January 18, 2012 17:29
Terminal commands
$ cp ~/Downloads/sopa.vim .
@beakr
beakr / gist:1634406
Created January 18, 2012 17:41
SOPA theme instructions for Mac.
$ cd ~/.vim/colors
$ cp /downloads/sopa.vim .
@beakr
beakr / cuttlefish_test.rb
Created February 3, 2012 00:39
Cuttlefish test
require 'cuttlefish'
date = Cuttlefish::Date.new
date.generate
@beakr
beakr / col_align.css
Created February 10, 2012 22:02
Column align
.themes {
color : black;
width : 250px;
float: left;
}
.books {
color : black;
float: left;
width : 33%;
@beakr
beakr / optionsPage.js
Created February 27, 2012 18:26
A gist providing the code for handling and saving the statuses of checkboxes using localStorage.
$(function(){
// Get settings from local storage
var settings_pronounceable = localStorage.getItem("settings_pronounceable") == "true";
var settings_capitals = localStorage.getItem("settings_capitals") == "true";
var settings_numbers = localStorage.getItem("settings_numbers") == "true";
var settings_symbols = localStorage.getItem("settings_symbols") == "true";
// Configure settings display with values from local storage, or use defaults
$("#settings_pronounceable").prop("checked", settings_pronounceable);
@beakr
beakr / rounded_field.css
Created March 6, 2012 19:55
Rounded text fields
my_field {
border-radius: 5px;
height: 20px; width: 200px;
padding: 3px 10px;
}
@beakr
beakr / init.rb
Created March 22, 2012 19:19
Initialize
def initialize
@moos = moos
@oinks = oinks
@clucks = clucks
end