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 | |
data = DATA.read | |
data.gsub! '\:', "\0" | |
pieces = data.split ":" | |
pieces.each do |piece| | |
piece.gsub! "\0", '\:' | |
end | |
puts pieces | |
__END__ | |
5082333~GBP~ACTIVE~0~1~NR\: (RSA) <br>8. Fan Mail (0%,11\:07), 6(2.5%,11\:08)~true~5.0~1162835723938~6. Earlswood,9.08,2.5;8. Fan Mail,9.07,2.4;Y:1058616~0~6.04~8.4~~11.9~false||:670160~1~6.18~17.5~~4.2~false||:113 2008~2~9.78~5.2~~20.4~false||:894820~3~140.02~4.6~~20.4~false||1.01~5.0~B~1~:1414415 ~4~8.2~6.2~~16.0~false||:575636~5~5.54~11.5~~8.6~false||:1433455~6~0.0~~~0.4~false|| :1433456~7~0.0~~~0.9~false||:746753~8~5.54~11.5~~5.2~false||:1433457~9~0.0~~~4.2 se||:1147548~10~0.0~~~2.6~false||:1433458~11~62.46~2.0~~3.5~false||:1433459~12~0.0~~ ~ 0.9~false||:1433460~13~0.0~~~0.9~false|| |
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/env python2 | |
# Python | |
# lolz | |
occurences = {} | |
string = raw_input('string> ') | |
for character in string: | |
occurences[character] = occurences.get(character, 0) + 1 |
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
#=====================================================================# | |
# General # | |
#=====================================================================# | |
# Min | Hour | Mday | Month | Wday | Command # | |
#=====================================================================# | |
# * * * * * $HOME/bin/gmail.rb | |
0 5 * * * $HOME/bin/dotbackup.rb | |
# */15 * * * * $HOME/bin/temp-help.sh | |
#=====================================================================# |
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
module Main where | |
-- Define the BST data type | |
data BST a = Node (BST a) (BST a) a | |
| Tip | |
deriving (Show, Eq) | |
-- Make a leaf node | |
leaf y = Node Tip Tip y |
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
module List where | |
data List a | |
= Null | |
| Node (List a) a | |
deriving (Show, Eq) | |
build = build' Null | |
where | |
build' Null [] = Null |
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
module BST where | |
-- Define the BST data type | |
data BST a | |
= Node (BST a) (BST a) a | |
| Tip | |
deriving (Show, Eq) | |
-- Make a leaf node | |
leaf y = Node Tip Tip y |
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
module List where | |
data List a | |
= Null | |
| Node (List a) a | |
deriving (Show, Eq) | |
build = build' Null | |
where | |
build' Null [] = Null |
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
module Sum where | |
a [] = 0 | |
a (x:xs) = x + a xs | |
b xs = b' 0 xs | |
where | |
b' q [] = q | |
b' q (x:xs) = b' (q + x) xs |
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
a [] = 0 | |
a (x:xs) = x + a xs | |
b xs = b' 0 xs | |
where | |
b' a [] = 0 | |
b' a (x:xs) = b' (a+x) xs | |
c xs = foldl (+) 0 xs |
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
# vim: syn=sh: | |
# | |
# Sleep before doing a command | |
SleepDo() { | |
local time="$1" | |
shift | |
sleep "$time" | |
eval "$@" | |
} |