Skip to content

Instantly share code, notes, and snippets.

Stig Lindqvist stojg

Block or report user

Report or block stojg

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

Keybase proof

I hereby claim:

  • I am stojg on github.
  • I am stojg ( on keybase.
  • I have a public key ASAXrGdkyAeTpbLy6bmEMZ3sDC0S3HVnfR0m1p5ujhJcMgo

To claim this, I am signing this object:

stojg / slowpoke.go
Created Dec 16, 2017
go program to run after a slow process, which sends you a text so that you know when it's finished
View slowpoke.go
// This golang program is a remix/parody of
// that notifies the user that notifies a user after a slow process have finished, but instead of using the computers
// speech synthesiser or notification system, sends you a text instead. This means that you can leave the safe confines
// of your desk while scavenging office supplies, stalk colleagues or have a quiet smoko. I.e. it's the 2020 version of
// Ideal for those dependency fetching / compiling steps.
// To make this work you need to at least setup a `` trial account and define a couple ENV
// variables:
// # Get this from your twilio account
stojg / Features.php
Created Apr 5, 2017
Playing around with features
View Features.php
// could be abstract class?
interface FeatureInterface {
function isSupported();
interface LetmeinInterface extends FeatureInterface {
function letmein($username, $password);
stojg /
Last active Oct 4, 2016 — forked from codepunkt/
find/delete corrupt whisper-files
options=('find' 'delete')
PS3='state your wish: '
echo -e "\nfind/delete corrupt whisper-files"
select opt in "${options[@]}"; do
case $REPLY in
[12] ) option=$opt; break;;
* ) exit;;
stojg / mini_statemachine.js
Last active Oct 10, 2016
a mini example on how to implement a state machine for transitioning between states, like a user flow
View mini_statemachine.js
// these are generic functions that return boolean depending of the state in data
// they are used by state transitions to progress the state machine
const hasStarted = (data) => data.started === true;
const isEmployee = (data) => data.employee === true;
const isPersonal = (data) => data.personal === true;
// this is where we set up the full statemachine and connect 'from' states (e.g "initState") and where
// they can transition to (e.g. "setTypeState") and what would trigger that transition
const transitions = {
// initial state
View anonymiser.go
package main
import (
View hello
stojg / sleep_server.go
Created Mar 16, 2016
Sleep server, connects, but takes ages to respond
View sleep_server.go
package main
stojg / sleep.ino
Last active May 29, 2019
Arduino sleep example
View sleep.ino
#include "Arduino.h"
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/wdt.h>
// Blink Before sleeping
#define LED_PIN (13)
// This variable is made volatile because it is changed inside
// an interrupt function
stojg /
Created Feb 3, 2016
delete corrupted graphite whisper files
options=('find' 'delete')
PS3='state your wish: '
echo -e "\nfind/delete corrupt whisper-files"
select opt in "${options[@]}"; do
case $REPLY in
[12] ) option=$opt; break;;
* ) exit;;
You can’t perform that action at this time.