This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
<html> | |
<head> | |
<title>Velox: Random Latin Words</title> | |
<style type="text/css"> | |
p { | |
font-family: Georgia,Palatino,Times,'Times New Roman',sans-serif; | |
} | |
a:link, a:visited { | |
color: #f30; | |
font-size: 75%; |
This file contains hidden or 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
5 3 | |
7 4 | |
5 3 | |
10 1 | |
7 4 | |
6 2 | |
2 2 | |
2 1 | |
1 1 | |
13 13 |
This file contains hidden or 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 PriorityQueue | |
def initialize | |
@pq = [] | |
@sorted = true | |
end | |
def push(object, priority) | |
@pq << [ object, priority ] | |
@sorted = false | |
end |
This file contains hidden or 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
groove_fanatics:boolean | |
synchronians:boolean | |
synchronians_group_name:string | |
charlie_madchap:boolean | |
charlie_madchap_group_name:string | |
band_slam:boolean | |
band_slam_group_name:string | |
alaap:boolean | |
instrumania:boolean | |
instrumania_instrument_name:string |
This file contains hidden or 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 AgendaTableViewController < UITableViewController | |
def tableView(tableView, numberOfRowsInSection:section) | |
return 10 | |
end | |
def tableView(tableView, cellForRowAtIndexPath:indexPath) | |
tableView.dequeueReusableCellWithIdentifier('test') || | |
UITableViewCell.alloc.initWithStyle(UITableViewCellStyleDefault, reuseIdentifier:'test') | |
end |
This file contains hidden or 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
require 'auth/oauth2_authenticator' | |
class HummingbirdAuthenticator < ::Auth::OAuth2Authenticator | |
CLIENT_ID = 'removed' | |
CLIENT_SECRET = 'removed' | |
def register_middleware(omniauth) | |
omniauth.provider :hummingbird, CLIENT_ID, CLIENT_SECRET | |
end |