Skip to content

Instantly share code, notes, and snippets.

View hmbrg's full-sized avatar

Matthias hmbrg

View GitHub Profile
@hmbrg
hmbrg / install.sh
Created July 13, 2017 20:03
Install netatalk on debian
cd
wget http://downloads.sourceforge.net/project/netatalk/netatalk/3.1.11/netatalk-3.1.11.tar.bz2
tar xvf netatalk-3.1.11.tar.bz2 -C netatalk/
cd netatalk
sudo apt-get install \
build-essential \
build-essential \
libssl-dev \
@hmbrg
hmbrg / index.js
Last active March 18, 2017 21:48
Favicon changer
(function() {
var favurl = prompt("Insert icon url.", "url...");
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = favurl;
document.getElementsByTagName('head')[0].appendChild(link);
}());
@hmbrg
hmbrg / Evernote-h2-converter-bookmarklet
Last active December 11, 2016 17:43
Evernote H2 converter
javascript:(function()%7B%24(%24(%22%23en-common-editor-iframe%22).contents()%5B0%5D).find(%22u%20b%2C%20b%20u%22).each(function(i)%20%7Bvar%20text%20%3D%20%24(this).text()%3Bvar%20parent%20%3D%20%24(this).parent()%3B%24(this).remove()%3Bparent.replaceWith(%22%3Ch2%3E%22%20%2B%20text%20%2B%20%22%3C%2Fh2%3E%22)%3B%7D)%7D)()
@hmbrg
hmbrg / gist:d440858626c8877d6e61dd16b45aed65
Created June 10, 2016 17:31
YouTube Music tab for YouTube Desktop
javascript:(function()%7Bdocument.querySelector('.appbar-nav-menu').innerHTML %2B%3D '<li><a href%3D"%2Ffeed%2Fmusic" class%3D"yt-uix-button spf-link yt-uix-sessionlink yt-uix-button-epic-nav-item yt-uix-button-size-default" data-sessionlink%3D"ei%3D4UgzV5uvCdSmWvqDltAK%26amp%3Bved%3DCJ8EEMMtGAEiEwjbo7bWpNLMAhVUkxYKHfqBBaoo6R4" aria-selected%3D"false"><span class%3D"yt-uix-button-content">Music<%2Fspan><%2Fa><%2Fli>'%7D)()
@hmbrg
hmbrg / sql.md
Created April 28, 2016 17:36
SQL TUT

SQL Tutorial

Einleitung

Dieses Tutorial wird die Grundlagen der SQL-Sprache vermittlen und diese mit einfachen Beispielen erläutern.

Für dieses Tutorial nutzen wir die bekannte "Northwind Traders"-Datenbank, wofür sich hier ein ER-Diagramm finden lässt. Die Struktur der Datenbank sieht wie folgt aus:

Tabellenname Einträge
Customers 91
@hmbrg
hmbrg / OPENSHIFT-git-deploy.md
Last active April 24, 2016 15:30
OpenShift: Git deployment process

OpenShift: Git deployment process

This document assumes that you already have an existing project git repo and now want to add OpenShift for deployment.

You should also have installed and setup the rhc tool by OpenShift and created an application on the OpenShift platform.

Setup

Add remote to OpenShift (only once)

Get ssh git adress from the OpenShift Dashboard/Application. Then add from root of repo folder a new remote to git repo.

@hmbrg
hmbrg / electron-savedialog.js
Created April 9, 2016 17:53
Electron: saving dialog
const dialog = electron.dialog;
dialog.showSaveDialog(null,
{
title: 'Select download file...',
defaultPath: 'defaultFileName'
filters: [
{ name: 'Images', extensions: ['jpg'] }
]
},
@hmbrg
hmbrg / GooglePlayMusicHotkeys.ahk
Created March 7, 2016 19:47
AHK for Unofficial Google Play Music Client
; Pause
Media_Play_Pause::
send, !^+p
Return
; Next
^+PgDn::
send, !^+i
Return
@hmbrg
hmbrg / getRes.js
Last active February 27, 2016 17:08
Get screen resulution on windows using node
const spawn = require('child_process').spawn;
const bat = spawn('cmd.exe', ['/c', __dirname + '/getScreenRes.bat']);
bat.stdout.setEncoding('utf8');
var out = "";
bat.stdout.on('data', (data) => {
out = out + data;
});