Skip to content

Instantly share code, notes, and snippets.

@tallykatt
tallykatt / hosted-bookmarklet.jquery.js
Created July 25, 2016 02:04 — forked from laander/hosted-bookmarklet.jquery.js
A nifty tool for creating hosted javascript browser bookmarklets supporting jQuery
/**
* Hosted jQuery Bookmarklet
* @description A nifty tool for creating hosted javascript browser bookmarklets supporting jQuery
* @author Laander (http://laander.com) at Konscript (http://konscript.com)
* @gist https://gist.github.com/gists/750857
*/
/**
* Usage:
* The following snippet should be the link saved as a bookmarklet by the user.
Bookmarklet

Copy and paste this into a bookmark:

javascript:!function(d){d.head.appendChild(d.createElement("style")).innerText="html,img,video{-webkit-filter:invert(1)hue-rotate(180deg);filter:invert(1)hue-rotate(180deg)}body{background:#000}"}(document);
@tallykatt
tallykatt / addEditCookie.js
Created July 25, 2016 02:01 — forked from acarbonaro/addEditCookie.js
Add or edit a cookie using a simple bookmarklet. Highlight the code and drag it to your bookmarks bar, just remember to give it a name!
javascript:(function(){var cookieName = prompt("Enter Cookie Name", ""); var cookieValue = prompt("Enter Cookie Value", ""); document.cookie=cookieName+"="+cookieValue+";path=/"; location.reload(); })();
@tallykatt
tallykatt / tabifytextareas.js
Created July 25, 2016 02:01 — forked from dougalcampbell/tabifytextareas.js
Bookmarklet: allow tabs in textareas (requires jQuery) Create a toolbar bookmark with this code. Click it when you want to be able to use tabs in a textarea.
javascript:$(document).delegate('textarea', 'keydown', function(e) { var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); var start = $(this).get(0).selectionStart; var end = $(this).get(0).selectionEnd; $(this).val($(this).val().substring(0, start) + "\t" + $(this).val().substring(end)); $(this).get(0).selectionStart = $(this).get(0).selectionEnd = start + 1; }});void(0);
@tallykatt
tallykatt / domSniper.js
Created July 25, 2016 02:01 — forked from joahg/domSniper.js
domSniper is a simple JavaScript bookmarklet to easily remove a DOM node from a document using JavaScript
(function(){
var body = document.body;
var snipe = function(e) {
body.style.cursor = 'initial';
e.preventDefault();
e.target.parentNode.removeChild(e.target);
body.removeEventListener('click', snipe, false);
};
body.addEventListener('click', snipe, false);
body.style.cursor = 'crosshair';
@tallykatt
tallykatt / ish-bookmarklet.js
Created July 25, 2016 02:00 — forked from beathorst/ish-bookmarklet.js
Bookmarklet that opens the current page into Brad Frost's ish. viewport resizing tool (http://bradfrostweb.com/demo/ish/). Ish. is opened in a new tab.
Standard mode:
javascript:var current_location=document.URL; var load=window.open('http://bradfrostweb.com/demo/ish/?url='+encodeURIComponent(current_location));
Open in disco mode!
javascript:var current_location=document.URL; var load=window.open('http://bradfrostweb.com/demo/ish/?url='+encodeURIComponent(current_location)+'#disco');
@tallykatt
tallykatt / bookmarkletSource.js
Created July 25, 2016 01:59 — forked from markharwood/bookmarkletSource.js
A "bookmarklet" to provide del.icio.us-style saving of webpage content into a search index
javascript:
function url_domain(url){
var a=document.createElement('a');
a.href=url;
return a.hostname;
}
function lowerCaseString(s){
if(s){
return s.toLowerCase();
}
@tallykatt
tallykatt / pma-db-select-bookmarklet.js
Created July 25, 2016 01:59 — forked from Erutan409/pma-db-select-bookmarklet.js
phpMyAdmin - Bookmarklet for quickly selecting database(s) on a search string
/**
* Will not select system databases (greyed out)
* Works with regular expressions:
* '^te' -> matches 'test' database
* '^est' -> will NOT match 'test' database
*
* I created this to easily drop numerous databases
* that are part of a large system, such as 'phabricator.'
*/
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.
@tallykatt
tallykatt / autossh.c
Created July 25, 2016 01:58 — forked from czerasz/autossh.c
useful commands
// Compile with
// gcc -o /etc/bin/autossh autossh.c
#include <stdio.h>
int main(int argc, char *argv[]) {
while(1) {
sleep(60);
printf(".\n");
}
}