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
#!/bin/sh | |
filter() { | |
grep o= | grep -Eo '>\+?\w+ \w+<' | tr -d '<+>' \ | |
| sed -r 's/^(Олег|Виктория) (\w+)/\2 \1/' | |
} | |
cd /tmp | |
[ -f 61461.html ] || wget -q http://vorotylo.livejournal.com/61461.html | |
echo 'Нгуен Лонг' |
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
[ This file was last modified on 24 November 2010. ] | |
Valery V. Vorotyntsev | |
Kiev, Ukraine | |
Phone: +380-<fifty>196-786<five> | |
Email/IM: valery.vv@gmail.com | |
WWW: http://github.com/vvv http://vorotylo.livejournal.com/ | |
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
#!/bin/bash | |
## SEE http://superuser.com/questions/54054/convert-pdf-2-sides-per-page-to-1-side-per-page | |
## | |
## Find out the size of a page (MediaBox). If you use Mac OS X's | |
## Preview app then select `Tools -> Show Inspector' in the menu or | |
## type `Cmd-I'. | |
MEDIA_BOX=612x792 | |
INFILE=TYH.pdf |
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
#!/bin/sh | |
set -eu | |
M0UT=ut/.libs/lt-m0ut | |
[ -x $M0UT ] || { echo "$M0UT: No such file" >&2; exit 1; } | |
CORE=$(sudo ls -t $(sudo find /var/mero -type f -name core.\*) | head -1) | |
sudo gdb -nx -c $CORE $M0UT <<EOF | |
set pagination off |
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
$ cat noexit.sh | |
#!/bin/sh | |
seq 100 | while read; do exit; done # If `exit' terminated the script .. | |
echo 'Still alive!' # .. this message would not be printed. | |
$ | |
$ sh noexit.sh | |
Still alive! |
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
{-# LANGUAGE GADTs #-} | |
module Program where | |
-- | |
-- The Operational Monad Tutorial: | |
-- http://apfelmus.nfshost.com/articles/operational-monad.html | |
-- | |
-- GADT | |
data Program instr a where | |
Then :: instr a -> (a -> Program instr b) -> Program instr b |
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
listsum :: Num a => [a] -> a | |
listsum [] = 0 | |
listsum (x:xs) = x + listsum xs | |
main :: IO () | |
main = print $ listsum [1..5] |
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
{-- XXX Your definition of `checkChar` is okay, but the abstraction itself | |
-- is very odd. It is fine as an exercise of using "do" notation and | |
-- `return`. In real code though explicit statements are both short and | |
-- expressive (see lines 21-22). | |
checkChar :: IO Bool | |
checkChar = do | |
c <- getChar | |
return (c == '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
import Data.Foldable (foldl') | |
import Debug.Trace (trace) | |
prnEqual :: (Eq a) => a -> a -> IO () | |
prnEqual a b = if a == b then print "True" else print "False" | |
-- Note the absence of parentheses around `Eq a` and having exactly one `print`. | |
prnEqual' :: Eq a => a -> a -> IO () | |
prnEqual' a b = print $ if a == b then "True" else "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
{-# OPTIONS_GHC -Wall -Werror #-} | |
module DaPhone where | |
import Data.Char (isUpper, toLower) | |
import Data.List (elemIndex, foldl', intersperse) | |
import Data.Maybe (catMaybes) | |
data DaPhone = DaPhone [String] | |
deriving (Eq, Show) |
OlderNewer