This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to /usr/share/X11/xkb/symbols/no | |
partial alphanumeric_keys | |
xkb_symbols "colemak" { | |
// Colemak layout - http://colemak.com/ | |
include "no(basic)" | |
name[Group1]= "Norwegian (Colemak)"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function valueFromPath(object, path, separator) { | |
if("object" == typeof object && "string" == typeof path) { | |
var node = object; | |
if("string" != typeof separator || !separator.length) { | |
separator = "/"; | |
} | |
for(var segment; path && (segment = path.split(separator)[0]); path = path.slice(segment.length + separator.length)) { | |
if("object" == typeof node) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
command -v make > /dev/null 2>&1 && MAKE=make || true | |
command -v g++ > /dev/null 2>&1 && GPP=g++ || true | |
if [[ $MAKE = "" ]]; then | |
echo "Failed to detect make. Please install make before proceeding" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function objArrUniqKeys(arr, key) { | |
if(arr instanceof Array) { | |
var keys = []; | |
return arr.filter(function(elem, idx, arr) { | |
if(typeof elem == "object") { | |
if(elem.hasOwnProperty(key) && keys.indexOf(elem[key]) == -1) { | |
keys.push(elem[key]); | |
return true; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
"use strict"; | |
function toArray(array) { | |
return Array.prototype.slice.call(array); | |
} | |
function watchProperty(context, property, callback, thisArg) { | |
var path = property, descriptor, writable, getter, setter, value; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function dom(value, context) { | |
return typeof value == "string" ? _.$(value, context) : | |
(value instanceof _ ? value.dom : | |
(value instanceof HTMLElement ? value : null)); | |
} | |
function _(selector, options) { | |
if(selector instanceof _) { | |
return selector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var base64={table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",decode:function(t,e,r){function a(t){if(-1==(t=d.indexOf(t.charAt(0))))throw"invalid characater detected in base64.decode";return t}if(!(t=""+t).length)throw"invalid string length in base64.decode";var h,n,i=[],c=t.length,s=0,d=e?this.table.substr(0,62)+"-_":this.table;if(0==c||c%4&&!r)throw"invalid base64 string detected in base64.decode";for(c%4&&r?(s=4-c%4,c-=4):"="==t.charAt(c-1)&&(s="="==t.charAt(c-2)?2:1,c-=4),n=0;c>n;)h=a(t[n++])<<18|a(t[n++])<<12|a(t[n++])<<6|a(t[n++]),i.push(String.fromCharCode(h>>16,h>>8&255,255&h));switch(s){case 1:h=a(t[n++])<<18|a(t[n++])<<12|a(t[n++])<<6,i.push(String.fromCharCode(h>>16,h>>8&255));break;case 2:h=a(t[n++])<<18|a(t[n++])<<12,i.push(String.fromCharCode(h>>16))}return i.join("")},encode:function(t,e,r){function a(t){if((t=t.charCodeAt(0))>255)throw"invalid character detected in base64.encode";return t}if(!(t=""+t).length)throw"invalid string length in base64.encode";var h,n,i=[],c=t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var base64 = { | |
table: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', | |
decode: function(str, urlSafe, autoPad) { | |
if(!(str = ('' + str)).length) { | |
throw 'invalid string length in base64.decode'; | |
} | |
var b10, i, arr = [], len = str.length, padding = 0, table = (urlSafe ? this.table.substr(0, 62) + '-_' : this.table); | |
function charByte(c) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
function ℓ(c){return(c.toLowerCase()==c);} | |
String.prototype.ℛ=function(e,s){return this.replace(e,s.length>1?s:function(m){return(ℓ(m[0])?s:s.toUpperCase());});}; | |
function omgz0rify(s) { | |
return s | |
.ℛ(/s/ig,'z') // s -> z | |
.ℛ(/v/ig,'w') // v -> w | |
.ℛ(/o/ig,'0') // o -> 0 | |
.ℛ(/ae/ig,'æ') // ae -> æ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This configuration will enable the R.A.T.7 Mouse under X11 on GNU/Linux, | |
# by disabling the mode-selector button (recognized as buttons 13, 14 and 15). | |
# Add this configuration to /etc/X11/xorg.conf.d/12-mouse-rat.conf, and restart X. | |
# Good luck! :) | |
Section "InputClass" | |
Identifier "R.A.T.7 Mouse" | |
MatchProduct "Saitek Cyborg R.A.T.7 Mouse" | |
MatchDevicePath "/dev/input/event*" | |
Option "Buttons" "12" |