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
| ; Ranking | |
| ; Votes divided by the age in hours to the gravityth power. | |
| ; Would be interesting to scale gravity in a slider. | |
| (= gravity* 1.8 timebase* 120 front-threshold* 1 | |
| nourl-factor* .4 lightweight-factor* .3 ) | |
| (def frontpage-rank (s (o scorefn realscore) (o gravity gravity*)) | |
| (* (/ (let base (- (scorefn s) 1) |
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
| fs = require "fs" | |
| path = require "path" | |
| rimraf = require "rimraf" | |
| {spawn} = require "child_process" | |
| url = require "url" | |
| heroku = | |
| config: (callback) -> | |
| child = spawn "heroku", ["config", "--shell"] | |
| raw = "" |
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
| <div class="singleAd" id="TopLeft"> | |
| <SCRIPT LANGUAGE= "JavaScript"> | |
| var CM8Server= "gucci.checkm8.com"; | |
| var CM8Cat="gucci.nyt"; | |
| var CM8Profile="&format=Bookend left"; | |
| var CM8Req="x"; | |
| var CM8Redir={click: "", ad_play: ""}; | |
| </SCRIPT> | |
| <SCRIPT LANGUAGE="JavaScript" SRC="http://guccidigital.checkm8.com/adam/cm8_detect_ad.js"> | |
| </SCRIPT> |
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
| apply = if Prototype.Browser.IE | |
| (o, a) -> | |
| a or= [] | |
| switch a.length | |
| when 0 then return @call o | |
| when 1 then return @call o, a[0]# shreddin' the argument powder | |
| when 2 then return @call o, a[0], a[1]# \__O_/ | |
| when 3 then return @call o, a[0], a[1], a[2]# | | |
| when 4 then return @call o, a[0], a[1], a[2], a[3]# \ /\ | |
| when 5 then return @call o, a[0], a[1], a[2], a[3], a[4]# \ / |
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 literals. | |
| class Doctor | |
| diagnose: -> | |
| console.log "You have died of dysentery." | |
| class LyingDoctor extends Doctor | |
| diagnose: -> | |
| console.log "You have died of old age." |
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
| # In general, there are many places in the file where you can leave off the parens in function calls, if you like. | |
| unless typeof exports is "undefined" # `unless ... else` reads poorly in English. Better to stick to `if ... else`. | |
| Spine = exports | |
| else | |
| Spine = @Spine = {} | |
| Spine.version = "0.0.4" | |
| $ = Spine.$ = @jQuery || @Zepto || -> arguments[0] # In Coffee, `or` is preferred over `||`. |
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
| Todos = SC.Application.create() | |
| Todos.Todo = SC.Object.extend | |
| title: null | |
| isDone: false | |
| Todos.todosController = SC.ArrayProxy.create | |
| content: [] | |
| createTodo: (title) -> |
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
| ~ > cat /usr/local/bin/git-publish | |
| #!/usr/bin/env ruby | |
| cmds = [] | |
| cmds << "git co gh-pages" | |
| cmds << "git merge master" | |
| cmds << "git push github gh-pages" | |
| cmds << "git co master" | |
| system cmds.join("&&") |
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
| # Try to load the compressors, if available. | |
| compressor_map = { | |
| :closure => 'closure-compiler', | |
| :yui => 'yui/compressor', | |
| :uglifier => 'uglifier', | |
| :sass => 'sass' | |
| } | |
| compressor_map.each do |compressor, library| | |
| begin |
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
| for i in [-1..1] | |
| for j in [-1..1] | |
| if @isAlive cell.row + i, cell.col + j | |
| neighbors++ |