Skip to content

Instantly share code, notes, and snippets.

@tallykatt
tallykatt / bookmarklet.js
Created January 1, 2016 04:29 — forked from kn0ll/bookmarklet.js
advanced bookmarklet template
javascript:(function() {
if(!window.your_bookmarklet) {
var doc = document,
js = doc.createElement('script');
js.type = 'text/javascript';
js.src = 'loader.js';
js.async = true;
@tallykatt
tallykatt / notepad.html
Created May 24, 2016 12:00 — forked from jdkanani/notepad.html
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@tallykatt
tallykatt / jquery-bookmarklet.html
Created July 24, 2016 23:28 — forked from juli-so/jquery-bookmarklet.html
jQuery Mobile View Source Bookmarklet Website
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jQuery Mobile Original Source Bookmarklet for Chrome</title>
<style type="text/css" media="screen">
body, html, h1 { margin: 0; padding: 0; }
html { padding: 20px; background: #ddd; }
body { max-width: 600px; margin: 0 auto; padding: 20px; box-sizing: border-box; background: #fff; font-family: Helvetica, arial; box-shadow: rgba(0,0,0,0.2) 0 0 5px }
@tallykatt
tallykatt / overlay.js
Created July 24, 2016 23:29 — forked from mbobin/overlay.js
bookmarklet - adds a black div as overlay
// add layer
javascript:(
function() {
var div = document.createElement('div');
var w = window.innerWidth;
var h = window.innerHeight;
div.setAttribute("class", "black-overlay");
div.setAttribute("style", "position: fixed; top: 0px; left:0px; width: "+w+"px; height: "+h+"px; background-color: rgba(0,0,0,0.3); pointer-events: none; z-index: 4294967296");
document.body.appendChild(div);
}
@tallykatt
tallykatt / gist:3cc7784daf75d382b1dd21d03a52f0a1
Created July 24, 2016 23:29 — forked from tacone/gist:fabce42b46991702b458
Bookmarklet to replace a textarea with a code editor
javascript: function loadScripts(array, callback) {
var loader = function(src, handler) {
var script = document.createElement("script");
script.src = src;
script.onload = script.onreadystatechange = function() {
script.onreadystatechange = script.onload = null;
handler();
};
var head = document.getElementsByTagName("head")[0];
(head || document.body).appendChild(script);
@tallykatt
tallykatt / jqi_bookmarklet.js
Created July 24, 2016 23:30 — forked from inblank/jqi_bookmarklet.js
Bookmarklet: jQuery injection to the current opened page
javascript:(function(){var script = document.createElement('script');script.type = 'text/javascript';script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.js';document.head.appendChild(script);})();
@tallykatt
tallykatt / search-on-spotify.js
Created July 24, 2016 23:30 — forked from troy/search-on-spotify.js
Bookmarklet to search/play highlighted artist on Spotify Web Player
javascript:window.location.href="https://play.spotify.com/search/"+encodeURIComponent(window.getSelection())
@tallykatt
tallykatt / genius-bookmarklet.js
Created July 24, 2016 23:31 — forked from wulymammoth/genius-bookmarklet.js
Annotate the world with this Genius Bookmarklet (Chrome)
// 1. Right-click on the bookmarks toolbar
// 2. Click Add Page...
// 3. Name: <enter whatever you'd like> (Mine is Genius Annotate)
// 4. Paste the following into the URL field (including the keyword javascript and the colon):
javascript: window.location.replace('http://genius.it/' + window.location.href)
@tallykatt
tallykatt / bookmarklet.js
Created July 24, 2016 23:34 — forked from Shoora/bookmarklet.js
the bookmarklet bookmarklet
function getJSON (url, callback) {
var xhr;
xhr = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (callback) {
callback(xhr.responseText);
}
}
};