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
# require 'memprof' | |
class Dumb | |
@@big_dumb_array = [] | |
def initialize | |
@@big_dumb_array << [0] * 100_000 | |
end | |
end | |
if __FILE__ == $0 |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Tea timer</title> | |
<style type="text/css"> | |
#timer { | |
margin: 50px auto; | |
text-align: center; | |
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; | |
} |
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 Object | |
def wood? | |
if self.to_s =~ /^wood$/i | |
"Yep, it's wood." | |
else | |
"No, it's #{self.to_s}." | |
end | |
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 w = Ti.UI.currentWindow, | |
Bubbles = Ti.App.Bubbles; | |
var DescribePage = { | |
taxonomyController: function({ | |
view: Ti.UI.createTableView({}), | |
// handle different kind of changes (changeGender, changeCategory, etc.) here? | |
})(), | |
createRowForTaxonomyClass: function(klass, value) { | |
var row = Ti.UI.createTableViewRow(); |
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
(defn fibo [n] | |
(cond | |
(= n 0) 0 | |
(= n 1) 1 | |
:else (+ (fibo (dec n)) (fibo (- n 2))))) | |
(defn fibo-toc [n] | |
(letfn [(fib | |
[current next n] | |
(if (zero? n) |
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
(ns clojure_exercises.roman_nums | |
; (:use '[clojure.contrib.math :as math]) | |
(:use clojure.test)) | |
(defn roman-nums | |
([x] | |
(if (>= x 4000) | |
nil | |
(roman-nums x 0 []))) | |
([x pos res] |
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
Address = function(options) { | |
this.city = options.city || 'Budapest'; | |
this.country = options.country || 'Hungary'; | |
this.street = options.street || 'Szep utca'; | |
this.summary = function() { | |
return this.street + ', ' + this.city + ', ' + this.country + ' (' + this.type + ')'; | |
}; | |
} | |
Object.create = function(o) { |
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
* Besides that we're Ruby fans and we actively use Ruby for a lots of things why should we use Ruby and Rails besides server-side Javascript frameworks (like node.js)? Will we benefit anything if we keep on using Rails or should we move to a language/tool that is common to clients and servers too? | |
* is there any way to easily represent / transform our models (validations / associations / etc.) to client side? (besides Backbone.js) | |
* why sproutcore? | |
* what works for inspiration? step away from your desk, walking, sleeping? | |
* do you miss ruby? | |
* how consistent are you doing testing-development cycles? are you a purist applying bdd, agile methodologies or do you have your own rituals you can share? |
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
qsort = (coll) -> | |
if coll.length <= 1 | |
coll | |
else | |
less = [] | |
more = [] | |
idx = Math.floor(Math.random() * coll.length) | |
pivot = coll.splice idx, 1 | |
for elt in coll | |
if elt < pivot[0] then less.push(elt) else more.push(elt) |