Skip to content

Instantly share code, notes, and snippets.

@mvark
mvark / Bookmarker
Last active January 6, 2022 16:54
Browser Bookmarklet to record an open web page's URL & its title as a row in Google Sheets
//Following code can be used within Google App Script editor & deployed
//Original code - https://stackoverflow.com/q/15592094/325251
function doGet(request) {
var ss = SpreadsheetApp.openByUrl( "https://docs.google.com/spreadsheet/ccc?key=<YOUR-SPREADSHEET-ID>");
var sheet = ss.getSheets()[0];
//just this line was tweaked to include the web page's title
var headers = ["Timestamp", "url","title"];
@mvark
mvark / IMDbSearch.js
Created May 9, 2021 06:54
IMDb Search bookmarklet inspired by the Wikipedia Search bookmarklet code here - https://en.wikipedia.org/wiki/Bookmarklet
javascript:(function() {
function se(d) {
return d.selection ? d.selection.createRange().text : d.getSelection()
}
s = se(document);
//for (i=0; i<frames.length && (s==null || s==''); i++) s = se(frames[i].document);
if (!s || s=='') s = prompt('Enter%20search%20terms%20for%20IMDb','');
open('https://m.imdb.com/find?q=' + s).focus();
})();
@mvark
mvark / IPLookup.js
Created May 6, 2021 10:08
Bookmarklet that calls a REST API to fetch geolocation details for a given IP address
//IP LOCATION TRACKER BOOKMARKLET
//Original source: https://funbutlearn.com/2016/06/ip-location-tracker-bookmarklet-created.html
//modified API service from http://ip-api.com which doesn't support HTTPS to https://ipapi.co/ to have a secure endpoint & avoid Mixed Content blocking issue
javascript: (function() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
@mvark
mvark / IframedTweets.html
Last active January 14, 2021 17:49
Responsive Iframed Tweets Carousel
<html>
<head>
<title>
Iframed Tweets
</title>
<style>
.container {
position: relative;
overflow: hidden;
width: 100%;
@mvark
mvark / IFTTT_Webhook.html
Created May 10, 2020 10:49
IFTTT_Webhook demo
<html>
<head>
<title>Add</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src=https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js></script>
</head>
<body>
Input item details:
<input type="text" id="movie" placeholder="Movie:" size="50"><br><br>
<input type="text" id="description" placeholder="Description:" size="50"><br><br>
@mvark
mvark / ReadingViewBookmarklet.js
Created March 3, 2020 18:19
Readable version of Reading View Bookmarklet for Microsoft Edge
javascript:(function() {
a = document.getElementsByTagName('a');
for (i = 0; i < a.length; i++) {
a[i].href = 'read:' + a[i].href;
a[i].target='_blank';
a[i].style.backgroundColor = '#f0f0f0';
}
}())
@mvark
mvark / gist:10298300eabc2965e039a4a02b69faab
Created March 3, 2020 18:13
Reading View Bookmarklet for Microsoft Edge
javascript:(function(){a=document.getElementsByTagName('a');for(i=0;i<a.length;i++){a[i].href='read:'+a[i].href;a[i].target='_blank';a[i].style.backgroundColor='#f0f0f0';}}());
<!DOCTYPE html>
<html>
<head>
<title>OCR Sample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
function processImage() {
javascript:(function()%7Bdocument.getElementById("captchaTexttab1").value%3Ddocument.getElementById("captchaDivtab1").innerHTML.split(" ").join("")%7D)()
@mvark
mvark / BingSearchv5More.html
Last active June 9, 2016 09:20
Fetching results using version 5 of Bing Search API
<!DOCTYPE html>
<html>
<head>
<title>Bing Search v5 - show all results</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script>
// more info: http://mvark.blogspot.com/2016/06/how-to-use-bing-search-v5-api-with.html