Skip to content

Instantly share code, notes, and snippets.

/*
* Property prefix hacks
*/
/* IE6 only - any combination of these characters */
_ - £ ¬ ¦
/* IE6/7 only - any combination of these characters */
@Mouvedia
Mouvedia / trim
Last active September 13, 2015 22:40
//http://perfectionkills.com/whitespace-deviations/
//https://web.archive.org/web/20150905201345/http://www.merlyn.demon.co.uk/js-valid.htm#RsT
''.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g, '')})
@Mouvedia
Mouvedia / String.js
Last active January 30, 2016 21:06
String
//https://github.com/Mouvedia/isString
String.parseAsClass = function(className, HTML5) {
if (!String.isString(className))
throw new TypeError('The passed argument must be a string.');
if (className === '')
throw new SyntaxError('The string provided must not be empty.');
if (!HTML5) {
className = className.replace(/^[ \t\n\f\r\u200b]+|[ \t\n\f\r\u200b]+$/g, '');
[
[:app :-lt.objs.intro/show-intro]
[:app :lt.objs.style/set-skin "dark"]
[:app :lt.objs.sidebar.workspace/workspace.open-on-start]
[:app :lt.objs.app/run-post-init [:window.maximize]]
[:app :lt.plugins.gitlight/config {:git-binary "git" :max-history 64}]
[:tabset.tab :lt.plugins.user/push-active-tab]
[:tabs-extended :lt.plugins.user/last-tab]
[
[:app "cmd-alt-right" :tabset.next]
[:app "cmd-alt-left" :tabset.prev]
[:app "ctrl-shift-right" :tabs.next]
[:app "ctrl-shift-left" :tabs.prev]
[:app "alt-w" :workspace.show]
[:app "alt-f" :searcher.show]
[:app "alt-space" :navigate-workspace-transient]
[:app "pmeta-b" :add-browser-tab]
try {
angular.bootstrap(document.body, ['moduleName']);
} catch(e) {
angular.element(document.body).injector().invoke(function($compile) {
var scope = angular.element(element).scope();
$compile(element)(scope);
scope.$apply();
});
}
@Mouvedia
Mouvedia / manifest.json
Created April 4, 2018 15:24
manifest mandatory properties
{
"name": "",
"description": "",
"background_color": "#",
"icons": [{
"src": ".png",
"sizes": "512x512",
"type": "image/png"
}]
}
/*
dependencies
isArray
defineProperties
TODO
defineProperties > defineProperty
http://stackoverflow.com/a/17935125/248058
isString
clear
typeof this.className === 'object' ? this.setAttribute('class', '') : this.className = '';
@Mouvedia
Mouvedia / rules
Last active June 29, 2019 11:53
karabiner
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 400,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
# .hushlogin
# .inputrc
"\e\e[C": forward-word
"\e\e[D": backward-word
# .bashrc
ulimit -n 2048 # /Library/LaunchDaemons/limit.maxfiles.plist