Skip to content

Instantly share code, notes, and snippets.

View StephanStanisic's full-sized avatar

Stephan Stanisic StephanStanisic

View GitHub Profile
@Neo-Desktop
Neo-Desktop / center_func.sh
Last active December 1, 2022 20:50
Bash function to vertically/horizontally center text
#!/bin/bash
##
# Horizontaly centers a line of text
#
# @method hcenter
# @param string $text - splat of text
#
##
function hcenter {
@WouterG
WouterG / globalmods.js
Last active June 28, 2017 07:09
Whatsapp fullscreen modification
// ==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==
@parameshyss
parameshyss / loop_msg.js
Created December 2, 2015 12:52
Whatsapp message Loop
// 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
@hauptbenutzer
hauptbenutzer / gist:72dd8b483f0886092106
Created March 26, 2015 18:03
WhatsApp Web Smiley Replacement
/**
* 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
*
@juliocesar
juliocesar / best-localStorage-polyfill-evar.js
Created April 18, 2011 23:19
This is the best localStorage polyfill in the world
// 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; },