View tmux-completions.sh
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 | |
# | |
# Author: Felix Schlitter | |
# Description: | |
# Manage sessions using FZF | |
# | |
# Place this into your .bashrc after installing FZF, | |
# Then update your .tmux.conf and create key-bindings. Example: | |
# | |
# unbind s |
View spago-compile
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 | |
# compilation-mode compatible spago build output | |
set -eo pipefail | |
root=$(git rev-parse --show-toplevel) | |
PATH=$root/node_modules/.bin:$PATH | |
output=$(spago 3>&2 2>&1 1>&3 --quiet build -u --json-errors || { :; }) | |
n_errors=$(jq <<< "$output" '.errors | length') | |
n_warnings=$(jq <<< "$output" '.warnings | length') |
View docker-ufw-cf.sh
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 | |
# | |
# Disable public access to all exported ports on docker containers. | |
# Restrict access only to well-known cloudflare servers. | |
set -eo pipefail | |
function update_rules { | |
local target_file=$1 | |
awk -v "rules=$2" ' |
View gist:ce6143c06d3a6ff360d6397c8f71349a
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 | |
set -e | |
function run_handler { | |
: # whatever | |
} | |
while :; do | |
rm -f pipe | |
mkfifo pipe |
View genesis_public_key
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
044c089823ed2816cf0902a5840e237dcb046b602e58f7e2029784d504777a3f1e8cd8d071351195dd19822ad290f7c60e655c233b75d0089effb069ffb81e4fe3;stwiname |
View install-vim-from-sources-ubuntu.sh
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 build vim from sources with lua, python and ruby enabled as well as support for | |
# the system clipboard. | |
# | |
# Preparation | |
# | |
# 1. Download vim tarball from vim.org, extract and cd | |
# 2. Enable "Source Code" in Software Center under "Software & Updates". | |
# This is required for `sudo apt-get build-dep` to work. | |
sudo apt-get build-dep vim && |
View .bashrc
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 | |
# | |
# Place this into your .bashrc after installing FZF, | |
# Then update your .tmux.conf and create key-bindings. Example: | |
# | |
# unbind s | |
# bind s run "tmux new-window -n 'Switch Session' 'bash -ci tmux_select_session'" | |
# unbind K | |
# bind K run "tmux new-window -n 'Kill Session' 'bash -ci tmux_kill_session'" | |
# unbind C |
View run.sh
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 | |
# | |
# Task wrapper. Runs various chores in a cross platform manner. | |
# | |
# Usage: run [-h] <command> | |
# | |
# Available commands are: | |
# build: Build the project | |
# <other>: Run any other command available in the NPM path | |
# |
View git-du.sh
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
# usage: git du [max-size] | |
function git-du { | |
local -r max_size="${1:-0}" | |
du | while read -r line; do | |
read -r s n <<< "$line" | |
if ((s > max_size)) && git ls-files "$n" --error-unmatch &> /dev/null; then | |
echo "$line" | |
fi | |
done | |
} |
View gist:8955008908385033e369
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
var Promise = require('bluebird') | |
, _ = require('lodash') | |
; | |
var xs = [ 1, 2, 3, 4 ]; | |
var mapLimit = function(xs, limit, f) { | |
return Promise.all(_.foldl( | |
_.chunk(xs, limit) |
NewerOlder