Skip to content

Instantly share code, notes, and snippets.

@idelem
idelem / titleUrlMarkdownClip.js
Last active March 12, 2024 02:01 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
javascript:a=1;/** Copy & paste your event name and key over there. --> **/ d={event:' my_event_name ',key:' abcdefghijklmnopqrstuvwxyz '}; /** --> Please don't touch this --> **/ u='https://maker.ifttt.com/trigger/'+d.event.trim()+'/with/key/'+d.key.trim()+'?t='+(new Date()).getTime();window.open(u).close();/** Go to the very beginning **/
@mokkunp
mokkunp / bookmarklet.md
Last active June 27, 2017 02:46
Amazonのページからscrapboxの読書ページを作るブックマークレット

https://scrapbox.io/xxxxxxxxxx/の部分を自分のプロジェクトに変えて使って下さい

javascript: (function() { var title = document.getElementById("ebooksProductTitle");if(title == null){ title = document.getElementById("productTitle")};title = title.innerText;  var imageUrl = document.getElementById("ebooksImgBlkFront");if(imageUrl == null) {imageUrl = document.getElementById("imgBlkFront")};imageUrl = imageUrl.src;var author = document.getElementById("byline").innerText;location.href ="https://scrapbox.io/xxxxxxxxxx/" + encodeURIComponent(title) + "?body=" + encodeURIComponent(author + "\n[" + imageUrl + "]\n\n" + location.origin + location.pathname.match(/\/dp\/[^/]+/)[0] + "\n\n#book")})()
@kentbrew
kentbrew / pinmarklet.md
Last active April 9, 2024 18:34
How to recreate your long-lost Pinterest bookmarklet.

How to recreate your long-lost Pinterest bookmarklet.

Right-click your bookmarks bar and choose Add Page (Chrome) or New Bookmarklet (Firefox).

In Name, put this:

Pin It

In URL, put this:

@bradleybossard
bradleybossard / titleUrlMarkdownClip.js
Created December 5, 2015 21:09
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@caseywatts
caseywatts / bookmarkleting.md
Last active May 23, 2024 08:14
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.

@coordinates
coordinates / MyJavaScriptFile.js
Last active April 8, 2019 17:55
Detect OGP tags
// https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW12
var MyExtensionJavaScriptClass = function() {};
MyExtensionJavaScriptClass.prototype = {
run: function(arguments) {
// selection string
var selectionString = window.getSelection().toString();
// open graph
@Zettt
Zettt / List to Reminders.applescript
Created June 23, 2013 10:36
Script to put a list of text from your clipboard in Reminders. Inspiration drawn from Drafts' "List to Reminders" feature. More info: (not published yet)
-- get clipboard and separate lines
set clipboardText to the clipboard as text
set reminderLines to paragraphs of clipboardText
set defaultRemindersList to "Shoppinglist"
-- figure out if a non-default reminder list should be used
if item 1 of reminderLines starts with "!" then
-- set other reminder list and delete first line
set remindersList to characters 2 thru -1 of item 1 of reminderLines as text
set reminderLines to items 2 thru -1 of reminderLines
@mlgill
mlgill / New reminder from Launchbar
Last active May 18, 2021 13:19 — forked from Jayphen/New reminder from Launchbar
A script for quickly adding reminders to the Reminders app in Mountain Lion from Launchbar and Alfred. Save this as a .scpt and drop it in ~/Library/Application\ Support/LaunchBar/Actions
--Script for setting Reminders for LaunchBar and Alfred
--For Alfred, Applescript must NOT be set to run in Background otherwise date parsing does not work
--For LaunchBar, place the script in ~/Library/Scripts/LaunchBar
--by Michelle L. Gill, 10/07/2012
--Inspired by https://gist.github.com/3187630
--A related Alfred version 2 workflow can be found here: https://github.com/mlgill/alfred-workflow-create-reminder
--Changes
--02/01/2013 * Fixed an issue with setting the time when the hour is 12 and AM/PM (12-hour clock) is used
-- * Removed the ability to set seconds for the time since Reminders doesn't recognize them
@dougalcampbell
dougalcampbell / opengraphbookmarklet.js
Last active April 8, 2019 20:23
OpenGraph Bookmarklet
javascript:$=jQuery;if(0!==$("#myogdiv").length)$("#myogdiv").hide().remove();else{var%20myogdiv=$('<div%20id="myogdiv"/>');$("body").append(myogdiv);$('head%20meta[property^="og:"],head%20meta[property^="fb:"],head%20meta[name^="twitter:"]').each(function(d,b){var%20a=$(b).attr("property"),c=$(b).attr("content");void%200==a&&(a=$(b).attr("name"));$(myogdiv).append("<div><b>"+a+":</b>"+c+"</div>");"og:image"==a&&$(myogdiv).append('<br/><img%20src="'+c+'"%20style="max-width:250px"/>');"twitter:image"==a&&$(myogdiv).append('<br/><img%20src="'+c+'"%20style="max-width:250px"/>')});$(myogdiv).css("position","absolute").css("top","0").css("zIndex",9999999).css("padding","0.5em").css("border","1px%20solid%20red").css("backgroundColor","white")}void%200;