View keybase.md

Keybase proof

I hereby claim:

  • I am apiarian on github.
  • I am apiarian (https://keybase.io/apiarian) on keybase.
  • I have a public key ASDql2jnKyQKDqepzcSb1x9Rxxw-PGFC0ajwDZsfzZPX3wo

To claim this, I am signing this object:

View Golang Channels Cheatsheet.md

Golang Channels

nil

  • send blocks forever
  • receive blocks forever

open

  • send blocks until received
  • receive blocks until sent
View hammerspoon ping.lua
pingcheck = hs.menubar.new()
function pingUpdate()
pingcheck:setTitle(''..pingcheck:title())
local p = hs.network.ping('example.com', 3)
hs.timer.doAfter(4, function()
p:cancel()
local avg = p:summary():match('%/(%d+)%.%d+%/')
if avg == nil or avg == '0' then
pingcheck:setTitle('')
else
View lunch-go-auto-challenge.py
#!/usr/bin/env python3
# licence: ¯\_(ツ)_/¯
import requests
s = requests.Session()
d = {
'client_id': 'client_id',
'client_secret': 'client_secret',
View boolean.json
( (1 or 2 or 3) and (not (4 and (5 or 6 ) ) ) )
{
"operator": "AND",
"subsections": [
{
"operator": "OR",
"entities": [ 1, 2, 3 ]
},
{
View ipfs-link-weirdness.pl
View simple-markdown-rebuild.md

On the OS X bash command line

brew install multimarkdown
brew install fswatch

echo '#!/bin/bash
multimarkdown --full "file.md" > /tmp/file.html && open -g /tmp/file.html' > /tmp/rebuild.sh && chmod +x /tmp/rebuild.sh; fswatch -o "file.md" | xargs -n1 /tmp/rebuild.sh
View export_dayone_entries.py
# export_dayone_entries.py
# Aleksandr Pasechnik
#
# This script goes through the Day One journal and exports each of the entries
# to a new markdown file in the `exportdir` directory. The `exportdir`
# directory is deleted and recreated each time the script is run, so best set
# it to something temporary (a subdirectory on the Desktop, for example).
# Photos are copied into the export directory too, with the same basename as
# the exported entries. The timestamp, location, weather, and tags are appended
# to the end of the file, if they are available. The script also sticks a '#'
View dayone_update.py
#! /usr/bin/env python
# Aleksandr Pasechnik
# Looks through the Day One journal and finds the latest entry that starts with
# the "Entry Start Text" provided on the command line. The script then asks for
# input, reading lines until it comes to one that contains just a single full
# stop "." . The script asks for confirmation and appends a new line followed
# by the entered text to the end of the entry.
#
# NOTE: the user is responsible for creating new entries as necessary,
View views.py
# views.py
# Aleksandr Pasechnik
#
# A Django views.py function which bridges Piwik and StatusBoard
#
# Django: https://www.djangoproject.com
# Piwik: http://piwik.org
# StatusBoard: http://panic.com/statusboard/
# PiwikAPI: https://github.com/piwik/piwik-python-api
#