Skip to content

Instantly share code, notes, and snippets.

Avatar

Niclas Hoyer niclashoyer

  • Kiel, Germany
View GitHub Profile
View fritzing-fedora.md

Dependencies

sudo dnf install git qt5-qtbase-devel qt5-qtsvg-devel qt5-qtserialport-devel

Building

@niclashoyer
niclashoyer / ioreg-svd.py
Last active Aug 29, 2015
Generating ioregs! macros from SVD files
View ioreg-svd.py
from cmsis_svd.parser import SVDParser
def getaccess(field):
if field.access == 'read-only':
return ': ro'
if field.access == 'write-only':
return ': wo'
return ''
def getoffset(field):
@niclashoyer
niclashoyer / keybase.md
Created Sep 22, 2014
keybase.io GitHub verification
View keybase.md

Keybase proof

I hereby claim:

  • I am niclashoyer on github.
  • I am niclashoyer (https://keybase.io/niclashoyer) on keybase.
  • I have a public key whose fingerprint is 7693 6404 9CAC 6CED BC02 C3E4 EDCE 346C 637C 3F49

To claim this, I am signing this object:

View ndrhd.sh
#!/bin/bash
curl -s http://www.ndr.de/sport/live/index.html | sed -n -e 's/.*\(http:\/\/.*akamaihd.*\.m3u8\).*/\1/p'
@niclashoyer
niclashoyer / flacmendo.sh
Last active May 2, 2020
Download a jamendo album as flac using the new v3.0 API (remember to insert your own application client id)
View flacmendo.sh
#!/bin/bash
# deps: bash, curl, sed, metaflac, jq
# remember to insert your own application client id (see CLIENTID below)
# to get an application client id register at http://developer.jamendo.com
set -e
set -u
function filtername() {
tr -cs "[:alnum:] \-&\(\)\?!" _
@niclashoyer
niclashoyer / L20n-mixin.coffee
Last active Sep 15, 2016
L20n mixin for react.js (UNTESTED!)
View L20n-mixin.coffee
###*
@jsx React.DOM
###
L20nMixin =
propTypes:
context: React.PropTypes.any.isRequired
getInitialState: ->
if @props.getLocalizedEntities?
ids = @props.getLocalizedEntities()
@niclashoyer
niclashoyer / backup.sh
Last active Aug 29, 2015
Simple docker backup
View backup.sh
#!/bin/bash
set -e
set -u
CONTAINER=$(docker ps -a --no-trunc | awk 'NR>1' | awk 'BEGIN {FS=" +"}; $5 ~ "^Up" {print $1}')
for C in $CONTAINER; do
echo "Backup for $C"
DATA=$(docker inspect $C)
View docker-snippets.sh
# get volumes for a container
docker inspect $container | jq '.[].Volumes|to_entries[].key'
@niclashoyer
niclashoyer / colour-light.vim
Last active Aug 29, 2015
light colorscheme for vim
View colour-light.vim
" Vim color file colour light
" generated by VimTax http://www.vimtax.com
set background=light
hi clear
if exists("syntax_on")
syntax reset
endif
set t_Co=256
let colors_name = "colour-light"
@niclashoyer
niclashoyer / cpconfig.sh
Last active Jan 19, 2018
Replace environment variables in configuration files with optional default using perl regular expressions.
View cpconfig.sh
#!/bin/bash
#
# Replaces ${var:def} expressions in text files with environment variables with
# an optional default.
#
# Assuming VAR1 contains the value "foo" nad VAR2 is undefined, the following
# expressions will evaluate as given on the right side:
#
# ${VAR1} ~> foo
# ${VAR2:bar} ~> bar
You can’t perform that action at this time.