Skip to content

Instantly share code, notes, and snippets.

@janstuemmel
janstuemmel / rc.xml
Created December 20, 2017 22:46
openbox keyboard media keys
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- config ... -->
<keyboard>
<!-- in section keyboard add following: -->
<keybind key="XF86AudioLowerVolume">
<action name="Execute"><execute>amixer -q sset Master 3%-</execute></action>
</keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute"><execute>amixer -q sset Master 3%+</execute></action>
</keybind>
@nickpelone
nickpelone / openbox-volume-keys
Last active January 19, 2022 16:21
Volume keys for Openbox rc.xml (~/.config/openbox/rc.xml)
<!---volume keys-->
</keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<execute>amixer sset Master 2+</execute>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<execute>amixer sset Master 2-</execute>
IMPORTANT: this is outdated, go to https://github.com/netroy/Lockets
"npm install socket-io" & you are ready to go
// Based on http://bit.ly/215MBZ
function FailureDetector(ws) {
// ws stands for window size.
// How many heartbeat intervals we keep track of.
this.ws = ws || 100;
this.window = [];
this.last = null;
}
exports.FailureDetector = FailureDetector;
@fat
fat / gist:859445
Created March 7, 2011 22:58
make this better.
function __tailingFn () {
for (var i = arguments.length; i--;) {
if (typeof arguments[i] == 'function') {
var fn = arguments[i];
arguments[i] = undefined;
return fn;
}
}
}
@tomlea
tomlea / proxy.rb
Created October 11, 2009 21:11
Rack Middleware to proxy requests to a remote server. This is usefull for proxying AJAX request to remote services.
require "net/http"
require "enumerator"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end