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 -eo pipefail | |
usage () { | |
echo "Usage:" | |
echo -e "\t${0} <jumpbox> <target>" | |
echo -e "\tJUMP_BOX=<jumpbox> ${0} <target>" | |
} |
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 | |
import System.IO | |
type Logger = String -> IO () | |
fileLogger :: Handle -> Logger | |
fileLogger file string = do | |
hPutStrLn file string | |
hFlush file |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from contextlib import contextmanager | |
from functools import update_wrapper | |
from django.db.models import signals | |
@contextmanager | |
def disable_signals(): | |
receiver_backups = {} | |
signals_list = [(signal_name, signal) for signal_name, signal in |
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 inspect | |
def curry(func): | |
return Currying(func) | |
class Currying: | |
def __init__(self, function, args=None): | |
self._function = function |
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 argparse | |
import zmq | |
context = zmq.Context() | |
def bind_sockets(pub_port, pull_port): | |
pub = context.socket(zmq.PUB) | |
pub.bind('tcp://*:{}'.format(pub_port)) |
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 | |
import Control.Monad (forever) | |
import System.Posix.Process (forkProcess, executeFile) | |
import System.Environment (getEnvironment) | |
import System.IO (hSetBuffering, stdout, BufferMode(NoBuffering)) | |
import Data.Text (Text, pack, unpack, split) | |
startProcess :: Text -> [Text] -> IO () |
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
/*return iterations == DEPTH ? -1 : | |
iterations + 1 - log(log(sqrt(x*x + y*y))) / log(2);*/ | |
/* | |
* Coolt mönster:*/ | |
return (iterations == depth ? -1 : | |
(iterations << 4)) - log(sqrt(x*x - y*y)) / log(2); |
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 Makefile uses gcc's -MM-flag to scan your source tree for dependencies | |
# Other compilers may or may not have this feature. Adjust the DEPS | |
# definition accordingly. | |
CC := gcc | |
RM := rm | |
CFLAGS := -pedantic -Wall -Wextra -g | |
LIBS := |
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 | |
fizzbuzz x | |
| fizz x && buzz x = "FizzBuzz" | |
| fizz x = "Fizz" | |
| buzz x = "Buzz" | |
| otherwise = show x | |
where fizz = (== 0) . flip mod 3 | |
buzz = (== 0) . flip mod 5 |
NewerOlder