banderson banderson

View pascal-original.coffee
1 2 3 4 5 6 7 8 9 10
module.exports = (rows) ->
result = []
for n in [0..rows]
if n is 0
result[n] = [1]
else
previous = new Array().concat 0, result[n-1], 0
current = []
for val, idx in previous
sum = val + previous[idx+1]
View flipper
1 2 3 4 5 6 7 8 9
!/usr/bin/env ruby
# encoding: UTF-8
 
# adapted from http://www.leancrew.com/all-this/2009/05/im-feelin-upside-down/
 
class Flipper
CHARS = " abcdefghijklmnopqrstuvwxyz,.?!'()[]{}".split('')
FLIPPED_CHARS = " ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz'˙¿¡,)(][}{".split('')
DICTIONARY = Hash[CHARS.zip FLIPPED_CHARS]
View mathHelpers.java
1 2 3 4 5 6 7 8 9
public class MathHelper {
 
// Find the Greatest Common Divisor using Euclid's Algorithm
// Adapted from: http://en.wikipedia.org/wiki/Greatest_common_divisor#Using_Euclid.27s_algorithm
public static int GreatestCommonDivisor(int a, int b) {
// base case: when b is zero, we've found the GCD
if (b == 0) {
return a;
}
View screening.js
1 2 3 4 5 6 7 8 9 10
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
 
// answer
(foo)
? bar.doSomething(el)
View IE CSS Hacks
1 2 3 4 5 6 7 8 9 10
/* inline-block */
#selector {
display: inline-block;
zoom: 1;
*display: inline;
}
 
/* min-width */
#selector {
min-width: 80px;
View tinyMCE_config.js
1 2 3 4 5 6 7 8 9 10
// TinyMCE Settings.
tinyMCE.init({
extended_valid_elements: 'style',
mode: 'exact',
elements: 'id_name',
theme: 'advanced',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left',
plugins: 'safari, style, table, paste, media',
theme_advanced_buttons1: 'bold, italic, underline, justifyleft, justifycenter, justifyright, justifyfull, formatselect, fontselect, fontsizeselect',
View module_pattern_init.js
1 2 3 4 5 6 7 8 9 10
//
// Automatically calls all functions in APP.init
//
jQuery(document).ready(function() {
APP.go();
});
 
//
// Module pattern:
// http://yuiblog.com/blog/2007/06/12/module-pattern/
Something went wrong with that request. Please try again.