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
| On OSX, ensure you have 64 bit VLC. | |
| // stream to png images | |
| $ vlc INPUT --video-filter=scene --scene-format=png --scene-path=OUTPUT_FILE | |
| // burn in subtitles | |
| vlc -I rc -vv INPUT --sout '#transcode{soverlay,vcodec=h264}:standard{access=file,dst=OUTPUT_FILE,mux=ts}' --sub-language=eng | |
| vlc -I rc -vv INPUT --sout '#transcode{soverlay,vcodec=h264}:standard{access=file,dst=OUTPUT_FILE,mux=ts}' --sub-track-id=623 |
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
| BankAccount = (balance = 0) -> | |
| (cmd, amount = 0) -> | |
| if cmd == "withdraw" then BankAccount balance - amount | |
| else if cmd == "deposit" then BankAccount balance + amount | |
| else if cmd == "balance" then balance.toFixed 2 | |
| else "What kind of person would try to #{cmd} a bank account?" |
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
| ListView = (el) -> | |
| views = [] | |
| ["pop","shift"].each (method) => | |
| @[method] = -> | |
| remove = views[method]() | |
| el.removeChild remove.el | |
| [["unshift","prepend"],["push","append"]].each ([array,dom]) => | |
| @[array] = (view) -> | |
| views[array](view) | |
| byModelId[view.model.id] = view |
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
| FB.UA._mobile = true; |
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
| el.on("touchstart", function() { FB.login(function() {...}) }); // facepalm with lovely cryptic error | |
| el.on("click", function() { FB.login(function() {...}) }); // it works! |
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 Enumerable | |
| constructor: (@fn,bind) -> | |
| if bind | |
| fn = @fn | |
| @fn = -> fn.apply(bind,arguments) | |
| map: (transform) -> | |
| results = [] | |
| @fn -> | |
| results.push transform( |
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
| RealGame.where("first_period_start_at IS NOT NULL").where("start_at > '2011-11-09'").map do |real_game| | |
| entries = BigGameEntry.includes(:big_game)\ | |
| .where("big_games.real_game_id = #{real_game.id}")\ | |
| .where("big_games.start_point = '1:030:00'")\ | |
| .where("big_games.end_point = '2:045:00'")\ | |
| .where("big_games.currency_code = 'GBP'")\ | |
| .where("big_games.game_type = 'short'") | |
| [real_game,entries] | |
| 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
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(function() { | |
| $(".masker").mousemove(function(e) { | |
| $(this).css("-webkit-mask","-webkit-radial-gradient(" + e.clientX + " " + e.clientY + ", 170 120, rgba(0,0,0,0) 40%, rgba(0,0,0,1)) 10%") | |
| }) | |
| }) | |
| </script> | |
| <style type="text/css" media="screen"> | |
| .masker { |
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 Conf | |
| class << self | |
| class << self | |
| def if_undef method, &block | |
| define_method method, &block unless Conf.respond_to? method | |
| end | |
| end | |
| if_undef :foo do | |
| "foo" | |
| 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
| just = (x) -> [["maybe","just"],-> x] | |
| nothing = -> [["maybe","nothing"],->] | |
| bind = ([[monadType,_],_],operation) -> | |
| switch monadType | |
| when "maybe" | |
| maybeBind arguments[0], operation | |
| maybeBind = ([[_,valueType],value],operation) -> |