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 pathlib | |
| import sys | |
| import exifread | |
| from datetime import datetime | |
| from itertools import count | |
| image_exts = [ | |
| ".jpg", |
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
| <html> | |
| <head> | |
| <script src="main.js" type="text/javascript" charset="utf-8"></script> | |
| <script type="text/javascript"> | |
| function reset_geschlecht () { | |
| var frau_input = document.getElementById("frau-input"); | |
| var mann_input = document.getElementById("mann-input"); | |
| frau_input.labels[0].style.color = "black"; | |
| mann_input.labels[0].style.color = "black"; |
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
| -- Renames all direcories in the working directory by stripping a prefix | |
| -- Leaves those who dont match the prefix unchanged. | |
| import System.Directory | |
| import Data.List | |
| import System.Environment | |
| import Control.Monad.Extra | |
| main = getArgs >>= \[prefix] -> | |
| listDirectory "." >>= filterM doesDirectoryExist >>= mapM_ (maybe (return()) (renameDirectory <$> (prefix++) <*> id) . stripPrefix prefix) |
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
| {-# LANGUAGE BangPatterns #-} | |
| import Control.Concurrent | |
| import Control.Monad | |
| import Data.Foldable | |
| import qualified Data.HashSet as HS | |
| import System.Directory | |
| import System.Environment | |
| import System.FilePath | |
| import System.FSNotify |
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
| -- Reads a plist file and converts it into Yaml | |
| -- it might not support all plist elements | |
| -- it supports 'dict', 'array', 'integer' and 'string' | |
| -- dependencies: | |
| -- - base | |
| -- - aeson | |
| -- - xml | |
| -- - yaml | |
| -- - unordered-containers |
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
| -- A one-file Haskell password generator file. | |
| -- | |
| -- has two generation methods | |
| -- chars which works simply by generating random characters | |
| -- dict which selects words from a dictionary. | |
| -- | |
| -- The `dict` generation method needs `aspell` to be installed on the system (as | |
| -- it uses the `aspell` wordlists). The language argument to the `dicts` method | |
| -- must be a valid `aspell` language identifierm with the default being 'en'. | |
| -- |
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
| #!stack runhaskell | |
| import Data.Monoid | |
| import Text.Printf | |
| data ExtsHelper | |
| = Prefixed String | |
| [ExtsHelper] | |
| | Values [String] | |
| exts :: [ExtsHelper] |
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
| {-# LANGUAGE NoImplicitPrelude, GADTs, FlexibleContexts #-} | |
| import Control.Arrow ((***)) | |
| import qualified Data.Char as C | |
| import qualified Data.HashMap.Strict as Map | |
| import Data.List (partition) | |
| import System.Directory | |
| import System.FilePath | |
| import Text.Printf | |
| import Universum |
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 Ref: | |
| sentinel = object() | |
| def __init__(self): | |
| self._val = self.sentinel | |
| def set(self, val): | |
| self._val = val | |
| def get(self): | |
| t = self._val | |
| self._val = self.sentinel | |
| return t |
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
| interrupt_handler = lambda _: None | |
| def foo(): | |
| global interrupt_handler | |
| # also could be something like write to a channel, opened only locally in foo | |
| def h(x): | |
| print(x) | |
| interrupt_handler = h | |
| for i in bar(): |