Skip to content

Instantly share code, notes, and snippets.

Working from home

Hugo Schmitt hugows

Working from home
Block or report user

Report or block hugows

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rob pike poop from reddit
package main
import (
type server struct {
conns int
hugows /
Created Sep 26, 2019
Copy stills from Raspberry Pi and turn into timelapse movie
mkdir -p input/
rsync --remove-source-files -a pi@rpi:~/camera/ input/
ffmpeg -r 25 -pattern_type glob -i 'input/*.jpg' -c:v copy timelapse.avi
hugows / validate.go
Created Mar 19, 2019
gojsonschema and echo
View validate.go
var mySchema = `{
"$schema": "",
"type": "object",
"properties": {
"color": {
"description": "The price of the product",
"type": "string",
"enum": ["blue", "red", "black"],
"exclusiveMinimum": 0
hugows /
Last active Mar 15, 2019
script to update go to new version on linux ubuntun
#!/usr/bin/env bash
# Original author: Ravi Teja Pothana (@RaviTezu)
# Hugo: removed stuff I didn't need on Linux
set -e
function usage {
printf "./ <version> \n"

Mount your remote server to easily edit files with VSCODE

sudo mkdir /mnt/droplet
sudo sshfs -o allow_other /mnt/droplet

To unmount:


Helpful linux tips

Handy aliases I always type again:

alias sai='sudo apt install -y'
alias sas='sudo apt-cache search'
alias gc="git clone"
alias sshhugo="sshpass -p 'mypass' ssh"
alias psqlacme="PGPASSWORD=acmepass psql -h localhost -U acme acmedb"

Quick setup Postgres 10 on Ubuntu 18.10

Paste this into your terminal, replacing acme with your project name:


sudo apt-get install postgres

On the emergence of interfaces

Interfaces naturally emerge as software gets broken down into parts communicating with one another. The larger and more deliberate structures emerge from a deliberate attempt to organize the development process itself. [fn:Liskov2008] Structure often emerge directly from division of labor: as teams take on independent tasks, interfaces are established betweeen domains they become responsible for. (Conway’s Law)

Software developers are responsible for systems built out of very small atoms while ultimately performing tasks for their users of a much greater magnitude. Dijkstra showed this by computing the ratio between grains of time at the lowest and largest atoms of the system (from say, CPU instructions to a human interaction with the system) The span was already quite large by Dijkstra’s time, of about 10^9. Today this ratio would be at least above 10^12 (see grain ratios)

This large span has to be manage

View gist:2ac057531acd6d3b9e60590ba28f48a5
export function items(state = [], action) {
switch (action.type) {
return action.items;
return state;
hugows / .screenrc
Last active Mar 7, 2018 — forked from jbeluch/.screenrc
Basic .screenrc (Good enough for 2018 - hugo)
View .screenrc
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{..G}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a"
You can’t perform that action at this time.