Skip to content

Instantly share code, notes, and snippets.

@svenax
svenax / Makefile
Last active February 12, 2020 15:39
Self documenting Makefile with target groups
##@ Group
command: ## Help for target 1
@echo Target 1
another_command: ## Help for target 2
@echo Target 1
more_stuff: ## Help for target 3
@echo Target 1
##@ Another group
#!/bin/bash
PREFIX="${1%/}"
if [ -z "$PREFIX" ]; then
PREFIX="."
fi
for D in $PREFIX/*/; do
pushd "${D}" &> /dev/null
if [ -d ".git" ]; then
echo "Updating ${D}"
@svenax
svenax / brew-cask.txt
Last active July 17, 2018 07:02
brew cask install
1password
adguard
adobe-digital-editions
agenda
araxis-merge
bartender
betterzip
bookmacster
busycal
cleanmymac
@svenax
svenax / brew.txt
Last active July 17, 2018 07:02
brew install
automake
bfg
clang-format
cmake
cocoapods
composer
docker
docker-machine
dos2unix
duti
@svenax
svenax / brew-tap.txt
Last active July 17, 2018 07:02
brew tap
homebrew/cask
homebrew/cask-versions
homebrew/core
<?php
class FakeStuff
{
private $faker = null;
public function __construct()
{
$this->faker = Faker\Factory::create('sv_SE');
}
@svenax
svenax / git-subrm.sh
Last active December 19, 2015 01:19
Completely remove a submodule from a Git repository.
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@svenax
svenax / natchars.ahk
Last active December 11, 2015 21:28
National character key chords for use with AutoHotkey (http://www.autohotkey.com)
; -*- st-default_line_ending: windows -*-
; National characters ========================================================
#Hotstring * ? ; Expand immediately everywhere
::,aa::á
::,ae::æ
::,ag::à
::,cc::ç
::,ee::é
@svenax
svenax / gist:4240892
Created December 8, 2012 16:26
Pandoc make file
SOURCE = example_file.md
HTML = $(SOURCE:.md=.html)
PDF = $(SOURCE:.md=.pdf)
WIKI = $(SOURCE:.md=.wiki)
all: $(HTML) $(PDF) $(WIKI)
clean:
rm -f *.aux *.tex *.out *.log *.html *.pdf *.wiki
@svenax
svenax / handleBlockdiag.hs
Created September 18, 2012 15:50
Pandoc filter for http://blockdiag.com diagrams
Compile the Haskell code with ghc and put it somewhere convenient. Then call Pandoc as:
pandoc -t json test.md | handleBlockdiag png | pandoc -f json -o test.html