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
// ==UserScript== | |
// @name iNoAgent | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove foreign agent bs | |
// @author sdolotom | |
// @match https://meduza.io/* | |
// @grant none | |
// ==/UserScript== |
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 DeriveDataTypeable #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Rhapsody where | |
import Data.Char (toLower, toUpper) | |
import Data.Data (Data, Typeable, showConstr, toConstr) | |
import Data.List (intercalate) | |
import Text.Printf (printf) |
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 | |
# Docker names container after notable scientists, this script describes them. Add it to your $PATH and enjoy :) | |
# Usage: | |
# docker_whois: find scientists for all running containers | |
# docker_whois <name>: find a single scientist (e.g. docker_whois einstein) | |
if [[ $# -eq 0 ]]; then | |
names=$(docker ps --format '{{.Names}}' | sed 's/.*_//g' | egrep '[a-z]+'); |
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 System.Environment | |
import qualified Data.Map as M | |
import Data.Maybe | |
import Data.Char | |
letters = "MDCLXVI" | |
values = [1000, 500, 100, 50, 10, 5, 1] | |
-- convert in to Roman |
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 System.Environment | |
letters = "MDCLXVI" | |
values = [1000, 500, 100, 50, 10, 5, 1] | |
-- Convert an int to Roman representation | |
toRoman n = concat $ norm (reverse letters) (coeffs values n []) [] | |
where coeffs (v : vs) n buf = let (val, n') = divMod n v in coeffs vs n' (val:buf) | |
coeffs [] n buf = buf | |
norm (s1:(s2:ss@(s3:_))) (4:(1:(vs))) buf = norm ss vs ([s1, s3]:buf) |