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
module Golf where | |
skips :: [a] -> [[a]] | |
skips xs = map (\i -> takeEvery (fst i) (snd i)) $ createZipList xs | |
where | |
createZipList xs = zip [1..] $ take (length xs) $ repeat xs | |
takeEvery :: Int -> [a] -> [a] | |
takeEvery n xs = | |
case drop (n-1) xs of |
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
-- CIS 194 Homework 2 | |
module Log where | |
import Control.Applicative | |
data MessageType = Info | |
| Warning | |
| Error Int | |
deriving (Show, Eq) |
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
<?php | |
function get_path($obj, $path, $default=NULL) | |
{ | |
if(empty($obj)) { | |
return $default; | |
} | |
$parts = explode(".", $path); |
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
bubblesort :: (Ord a) => [a] -> [a] | |
bubblesort [] = [] | |
bubblesort (x1:x2:xs) = | |
let sorted = if x2 < x1 | |
then x2 : bubblesort (x1:xs) | |
else x1 : bubblesort (x2:xs) | |
in (bubblesort $ init sorted) ++ [last sorted] | |
bubblesort xs = xs | |
main = do |
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
<?php | |
function ipv6_cidr($subnet, $range, $ip) | |
{ | |
$bit_mask = mask_bits(128, $range); | |
$subnet = inet_pton($subnet) & $bit_mask; | |
return (inet_pton($ip) & $bit_mask) == $subnet; | |
} | |
function mask_bits($total_length, $mask_length) |
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
host git.epinux.com robotns2.second-ns.de. ~ | |
Using domain server: | |
Name: robotns2.second-ns.de. | |
Address: 213.133.105.6#53 | |
Aliases: | |
git.epinux.com is an alias for epinux.com.epinux.com. | |
epinux.com.epinux.com is an alias for epinux.com.epinux.com. | |
epinux.com.epinux.com is an alias for epinux.com.epinux.com. |
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
class Context(): | |
def __init__(self): | |
self.result = [] | |
self.current = {} | |
self.lastValue = 0 | |
def setBeginValue(self, value): | |
self.current['beginValue'] = value | |
def buildResult(self): |
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
server { | |
index index.php; | |
location / { | |
try_files $uri /index.php?$args; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; |
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
= /^Income:salary$/ | |
; [Accounts:checking] $ -200.00 | |
; [Budget:food] $ 200.00 | |
= /^Expense:food$/ | |
[Budget:food] -1.0 | |
[Accounts:checking] 1.0 | |
2014/04/13 Company Inc | |
Accounts:checking $ 1000.00 |
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
git-test-conflict :: (master*) » git mergetool ~/tmp/git-test-conflict | |
Merging: | |
foo | |
Normal merge conflict for 'foo': | |
{local}: modified file | |
{remote}: modified file | |
Hit return to start merge resolution tool (vimdiff): | |
4 files to edit |