Skip to content

Instantly share code, notes, and snippets.

View kleerkoat's full-sized avatar

kleerkoat kleerkoat

View GitHub Profile
@ttscoff
ttscoff / Marker.js
Created December 22, 2013 05:19
Bookmarklet for Markdownifying webpage selections
// Marker, a bookmarklet for Markdownifying webpage selections
// javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/8078727/raw/Marker.js?x="+(Math.random());})();
(function () {
function callback() {
(function ($) {
var raw, userSelection;
if (window.getSelection) {
// W3C Ranges
userSelection = window.getSelection ();
// Get the range:
@Madhuka
Madhuka / convert-fe.js
Created December 12, 2013 07:34
Convert sample
function Convert(number, fromUnit) {
console.log('Starting....');
var conversions = {
distance: {
meters: 1,
cm: 0.01,
feet: 0.3048,
inches: 0.0254,
yards: 0.9144
},
@wilk
wilk / Ruby Notepad Bookmarklet
Last active February 16, 2023 19:49 — forked from jakeonrails/Ruby Notepad Bookmarklet
Javascript in-browser editor with CTRL+SHIFT+Y shortcut to execute the content. Just put it in your address bar and press enter. It works only on Chrome.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");addEventListener('keydown',function(evt){if(evt.ctrlKey && evt.shiftKey && evt.keyCode==89) eval(e.getSession().getValue());});</script>
@joelcarranza
joelcarranza / pinswift-bookmarklet.js
Last active April 17, 2020 14:22
bookmarklet template for Pinswift
// bookmarklet template for Pinswift
// This can be copied into a bookmarklet maker like:
// http://chriszarate.github.io/bookmarkleter/
// Or used with Gruber's script
// http://daringfireball.net/2007/03/javascript_bookmarklet_builder
var href = location.href;
var path = 'pinswift://x-callback-url/add';
@hiilppp
hiilppp / list.py
Created December 10, 2013 01:11
Python script to manipulate text in Pythonista in the following manner and send the result (back) to Drafts: Sort lines, remove blank and duplicate lines, and prepend a hyphen to lines which don't start with one.
# To call script from Drafts, use the follwing URL as URL Action:
# <pythonista://list.py?action=run&argv=[[draft]]>
import os
import re
import sys
import urllib
import webbrowser
a = re.sub(r"(?m)^[*-] ", "", sys.argv[1])
@omz
omz / ShortcutGenerator.py
Created December 9, 2013 11:01
ShortcutGenerator
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
// Convert CamelCase to an under_scored_word
function underscore(s){
return s.replace(/(?!^)([A-Z])/g, function(m){ return '_' + m }).toLowerCase();
}
javascript:window.location.href=window.location.href.replace("https://","ioc://");
@rmanly
rmanly / SoundcloudDL.py
Created November 22, 2013 20:55 — forked from pudquick/SoundcloudDL.py
changed iDownloads:// to ghttp:// for downloading via Goodreader
import requests, random, datetime, sys, webbrowser, console
def main():
song_page = None
if (len(sys.argv) > 0):
try:
song_page = sys.argv[1]
except Exception:
song_page = None
if not song_page:
@rmanly
rmanly / YoutubeDL.py
Created November 22, 2013 20:54 — forked from pudquick/YoutubeDL.py
changed iDownloads:// to ghttp:// for downloading via Goodreader
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',