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
// I mean, seriously, localStorage is supported even by your mum. How about instead of | |
// casing the feature out, you give users in-memory (stale) storage instead? | |
// If they close your application, they deserve to lose data anyway. | |
// if (!('localStorage' in window)) { | |
if (!Modernizr.localstorage) { | |
window.localStorage = { | |
_data : {}, | |
setItem : function(id, val) { return this._data[id] = String(val); }, | |
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; }, |
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
/** | |
* Simple script that replaces text smileys like ':)' with the corresponding | |
* emoji. Can be injected via Chrome Plugin 'Custom JavaScript', requires jQuery | |
* to be loaded along with it. | |
*/ | |
/** | |
* Rangy, a cross-browser JavaScript range and selection library | |
* https://github.com/timdown/rangy | |
* |
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
// Impress your gf with this simple js | |
// Open https://web.whatsapp.com/ | |
// select the person you want to send this msg on loop & type the following script on developer console of your browser | |
var intervalID = setInterval(function () { | |
var message = document.createEvent("TextEvent"); | |
message.initTextEvent ("textInput", true, true, window, "I think of you every second", 0, "en-US"); | |
document.getElementsByClassName("input")[1].focus(); // Focus on message box | |
document.getElementsByClassName("input")[1].dispatchEvent(message); // Type message | |
document.getElementsByClassName("icon btn-icon icon-send")[0].click(); // Click send | |
}, 1000); // Repeat every sec |
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
// ==UserScript== | |
// @name GLOBAL MODS | |
// @namespace http://wouto.net/ | |
// @version 2.0 | |
// @description Some mods to the LocalStorage engine, an ImageLoader and a StyleUtil, which is effective on all sites that Tampermonkey is allowed to run on | |
// @author Wouter | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== |
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 | |
## | |
# Horizontaly centers a line of text | |
# | |
# @method hcenter | |
# @param string $text - splat of text | |
# | |
## | |
function hcenter { |