Skip to content

Instantly share code, notes, and snippets.

Avatar

Ronny Orbach RonnyO

View GitHub Profile
@RonnyO
RonnyO / wa.me.bookmarklet.js
Last active Sep 10, 2022
Message any number on WhatsApp - Bookmarklet
View wa.me.bookmarklet.js
javascript:void%20function(){let%20a=prompt(%22Type%20a%20phone%20number%22,%22+972%22);a=a.replace(/^0/,%22+972%22).replace(`${%22+972%22}0`,%22+972%22).replace(/-/g,%22%22),window.open(%22https://wa.me/%22+a,%22_blank%22)}();
@RonnyO
RonnyO / 0_reuse_code.js
Created Mar 28, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@RonnyO
RonnyO / getLargestYoutubeThumbnail.js
Created Mar 31, 2016
getLargestYoutubeThumbnail - Because maxresdefault.jpg isn't reliable. Requires jQuery/Zepto, example here: http://jsbin.com/bamiju/edit?html,css,js,output
View getLargestYoutubeThumbnail.js
// getLargestYoutubeThumbnail by @ReallyGoodTeam, MIT
/* Sample youtube IDs
teYZM0Aft0A
wr1fa3ZaNYY
8e-BsJoaS20 - doesn't have maxresdefault
*/
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@RonnyO
RonnyO / console.lol.min.js
Last active Dec 11, 2015
Minified console.lol
View console.lol.min.js
// https://gist.github.com/4545779
"undefined"!=typeof console&&(console.lol=function(){var a=[].slice.call(arguments,0);a.unshift("LOL");a.push("LOLOLOL!");console.log.apply(console,a)});
@RonnyO
RonnyO / console.lol.js
Created Jan 16, 2013
Like console.log, just a tiny bit funnier
View console.lol.js
// console.lol by @RonnyOrbach, idea by Erez Avny
if (typeof console != 'undefined') console.lol = function(){
var args = [].slice.call(arguments, 0);
args.unshift("LOL");
args.push("LOLOLOL!")
console.log.apply(console, args);
};
@RonnyO
RonnyO / word-frequency-counter.js
Created Jun 27, 2012 — forked from ernestom/word-frequency-counter.js
Bookmarklet to count word frequency
View word-frequency-counter.js
(function () {
var settings = {
listLength: 30,
ignore: ['if', 'as', 'is', 'the', 'any', 'and', 'to', 'or', 'a', 'of']
},
w, s;
function getBodyText() {
var doc = document,
body = doc.body,
selection, range, bodyText;
@RonnyO
RonnyO / protectAlert.js
Created Jun 12, 2012
Mute alert() calls when not in debug mode; Enter & exit debug mode via url/cookie; Throttles alerts when active
View protectAlert.js
// warning - This gist is probably be 'too clever', and has two side effects which you might not want:
// - It doesn't queue alerts but silents them, so you may miss some calls
// - You might forget about it or another developer won't know about it, and won't have a clue why alert() calls don't work
(function(){
window.debugMode = false;
if(/startdebug/.test(location.href)) document.cookie = 'debug=true';
if(/stopdebug/.test(location.href)) document.cookie = 'debug=false';
if(document.cookie.indexOf('debug=true') > -1) debugMode = true;
@RonnyO
RonnyO / asyncGA.html
Created Apr 16, 2012
Async Google Analytics Snippet, from h5bp
View asyncGA.html
<script>
var _gaq=[['_setAccount','UA-XXXXXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
@RonnyO
RonnyO / jquery.qDefer.min.js
Created Apr 15, 2012
Simply mimic the 'defer' attribute for inline scripts across all browsers (jQuery helper)
View jquery.qDefer.min.js
// http://bit.ly/qDefer
$(function(){$('script[type="text/javascript/defer"]').each(function(){$(this).clone().attr('type','').insertAfter(this)})});