Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Birkner stefanbirkner

View GitHub Profile
@stefanbirkner
stefanbirkner / remove_old_snaps.sh
Created Apr 2, 2021
Removes old revisions of snaps
View remove_old_snaps.sh
#!/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 Jul 20, 2019
Create a checksum file in each directory
View checksum.sh
#!/usr/bin/env bash
readonly FOLDER=$1
create_checksum_file ()
{
local folder=$1
local file="$folder/md5_sums"
echo "Create checksum file $file"
View vim_cheatsheet.md
@stefanbirkner
stefanbirkner / object2yaml.js
Created Dec 19, 2017
JavaScript - Object2YAML
View object2yaml.js
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 Aug 29, 2015
Locations to visit
View to_visit.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View connectedhboxes.elm
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
View curl_cheat_sheet.md

Show timing information

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

View xx.md

#Rule and Runners

idealo

@StefanBirkner

##Rule

  • Code Duplication
  • Before/After
@stefanbirkner
stefanbirkner / blabla.md
Created Oct 19, 2014
Readme of semantic wrapper.
View blabla.md

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 Oct 2, 2014
Create API documentation with Sphinx
View apidoc.sh
sudo apt-get install python-sphinx
sphinx-apidoc -o dist <module>
sphinx-build -b html source build