(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/* This script operates asynchronously. It can be written synchronously, but | |
* not a lot is saved once you try-catch everything. Uses the async module. | |
* | |
* MIT licence. | |
*/ | |
var fs = require('fs'); | |
var path = require('path'); | |
var async = require('async'); | |
// Write as many of these as you like. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
from __future__ import unicode_literals | |
import os | |
import sys | |
import requests | |
def get_emojis(token): | |
response = requests.get("https://slack.com/api/emoji.list", |
{ | |
items(first: 5) { | |
count | |
edges { | |
node { | |
name | |
} | |
} | |
} | |
} |
oldContainers="$(docker ps -f "status=exited" | grep -E 'Exited \(.*\) [5-9] h|Exited \(.*\) \d\d h' | awk '{ print $1 }')" | |
echo -e -n "\nRemoving containers older than 4 hours" | |
if [ "$oldContainers" != "" ]; then | |
echo "" | |
docker rm $oldContainers | |
else | |
echo "...none found." | |
fi |
#!/bin/bash | |
mkdir -p /home/pi/pi-hole/pihole && | |
mkdir -p /home/pi/pi-hole/dnsmasq.d && | |
cd /home/pi/pi-hole && | |
docker run -d \ | |
--name pihole \ | |
--restart=always \ | |
--dns=1.1.1.1 \ | |
--dns=8.8.8.8 \ | |
-p 53:53/tcp -p 53:53/udp -p 80:80 -p 443:443 \ |
defmodule FunctionClause do | |
@moduledoc """ | |
Format function clauses using Exception.blame/3 | |
""" | |
@doc """ | |
Given a `module`, `function`, and `args` see | |
if that function clause would match or not match. | |
This is useful for helping diagnose function |
#!/bin/bash | |
# Script to use custom ssh keys for various git repositories | |
# Run without arguments to get usage info. | |
# | |
# How it works: | |
# When used with SSH, git sends the path to the repository in the SSH command. | |
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268 | |
# We extract this info and search for a key with the name. | |
# Based on the source, this seems to be used format since v2.0 at least. | |
# @see: https://github.com/git/git/commit/a2036d7 |
services: | |
postgres: | |
image: postgis/postgis:10-2.5 | |
env: | |
# must specify password for PG Docker container image, see: https://registry.hub.docker.com/_/postgres?tab=description&page=1&name=10 | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: your_test_db_name | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck |