Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function(){
App.Views.EntriesView = Backbone.View.extend({
el: $("#entries"),
initialize: function(){
_.bindAll(this, 'render');
this.collection = new App.Collections.EntriesList();
this.collection.bind('add', this.appendItem);
data Op = Integer Int | Function String deriving (Show)
newtype Program = List Op
data Ast = Const Int | Binary Ast String Ast
--i robisz funkcje
--Ast -> Program
--koniec
value (Integer val) = val
data Op = Integer Int | Function String deriving (Show)
newtype Program = List Op
data Ast = Const Int | Binary Ast String Ast
--i robisz funkcje
--Ast -> Program
--koniec
value (Integer val) = val
@JakubOboza
JakubOboza / gist:2568811
Created May 1, 2012 15:26
raw request for torrent -> use pump to give it back.
var http = require('http');
var torrent = "http://torrents.thepiratebay.se/7232828/Alcatraz.S01E13.HDTV.x264-LOL.7232828.TPB.torrent";
var torrentto = "http://ca.isohunt.com/download/70161921/lol.torrent";
var options = {
host: 'torrents.thepiratebay.se',
port: 80,
path: '/7232828/Alcatraz.S01E13.HDTV.x264-LOL.7232828.TPB.torrent',
method: 'GET'
@JakubOboza
JakubOboza / gist:2567091
Created May 1, 2012 10:37
haskell utf-8 data.text example :)
import Data.Text as Text
main = do
input <- getLine
let lol = Text.pack input in
putStrLn $ Text.unpack lol
putStrLn "Kuba!"
import Text.ParserCombinators.Parsec
data RailsLogSummaryLine = RailsLogSummaryLine {
requestStatus :: String,
requestTotalTime :: String,
requestDbTime :: String,
requestViewTime :: String
} deriving (Show, Ord, Eq)
data RailsLogParsingResult = Fail String
import Text.ParserCombinators.Parsec
data RailsLogHeaderLine = RailsLogHeaderLine {
requestMethod :: String,
requestAction :: String,
requestIp :: String,
requestTime :: (String, String)
} deriving (Show, Ord, Eq)
data RailsLogSummaryLine = RailsLogSummaryLine {

How do i build it

λ scons --prefix /Users/joboza/Workspace/Mongo/mongo-build --64 --full install

Top commit

commit b038ae0bae369b2883536016924836d70c9c17db Author: Azat Khuzhin [email protected] Date: Wed Apr 11 12:31:56 2012 +0400

Error

AssertionError: Installing source ['libmongoclient.a', 'build/darwin/64/client_build/libmongoclient.a'] into target ['/Users/joboza/Workspace/Mongo/mongo-build/lib/libmongoclient.a']: target and source lists must have same length.

@JakubOboza
JakubOboza / gist:2309766
Created April 5, 2012 10:23
Installing GHC 7.4.1 on 10.7 Lion

GHC 7.4.1 on 10.7 Lion

While wait for Haskell platform i wanted to play with GHC 7.4.1 mainly because Aeson lib requires things that were added in GHC 7.2 and Haskell Platform is fixed on 7.0.4

Step one

Get haskell platform from http://hackage.haskell.org/platform/mac.html pick up 64bit version and Install it. (this will install cabal 0.8 and loads of useful tools).

Step two

Go to /Library/Frameworks/GHC.framework/Versions/Current/Tools and run sudo ./Uninstaller

-module(bst_tree).
-compile(export_all).
-record(node, {key, val, left = nil, right = nil}).
lookup(Node, Key) when Key =:= Node#node.key ->
{ok, Node#node.val};
lookup(Node, Key) when Key < Node#node.key ->
lookup(Node#node.left, Key);