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
# A min-heap. | |
type | |
TNode[T] = tuple[priority: int, data: T] | |
TBinHeap[T] = object | |
heap: seq[TNode[T]] | |
last: int | |
PBinHeap[T] = ref TBinHeap[T] |
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
{-# LANGUAGE QuasiQuotes #-} | |
import Quasi | |
f [$qq|test|] = True | |
f _ = False | |
main = do | |
print [$qq|test|] | |
print $ f [$qq|test|] |
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
Name: snap-helloworld | |
Version: 0.1 | |
Category: Web | |
Build-type: Simple | |
Cabal-version: >=1.6 | |
Executable snap-helloworld | |
HS-Source-dirs: src | |
Main-is: Main.hs | |
Other-modules: |
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
{-# LANGUAGE PackageImports #-} | |
{- | |
You need to register your Twitter application at <http://dev.twitter.com/> | |
to get the consumer key and secret needed for OAuth. When connecting to | |
Twitter for the first time, do this: | |
let consumer = Consumer "consumer key" "consumer secret" | |
token <- authenticate |
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
#!/bin/sh | |
xsel | xmessage -buttons ok:2,not:0 -file - -timeout 4 | |
if [ $? -eq 2 ]; then | |
xsel | pk notes -s | |
fi |
NewerOlder