Skip to content

Instantly share code, notes, and snippets.

@tallykatt
tallykatt / bookmarklets.js
Created July 25, 2016 02:15 — forked from amerberg/bookmarklets.js
Quora bookmarklets
/* These are bookmarks for making various tasks on Quora easier.
* Since GitHub Markdown doesn't allow JavaScript links, you'll have to install the complicated way.
* Each of the lines beginning with `javascript:` below is a bookmarklet.
* To install, create a new bookmark in your browser and paste that line as the URL.
* Leave feedback in Gist comments or contact https://www.quora.com/Adam-Merberg
*/
//Get the rank of the answer belonging to the logged-in user (in a JS alert box).
//You will have to scroll down far enough that your answer has loaded before you use it.
//Perhaps a future version will do that automatically.
@tallykatt
tallykatt / prettifyJSON.js
Created July 25, 2016 02:14
JSON prettifier
// The original code from Scott Bush (http://scottbush.net/it/better-living-through-bookmarklets-json-prettifier/)
// I made a little change in it and now you can use it as a bookmarklet both on http and https
// The bookmarklet: javascript:(function()%7Bdocument.body.appendChild(document.createElement(%27script%27)).src%3D%27//rawgit.com/iharosi/1a95074c9e47ae9b649b/raw/18f25c45fcb0610bd8eabd389e1d794c0f13d383/prettifyJSON.js%27%3B%7D)()%3B
function FormatJSON(oData,sIndent){if(arguments.length<2){var sIndent="";}
var sIndentStyle=" ";var sDataType=RealTypeOf(oData);console.log(sDataType);if(sDataType=="array"){if(oData.length==0){return"[]";}
var sHTML="[";}else{var iCount=0;$.each(oData,function(){iCount++;return;});if(iCount==0){return"{}";}
var sHTML="{";}
var iCount=0;$.each(oData,function(sKey,vValue){if(iCount>0){sHTML+=",";}
if(sDataType=="array"){sHTML+=("\n"+sIndent+sIndentStyle);}else{sHTML+=("\n"+sIndent+sIndentStyle+"\""+sKey+"\""+": ");}
@tallykatt
tallykatt / GiantBomb HLS Video player.js
Created July 25, 2016 02:14 — forked from andymason/GiantBomb HLS Video player.js
Lower CPU usage than Flash player with the benefits of bitrate stream switching.
// How to use:
// 1. Save the bookmarklet
// 2. Install the Allow-Control-Allow-Origin: * chrome / firefox extention
// 3. Go to a Giantbomb video page and click the Bookmarklet
// ## Bookmarklet
javascript:(function(){var el=document.createElement("script");el.addEventListener("load",function(){if(Hls.isSupported()){var e=new Hls;e.loadSource(videoData.videoStreams.m3u8_stream),e.attachMedia(videoEl),e.on(Hls.Events.MANIFEST_PARSED,function(){videoEl.currentTime=videoData.savePosition.savedTime,videoEl.play()})}},!1),el.src="https://cdn.rawgit.com/dailymotion/hls.js/master/dist/hls.min.js",document.body.appendChild(el);var vidWrapper=document.querySelector(".js-video-player"),videoData=JSON.parse(vidWrapper.dataset.video),videoEl=document.createElement("video");videoEl.controls=!0,videoEl.style="width:100%;height:100%;position:relative;z-index:999;",vidWrapper.parentNode.replaceChild(videoEl,vidWrapper);var d=new Date;d.setTime(d.getTime()+3456e5),videoEl.addEventListener("timeupdate",function(e){document.c
javascript:function tinycc_bookmarklet(){var script=document.createElement('script');script.src='http://tiny.cc/public/javascript/bookmarklet.js';scriptObj=document.body.appendChild(script);}tinycc_bookmarklet();
javascript:void(window.open('http://3.ly/?bm=1&u='+encodeURIComponent(location.href)))
javascript:(function(){var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://identi.ca//index.php?action=bookmarklet',l=d.location,e=encodeURIComponent,g=f+'&status_textarea=%E2%80%9C'+((e(s))?e(s):e(document.title))+'%E2%80%9D%20%E2%80%94%20'+e(l.href);function%20a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=450,height=200')){l.href=g;}}a();})()
javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){location.
@tallykatt
tallykatt / github.pr.toggle.file.extension.js
Created July 25, 2016 02:06 — forked from fabien-d/github.pr.toggle.file.extension.js
Filter GitHub pull request changed files by extension
/**
* Prompt and filter a PR's changed files by the given extension(s).
*/
var els=document.getElementsByClassName('user-select-contain');
var input = prompt('File extension(s), comma separated');
els = [].forEach.call(els, function(el) {
var parent = el;
while (parent && !parent.classList.contains('js-details-container')) {
javascript:function tinycc_bookmarklet(){var script=document.createElement('script');script.src='http://tiny.cc/public/javascript/bookmarklet.js';scriptObj=document.body.appendChild(script);}tinycc_bookmarklet();
javascript:void(window.open('http://3.ly/?bm=1&u='+encodeURIComponent(location.href)))
javascript:(function(){var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://identi.ca//index.php?action=bookmarklet',l=d.location,e=encodeURIComponent,g=f+'&status_textarea=%E2%80%9C'+((e(s))?e(s):e(document.title))+'%E2%80%9D%20%E2%80%94%20'+e(l.href);function%20a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=450,height=200')){l.href=g;}}a();})()
javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){location.
@tallykatt
tallykatt / builder.html
Created July 25, 2016 02:05 — forked from PaulKinlan/builder.html
Bookmark Builder
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bookmarklet</title>
<script>
window.onload = function(e) {
var bookmark = document.getElementById("bookmark");
var code = document.getElementById("code");
@tallykatt
tallykatt / Bookmarklets.MD
Created July 25, 2016 02:05 — forked from TheFrostlixen/Bookmarklets.MD
Bookmarklets - JavaScript apps for your web browser

Bookmarklets

A bookmarklet is a javascript app that you save in your web browser as a bookmark. You simply click it and it will perform a task on that webpage.

My Bookmarklets

  • CleanReddit.js Removes the header and side panel from Reddit pages. Makes it look a little more clean (and less like you're not working at your desk).
  • QRthis.js Use Google's API to generate a QR code for the website you're on.
@tallykatt
tallykatt / evernote.highlight.js
Created July 25, 2016 02:04
Evernote Note Highlighter.
// This little thing make the selected text highlight on Evernote Note screen
// I really like the new Evernote Note screen, So I thought it would be very nice if selection tool has highlight button.
// So I did create this bookmarklet to add/remove highlight selected text
javascript:(function(selectElem){var jQ = tinymce.dom.DomQuery,node = jQ(tinyMCE.activeEditor.selection.getNode());if (node.is("span") && node.hasClass("highlighted")){ jQ(selectElem.getNode()).contents().unwrap() }else{selectElem.setContent("<span class=\"highlighted\" style=\"padding: 3px 0px; border:none; background: #c9f2d0;\">" + selectElem.getContent()+ "</span>");}})(tinyMCE.activeEditor.selection);
@tallykatt
tallykatt / PDF uploader bookmarklet.js
Created July 25, 2016 02:04 — forked from nmz787/PDF uploader bookmarklet.js
This bookmarklet downloads the PDF currently being viewed in a browser window then uploads it with a filename of your choice to a different web server. The included Flask-based web server takes the uploaded file and saves it to disk, then returns the resulting URL so the user can copy it with CTRL-C.
function copyToClipboard (text) {
window.prompt ("Copy to clipboard: Ctrl+C, Enter", text);
}
var xhr = new XMLHttpRequest();
xhr.onload = function(e) {
if (this.status == 200) {
var xhr2 = new XMLHttpRequest();
xhr2.onreadystatechange = function() {
switch (xhr2.readyState) {
case 0: // uninitialized