This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_superman() { | |
return true; | |
} | |
function superman_inf() { | |
return "∞"; | |
} | |
$(function () { | |
var titleunhover = function () { | |
$(this).find("a.title").next("a.censor").remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a diagonal matrix given a vector (or an array), placing the entries | |
# of the vector on the diagonal of the matrix. | |
# For example, diag([1,2,3]) would give: | |
# [ 1 0 0 ] | |
# [ 0 2 0 ] | |
# [ 0 0 3 ] | |
# That would actually be a 2D matrix like this [[1, 0, 0], [0, 2, 0], [0, 0, 3]] | |
# The array returned has to be converted to a matrix by doing | |
# Matrix[ *diag(vector) ] | |
def diag(vector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_matrix(size) | |
Array.new(size) { Array.new(size) { rand 10 } } | |
end | |
# Only for 3x3 matrices for the time being | |
# Refactor! | |
def determinant(matrix) | |
(matrix[0][0] * ((matrix[1][1] * matrix[2][2]) - (matrix[2][1] * matrix[1][2]))) - (matrix[0][1] * ((matrix[1][0] * matrix[2][2]) - (matrix[2][0] * matrix[1][2]))) + (matrix[0][2] * ((matrix[1][0] * matrix[2][1]) - (matrix[2][0] * matrix[1][1]))) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
## TODO: While refactoring, perform all calculations _out_ of this file. | |
# Function to easily give out something like "The reviewer noted the following: The board looks great!" | |
def noted(a, t) | |
t == '' ? '' : 'The reviewer ' + a + ' the following: ' + t | |
end | |
def yes | |
'[img]http://s242.photobucket.com/albums/ff244/9861_omikron/famfamfamsilk/accept.png[/img] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Rufus = { | |
Mnemo: { | |
/** CONSTANTS **/ | |
V: [ 'a', 'e', 'i', 'o', 'u' ], | |
C: [ 'b', 'd', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'r', 's', 't', 'z' ], | |
SYL: [], // This is populated later on. [1] | |
SPECIAL: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sinatra | |
haml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w[ | |
rubygems | |
sinatra | |
dm-core | |
dm-timestamps | |
].each { |lib| require lib } | |
get '/' do | |
"You aren't supposed to be viewing this." | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def every(delay) | |
loop do | |
sleep(delay) | |
yield | |
end | |
end | |
def beep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyAwesomeClass | |
attr_accessor :awesome_instance_variable | |
def initialize(var) | |
@awesome_instance_variable = var | |
end | |
def reverse! | |
@awesome_instance_variable = @awesome_instance_variable.reverse | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jConsole = { | |
init: function() { | |
holder = document.createElement("div") | |
holder.setAttribute("style", "height: 250px; background: #000000; color: #ffffff; opacity: 0.4; position: static;") | |
document.body.appendChild(holder) | |
} | |
} | |
jConsole.init() |