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
#!/usr/bin/env python3 | |
import os | |
import os.path | |
import re | |
import subprocess | |
currdir = os.path.dirname(os.path.realpath(__file__)) | |
picpattern = re.compile(r'(jpg|cr2)$', flags=re.IGNORECASE) | |
datepattern = re.compile(r'(\d{4}):(\d{2}):(\d{2})') |
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 Main where | |
continue :: ([a] -> [b]) -> [a] -> [b] | |
continue _ [] = [] | |
continue f (x:xs) = f (x:xs) | |
f1, f2, f3, b1, b2, b3, b4, b5 :: [Int] -> [(Bool, String)] | |
f1 (x:xs) = (False, show x):continue f2 xs | |
f2 (x:xs) = (False, show x):continue f3 xs |
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(msgorder). | |
-compile(export_all). | |
% How to get messages in correct order, even though things outside of our | |
% control try to put them in a semi-random order. | |
f(T, X) -> | |
Parent = self(), | |
Ref = make_ref(), | |
spawn_link(fun() -> timer:send_after(T, Parent, {Ref, {T, X}}) end), |
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
import sys | |
from time import sleep | |
from threading import Thread | |
def communicator(): | |
print('This does not print') | |
sys.stdout.flush() | |
while(True): | |
#frame.evaluateJavaScript('document.getElementById("footer").appendChild(document.createTextNode("Hejjibejj"));') | |
#fr.evaluateJavaScript('alert("Yo");') |
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
import Data.Maybe | |
mrd n x | mod n x == 0 = Just n | |
| otherwise = Nothing | |
lp = map (\n -> head . catMaybes $ zipWith (\f v -> v >> return f) ["FizzBuzz", "Fizz", "Buzz", show n] (map (mrd n) [15, 3, 5, 1])) [1..] | |
main :: IO () | |
main = putStr $ unlines $ take 100 lp |
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
import Data.Char | |
import Data.List | |
type Personnummer = [Int] | |
mod10 x = mod x 10 | |
cleanAndConvert :: String -> Maybe Personnummer | |
cleanAndConvert cs = return $ map digitToInt $ filter isDigit cs |
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/bash | |
iptables -F # Flush all! | |
iptables -X # Delete all custom chains! | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |
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
import Control.Monad | |
import Data.Char | |
import Data.List | |
color s c = "\x1b[38;5;" ++ show c ++ "m" ++ s ++ "\x1b[0m" | |
txt = map chr $ foldr (\a (b:bs) -> (a+b):(b:bs)) [32] [(-12),2,(-3),7,(-3),7,69] | |
main = sequence_ $ cycle $ map (\c -> putStr $ color txt c) [0..256] |
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
#include<stdio.h> | |
int main() { | |
printf("1 == %i\n", 1); | |
printf("~1 == %i\n", ~1); | |
printf("~~1 == %i\n", ~~1); | |
return 0; | |
} |
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
,>, Input two bytes | |
[-<+>] While the second byte is greater than zero add it to the first byte | |
<. Print the first byte |