Skip to content

Instantly share code, notes, and snippets.

View trimechee's full-sized avatar
💯

trimechee

💯
View GitHub Profile
@andykant
andykant / mass_google_translate_bookmarklet.js
Created June 17, 2010 16:33
A mass Google Translate bookmarklet
/*
1. Copy the compressed version into a bookmark address
2. Go to Google Translate: http://translate.google.com/
3. Paste your message block in the textarea (default delimiters are new lines for each message and '=' to separate the key/value
4. Click the bookmarklet
5. The result is injected back into the textarea, focused, and selected
6. Copy + paste back into your message file
Note: Strings with special characters (like HTML) may result in inaccurate results and should be done manually
*/
@rotten77
rotten77 / google-keep-bookmarklet.js
Created May 3, 2013 06:57
Google Keep Bookmarklet
javascript:void(function(){var w = 430; var h = 600; var t = (screen.height ? (screen.height - h) / 4 : 0); var l = (screen.width ? (screen.width - w) / 2 : 0); var win = window.open('https://drive.google.com/keep/','google-keep','width='+w+',height='+h+',top='+t+',left='+l+',location=no,personalbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes');})();
@panzi
panzi / gist:7551381
Created November 19, 2013 19:49
Download currently playing HTML5 audio/video bookmarklet.
Create a new bookmark and set it's URL to this:
javascript:(function(xs)%7Bfor(var%20i%3D0%3Bi%3Cxs.length%3B%2B%2Bi)%7Bif(xs%5Bi%5D.currentSrc)%7Breturn%20window.open(xs%5Bi%5D.currentSrc)%3B%7D%7D%7D)(document.querySelectorAll('audio%2Cvideo'))%3B
When media is playing using HTML5 audio/video you can click this bookmark to open a new tab/window with the media. Then to download it use the context menu action "Save As..." (right mouse button -> Save As...).
If you use Chrome/Safari/recent Opera (WebKit/Blink) you can do better(!) and immediately download the file using this bookmarklet instead:
javascript:(function(xs)%7Bfor(var%20i%3D0%3Bi%3Cxs.length%3B%2B%2Bi)%7Bif(xs%5Bi%5D.currentSrc)%7Bvar%20a%3Ddocument.createElement('a')%3Ba.target%3D'_blank'%3Ba.download%3D''%3Ba.href%3Dxs%5Bi%5D.currentSrc%3Ba.click()%3Breturn%3B%7D%7D%7D)(document.querySelectorAll('audio%2Cvideo'))%3B
@bitingsock
bitingsock / speed-between-subs.lua
Last active October 1, 2023 06:28
Increases playback speed if a subtitle has not been displayed; resumes normal speed when a new subtitle is shown
---user settings---
local WaitTime = 0.1 --how long until we try to enter "fast" mode
local lookAhead = 5 --how far ahead to look for subtitles when trying to enter "fast" mode
local fast = 6 --how fast "fast" mode is by default
local rewind = 0.2 --how far to rewind when entering normal mode; note that if this is more than or equal to WaitTime + lookAhead you will probably enter an infinite loop
---
local searchtimer
local checktimer
local waitTimer
local normal = mp.get_property("speed")
javascript:/* MailToSelf */ (function(){target = "mailto:my.name@example.com?subject=" + encodeURIComponent(document.title) + "&body=" + encodeURIComponent(location.href); location.href = target;})()

On mobile devices, I often use "mail-to-self" type apps to quickly send me a webpage for later reading; Funnelling everything into my mailbox is simply the only way I will actually look at it again. On mobile, these apps integrate with the OS-provided "Share" menus, but on the desktop I had to manually write an email. Hence this bookmarklet, to automate creation of the reminder Email.

Installation

  1. Create a new bookmark.

Reader Mode.js

Add as bookmarklet (see below):

javascript:/* Reader Mode.js /(function(){ const IFWL=['gfycat.com','disqus.com','www.youtube.com',location.host,];const ifbl=new RegExp('derstandard\.at\/AdServer\/');const startupTasks=[disableViewport,];const periodicTasks=[disableStaticFloaters,removeIframes,];function disableStaticFloaters(){for(let e of document.getElementsByTagName('')){if(window.getComputedStyle(e).position.startsWith('fixed')){e.style.setProperty('position','static','important');}}}function removeIframes(){const iframes=getAllIframesRecursively();for(const e of getAllIframesRecursively().reverse()){try{const doRemove=(!e.src)? false : IFWL.indexOf(new URL(e.src).host)==-1 ? true : e.src.match(ifbl)? true : false;if(doRemove&&e.parentElement){e.parentElement.removeChild(e);}}catch(err){reportError(err,['FAILED TO REMOVE IFRAME',e]);}}window.readerModeRemainingIframes=getAllIframesRecursively();}function disableViewport(){const vp=document.querySelector('meta[name=v

@luckyshot
luckyshot / readingmode.js
Last active April 4, 2023 05:35
Bookmarklet: Readability (remove all styling from a website, optimize for reading and scroll to article). Also available as a Chrome Extension: https://chrome.google.com/webstore/detail/readingmode-lightest/peoapnglceoafojobbkpohnojniabmkd
javascript:
/*! ReadingMode © Xavi Esteve */
(function (d) {
var el = d.getElementsByTagName("*");
var htmlDiv = d.createElement("div");
var readingModeMenu = d.createElement("div");
var readingModeAlert = d.createElement("div");
var title = d.title;
var rmSettings = {};
@infval
infval / emuparadise.download.user.js
Last active June 5, 2024 04:51
emuparadise.me download workaround (Most games + Sega Dreamcast, Books/Comics/Guides/Magazines)
// ==UserScript==
// @name EmuParadise Download Workaround
// @version 1.2.3
// @description Replaces the download button link with a working one
// @author infval (Eptun)
// @match https://www.emuparadise.me/*/*/*
// @grant none
// ==/UserScript==
// https://www.reddit.com/r/Piracy/comments/968sm6/a_script_for_easy_downloading_of_emuparadise_roms/
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
youtube-dl -o "%(playlist_index)s-%(title)s.%(ext)s" -f 22 "url_here"