Skip to content

Instantly share code, notes, and snippets.

View stefanbirkner's full-sized avatar

Stefan Birkner stefanbirkner

View GitHub Profile
@stefanbirkner
stefanbirkner / remove_old_snaps.sh
Created April 2, 2021 15:23
Removes old revisions of snaps
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@stefanbirkner
stefanbirkner / checksum.sh
Created July 20, 2019 20:10
Create a checksum file in each directory
#!/usr/bin/env bash
readonly FOLDER=$1
create_checksum_file ()
{
local folder=$1
local file="$folder/md5_sums"
echo "Create checksum file $file"
@stefanbirkner
stefanbirkner / vim_cheatsheet.md
Last active February 8, 2019 20:53
Vim Cheat Sheet
@stefanbirkner
stefanbirkner / object2yaml.js
Created December 19, 2017 16:24
JavaScript - Object2YAML
function concat(firstText, secondText) {
return firstText + secondText;
}
function escape(key) {
if (key.match(/^[A-Za-z0-9\-\_]+$/))
return key
else
return `"${key}"`
}
@stefanbirkner
stefanbirkner / to_visit.geojson
Last active August 29, 2015 14:25
Locations to visit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Mouse
import Window
type alias Box = (Int,Int)
type alias Editor = { boxes: List Box }
main : Signal Element
@stefanbirkner
stefanbirkner / curl_cheat_sheet.md
Created January 8, 2015 07:30
My cURL Cheat Sheet.

Show timing information

curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total}

@stefanbirkner
stefanbirkner / xx.md
Last active August 29, 2015 14:08
goto talk

#Rule and Runners

idealo

@StefanBirkner

##Rule

  • Code Duplication
  • Before/After
@stefanbirkner
stefanbirkner / blabla.md
Created October 19, 2014 17:29
Readme of semantic wrapper.

Semantic Wrapper

Generates classes that wrap other classes. Such wrapper classes can be used for named parameters in order to write better code.

Installation

The Semantic Wrapper Maven plugin is available from Maven Central.

@stefanbirkner
stefanbirkner / apidoc.sh
Created October 2, 2014 06:07
Create API documentation with Sphinx
sudo apt-get install python-sphinx
sphinx-apidoc -o dist <module>
sphinx-build -b html source build