Skip to content

Instantly share code, notes, and snippets.

Working from home

Jan Baer janbaer

Working from home
Block or report user

Report or block janbaer

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
janbaer /
Created Jan 25, 2019
Read all lines from the passed file and do something with each line
while IFS='' read -r line || [[ -n "$line" ]]; do
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' $line
done < "$1"
janbaer /
Created Jan 25, 2019
Rename files that are located in the current directory
for FILE in *.mp4; do
mv "$FILE" "`echo $FILE | sed -r "s/^(.+)_hd-froscon16.+.mp4$/\1.mp4"/`";
janbaer /
Last active Dec 23, 2018
Some Github API GraphQL calls

Github API GraphQL calls

All repositories of a user

query { 
	user(login:"janbaer") {
    repositories(first: 100) ,{
janbaer / 01-curl.go
Created Nov 18, 2016 — forked from jmoiron/01-curl.go
io.Reader & io.Writer fun
View 01-curl.go
package main
import (
func init() {
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
janbaer / Dockerfile
Created Oct 22, 2016 — forked from andyshinn/Dockerfile
BusyBox cron container example
View Dockerfile
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
janbaer /
Created Jan 3, 2016 — forked from marszall87/
Simple script for installing latest Docker Compose on CoreOS >= 717.0.0
mkdir -p /opt/bin
curl -L `curl -s | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
janbaer / git-purge.ps1
Last active Mar 4, 2016
Purges all remote deleted feature branches locally
View git-purge.ps1
function Git-Purge () {
  git fetch -p | git branch --color=never --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | xargs -n 1 git branch -d
janbaer / count_angular_watches.js
Created Apr 15, 2015
Count the number of Angular watches
View count_angular_watches.js
(function () {
var root = angular.element(document.getElementsByTagName('body'));
var watchers = [];
var f = function (element) {
angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) {
if ( && {
angular.forEach([scopeProperty].$$watchers, function (watcher) {
janbaer / index.html
Created Sep 16, 2014
Angular promises
View index.html
<!DOCTYPE html>
<script src=""></script>
<meta charset="utf-8">
<title>JS Bin</title>
<body ng-app="MyApp">
<div ng-controller="MyController">
<button ng-click="fetchData()">Fetch data</button>
You can’t perform that action at this time.