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
post-commit: | |
#!/usr/bin/ruby | |
lastlog = `git log -1` | |
raise "Error in git log -1" if $?.exitstatus != 0 | |
if lastlog.include?("fix") and not lastlog.include?("closebug") | |
`echo bug >> bug` | |
raise "Error in echo" if $?.exitstatus != 0 | |
`git add bug` |
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
let id_map y = List.map (fun x -> x) y | |
*** Linearized code | |
camlTest__id_map_58: | |
y/29[%rbx] := R/0[%rax] | |
A/30[%rax] := "camlTest__2" | |
tailcall "camlList__map_90" R/0[%rax] R/1[%rbx] |
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
.equ EXIT, 1 | |
.equ READ, 3 | |
.equ OPEN, 5 | |
.equ BRK, 45 | |
.equ BUF_SZ, 4096 | |
.section .data | |
filename: | |
.ascii "my_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
(* | |
let s = Stream.of_string "foo\nbar\nbaz" in | |
let lines = Stream.refoldl (fun s c -> if c = '\n' then Done s else Acc (s ^. c)) s in | |
Stream.iter print_string lines; | |
print_newline ();; | |
foobarbaz | |
*) | |
type 'a accum = Acc of 'a | Done of 'a |
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
#!/usr/bin/ruby | |
=begin | |
$ google_raw -n1 euribor | |
Euribor Homepage | |
http://www.euribor.org/ | |
Euribor (Euro Interbank Offered Rate) is the rate at which euro interban | |
k term deposits within the euro zone are offered by one prime bank to ano | |
ther prime ...Historical DataAbout EuriborAbout EoniaPress ReleasesWhat's | |
newFAQsPanel BanksTechnical FeaturesMore results from euribor.org?? | |
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
-- Reqs: apt-get install libghc6-time-dev libghc6-cairo-dev libghc6-gtk-dev | |
-- Compile by doing | |
-- ghc --make hello.hs -o hello | |
import Graphics.UI.Gtk hiding (fill) | |
import Graphics.Rendering.Cairo | |
import Data.Time.Clock.POSIX | |
import Time | |
frac = snd . properFraction |
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
import System.Directory | |
import System.FilePath | |
import System.Posix.Files | |
import System.Posix.Types | |
import System.Posix.User | |
import Data.List (partition) | |
data DirInfo = DirInfo { |
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
import Graphics.UI.Gtk hiding (fill) | |
import Graphics.Rendering.Cairo | |
import Data.Time.Clock.POSIX | |
import Time | |
frac = snd . properFraction | |
modf a b = frac (a / b) * b | |
normalizeAngle a | a < 0 = 2*pi + (a `modf` (2*pi)) |
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
import Graphics.UI.Gtk hiding (fill) | |
import Graphics.Rendering.Cairo | |
import Data.Time.Clock.POSIX | |
import Time | |
frac = snd . properFraction | |
modf a b = frac (a / b) * b | |
normalizeAngle a | a < 0 = 2*pi + (a `modf` (2*pi)) |
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
-- cairo drawing lib bits with combinators | |
moveToP = uncurry moveTo | |
lineToP = uncurry lineTo | |
curveToP ((x1,y1),(x2,y2),(x3,y3)) = curveTo x1 y1 x2 y2 x3 y3 | |
doWith g f x = do { f x; g } | |
withDo f g x = do { f; g x } | |
listDo _ _ [] = return () |
OlderNewer