Skip to content

Instantly share code, notes, and snippets.

View elundmark's full-sized avatar
💭
I may be slow to respond.

elundmark

💭
I may be slow to respond.
View GitHub Profile
"use strict";
// var server = require("./static_server.js");
// server.actions.start("dir", 8080);
// // server.actions.stop();
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
@elundmark
elundmark / config.mk
Created June 11, 2014 04:45
dmenu 4.5 config.mk for lubuntu 14.04
# dmenu version
VERSION = 4.5
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/include/X11
X11LIB = /usr/lib/X11
var Benchmark = require('benchmark');
var microtime = require('microtime');
var suite = new Benchmark.Suite();
suite
.add('Date.now()', function () {
var diff1 = Date.now() - Date.now();
})
.add('microtime.now()', function () {
@elundmark
elundmark / openbox.xml
Last active August 29, 2015 14:02
Set Opacity of window in Openbox Ondemand ( and Lubuntu)
<!--
[in Lubuntu it's ~/.config/openbox/lubuntu-rc.xml]
Shift+Super+Scrollwheel Up/Down
http://openbox.org/wiki/Help:Bindings#Context
Depends on having enabled compositing w/
something like compton (recommended) or xcompmgr
-->
<mouse>
<context name="Titlebar">
<mousebind button="S-W-Up" action="Click">
@elundmark
elundmark / spawn.sh
Created August 21, 2014 13:32
BASH: spawn a new process to the background
# add to your .bashrc or .bash_aliases
# instead of executing, then doing ctrl+z, bg, disown
spawn () {
if [[ "$(which $1 2> /dev/null)" ]]; then
setsid $@ &> /dev/null &
else
echo "not executable"
fi
}
@elundmark
elundmark / imdb-torrentz-link.user.js
Last active August 29, 2015 14:05
UserScript - IMDB Add torrentz.eu search link v0.6
@elundmark
elundmark / export.json
Created September 4, 2014 16:43
Default export TzAio 2.5.14 - Issue #5
# Torrentz All-in-One 2.5.14
# Exported settings (Thu Sep 04 2014 18:39:38 GMT+0200 (CEST))
{"forceHTTPS":false,"removeAds":true,"searchHighlight":true,"ajaxedSorting":true,"linkComments":true,"searchTabs":true,"defaultTrackers":["http://tracker.best-torrents.net:6969/announce","udp://tracker.ccc.de:80/","http://tracker.ccc.de:80/","udp://open.demonii.com:1337/announce","http://inferno.demonoid.com:3407/announce","http://exodus.desync.com:6969/announce","http://www.eddie4.nl:6969/announce","udp://fr33dom.h33t.com:3310/announce","http://tracker.ilibr.org:6969/announce","udp://tracker.istole.it:6969/","udp://tracker.openbittorrent.com:80/","http://tracker.openbittorrent.com:80/","udp://tracker.prq.to/announce","udp://tracker.publicbt.com:80/","http://tracker.publicbt.com:80/","udp://11.rarbg.com/announce","http://9.rarbg.com:2710/announce","http://bt1.the9.com:6969/announce","http://tracker.torrent.to:2710/announce","http://tracker.xpear.de:6969/announce","http://tracker.yify-torrents.com/announce"],"searchEng
@elundmark
elundmark / spawn_in_bg.sh
Created October 2, 2014 11:15
Bash function to spawn a process in the background
spawn () {
if [[ ! "$(which $1 2> /dev/null)" = "" ]]; then
setsid $@ &> /dev/null &
else
echo "not executable"
fi
}
@elundmark
elundmark / Array.insert.js
Created November 24, 2014 03:46
Array.prototype.insert
// My brain understands this better than .splice
/* var fruits = ["A","B","C"]; */
if ( typeof Array.insert !== "function" ) {
Array.prototype.insert = function () {
var args = Array.prototype.slice.call(arguments, 0);
// Convert non arrays to array
if ( args.length && !Array.isArray(args[0]) ) args[0] = [args[0]];
// Set default position
@elundmark
elundmark / feed_handler.sh
Last active August 29, 2015 14:10
Feed Handler for Custom Feed Readers (tested in Firefox)
#!/usr/bin/env bash
# Requires NodeJS (or rewrite line:13 if you known perl or python), plus xdg-open
# Edit the link to your rss reader here
feed_handler='https://my-feed-reader.com/?add&newfeed='
arglen=$#
args=("$@")
looped=0