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
set nocompatible " Disable vi-compatibility | |
set nomodeline " good practice to disable because of security issues | |
set t_Co=256 | |
" Disable safe write | |
set backupcopy=yes | |
" With a map leader it's possible to do extra key combinations | |
" like <leader>w saves the current file | |
let mapleader = "\<space>" |
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 Data.List.Split | |
import Text.Read | |
main :: IO () | |
main = do | |
contents <- readFile "/home/deedo/Desktop/times.txt" | |
let line = getSecondLine $ splitOn "\n" contents | |
putStrLn $ prepareOutput $ calcDay <$> line | |
calcDay :: String -> Int |
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 SimpleJson | |
( JValue(..) | |
, put | |
) where | |
import Data.List (intercalate) | |
-- union type | |
data JValue | |
= JString String |
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 exposing (main) | |
import Char | |
import Html exposing (Html) | |
import Json.Encode as JE | |
import Parser exposing (..) | |
import Set | |
main : Html Never |
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 Highlight exposing (highlight, interweave) | |
type Html msg | |
= Mark (List (Html msg)) | |
| Text String | |
mark _ children = | |
Mark children |
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 OccuranceCount where | |
import Data.Foldable (foldl') | |
countWord :: String -> String -> Int | |
countWord needle = | |
foldl' (\acc word -> if word == needle then acc + 1 else acc) 0 . words | |
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
# MANUAL RUN | |
git checkout <KNOWN_BAD_COMMIT> | |
git bisect start | |
git bisect bad | |
git bisect good <KNOWN_GOOD_COMMIT> | |
# cycle till done | |
git bisect log # to check what you've done so far | |
<test if good or bad> | |
git bisect bad|good |
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
#!/usr/bin/env sh | |
set -eu | |
# checking input | |
[ -z ${1:-} ] && echo "Missing directory name. Call this script with a directory name you want to create." && exit 1; | |
DIR=$1 | |
[ -d $DIR ] && echo "Directory ${DIR} already exists. I need a fresh directory." && exit 1; | |
# scaffolding of dirs and files |
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
#!/usr/bin/env sh | |
# this script will modify your environment | |
# so that you can work in the context of an assumed role in AWS | |
set -u | |
if [ -z ${ASSUME_ROLE_ARN+x} ] | |
then | |
echo "NO ASSUME_ROLE_ARN variable configured in Environment."; |
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
{ while :; do echo test; sleep 5; done } | node -e 'process.stdin.on("data", () => process.stdout.write("Peter"))' |
OlderNewer