Skip to content

Instantly share code, notes, and snippets.

@miebach
miebach / keyboard-repeat.sh
Created February 6, 2014 20:25
change keyboaard repeat rrrrrate
#!/bin/sh
xset r rate 130 70
# 130 is the delay before the keypress starts repeating
# 70 is the pause between the repeaats
@miebach
miebach / brightness-secondary-monitor.sh
Created February 16, 2014 16:51
Set brightness for secondary / external screen / monitor
xrandr -q | grep -w connected
xrandr --output VGA1 --brightness 0.8
@miebach
miebach / set-time-server.cmd
Created March 4, 2014 03:23
set time server
rem # Zeit-Dienst anhalten:
net stop w32time
rem # Extern Zeitsever manuell hinzufügen:
rem # w32tm /config /syncfromflags:manual /manualpeerlist:"0.ntp.pool.org,0x1 1.ntp.pool.org,0x1"
w32tm /config /syncfromflags:manual /manualpeerlist:"0.ntp.pool.org 1.ntp.pool.org"
rem # Den Clients verfügbar machen:
w32tm /config /reliable:yes
rem # Zeit-Dienst starten:
@miebach
miebach / exit_code_dos.md
Last active August 29, 2015 13:59
How to check or return exit codes in batch files?

How to check or return exit codes in batch files?



call other.cmd
if %ERRORLEVEL% == 0 GOTO PASSED

rem Do something..
...
@miebach
miebach / randomstring.sh
Created June 3, 2014 20:00
Generate random strings in bash
< /dev/urandom tr -dc A-Za-z0-9 | head -c8
#or
echo $RANDOM
@miebach
miebach / gist:f4367a1ac2ad56cab159
Last active August 29, 2015 14:03
Linux hardware info
sudo lshw|more
sudo dmidecode|more
lspci -v
hwinfo --bios | grep Manufacturer
hwbrowser
// Define core directive code + attributes and store that as a module value
angular.module('com.namespace.directives').value('MyDirectiveCore', MyDirectiveCore);
function MyDirectiveCore($compile) {
this.restrict = 'A';
this.priority = 10;
this.link = postLink;
return this;
Reusing an AngularJS Directive core code. The idea is to:
** 1. conceal the actual directive behaviour in a separate JS "class",
** 2. store that in an Angular service,
** 3. inject that service into an Angular directive,
** 4. just have the directive factory function return the constructed instance of the "class".
That is to separate the directive core code from the actual directive factory.
Then one actually wants to inherit a directive core "class" from another. It's not really a matter of JS inheritance, but more on how to inject one into the other by means of Angular modules, without actually instantiating none of them until needed,
-module(health).
-behaviour(gen_server).
-export([start_link/0,
check/0, alert/0, dump/0,
threshold/1, poll/1, url/1
]).
-export([init/1, handle_call/3]).
@miebach
miebach / .ungitrc
Last active August 29, 2015 14:04
Ungit configuration at ~/.ungitrc
{
"port": 7001,
"bugtracking": false,
"autoStashAndPop": false,
"launchBrowser": false
}