Skip to content

Instantly share code, notes, and snippets.

@JoelBesada
JoelBesada / README.md
Last active October 14, 2022 04:20
Backtick Example Command

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@PeterDing
PeterDing / xiami_vip_linux.py
Last active April 9, 2017 18:34
在linux上,下载 xiami.com 320Kbps mp3 -- # 移到仓库 https://github.com/PeterDing/iScript
#!/usr/bin/env python2
# vim: set fileencoding=utf8
import re, sys, os, random, time, json, logging, argparse, requests, urllib
from mutagen.id3 import ID3,TRCK,TIT2,TALB,TPE1,APIC,TDRC,COMM,TPOS,USLT
from HTMLParser import HTMLParser
parser = HTMLParser()
s = u'\x1b[1;%dm%s\x1b[0m' # terminual color template
@ttscoff
ttscoff / Bullseye.bookmarklet
Last active February 20, 2025 09:55
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using heckyesmarkdown.com.
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://cdn.rawgit.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@cyio
cyio / 新复制网页标题及地址.bookmark.js
Created July 20, 2013 19:03
打开后鼠标焦点就在Markdown里,方便喜欢Markdown的人。使用:请新建书签,并粘贴下面的代码。
javascript:void((function(){function $(id){return w.document.getElementById(id)}var w=window.open("about:blank","","width=500,height=150");w.document.title='Refer to "'+document.title+'"';w.document.write('<style>*{margin:0;padding:0;font-size:16px;}body{margin:10px;}label,input{margin-bottom:4px;}label{clear:both;font-weight:bold;height:20px;width:15%25;float:left;line-height:20px;text-align:right;display:block;font-family:arial,sans-serif}input{font-family:monospace;border:dashed 1px black;width:80%25;float:right;height:20px;}</style><label for="markdown">Markdown</label><input id="markdown"></input><label for="html">HTML</label><input id="html"><label for="ubb">ubb</label><input id="ubb"></input></input><label for="text">Text</label><input id="text"></input><label for="title">Title</label><input id="title"></input>');$('html').value='<a href="'+encodeURI(location.href)+'" target="_blank">'+document.title+'</a>';$('title').value=document.title;$('markdown').value="%5B"+document.title+"%5D"+"%28"+encodeURI(l
@ttscoff
ttscoff / grab links.bookmarklet
Last active February 20, 2025 09:55
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@syoichi
syoichi / taberareloo_code_reading.md
Last active December 18, 2015 14:19
Taberarelooのコードを読み、処理の流れを追う

私はTaberarelooのコードの全てを読んだ事はないので正確さに欠けますが書いてみます(ファイル名などはこのディレクトリより)。

polygon_planetさんのTomblooに関する意見と同じような意見ですが、まず、特定のサービスに関するExtractor(extractors.js)やModel(models.js)から読んでみるというのはどうでしょうか。これらの分野はUser Scriptなどと異なりTaberarelooの基本的な処理を構成する一部分なので何かと想像しやすいかもしれません(もちろんTaberarelooの処理の中心となるbackground.jsやcontent.jsから見ていくのも良いと思います)。 例として、私が関わった事があるものを挙げると、ExtractorについてはYouTube、ModelについてはGistが小さくてわかりやすいかもしれません。この単位であれば、パッチで実現できる規模でもある為、YungSangさんのパッチを読むというのも良いかもしれません。

正直言ってTumblrのExtractorとModelはもともと大きかったものが私のせいで複雑なものとなってしまっているので読むのはお勧めできません…。

読む際はChromeのデベロッパーツールでブレークポ

BoldAsFont=no
Term=xterm-256color
FontHeight=10
Locale=zh_TW
Charset=UTF-8
RightClickAction=paste
CursorType=block
ForegroundColour=215,215,215
BackgroundColour=48,48,48
CursorColour=135,175,215
@NickDimmock
NickDimmock / QR code bookmarklet (modified)
Last active December 15, 2015 12:49
A modified version of https://github.com/gdovicak/QR-Code-Bookmarklet that uses encodeURIComponent() instead of escape(), so that + symbols are correctly encoded (otherwise they're encoded as spaces). Minified version is on line 1, followed by the full code.
var QR=function(){var _this=this;var width=400;var height=400;_this.div=null;baseQRUrl='https://chart.googleapis.com/chart?chs='+width+'x'+height+'&cht=qr&chl=';_this.appendDiv=function(){_this.div=document.createElement('div');_this.div.setAttribute('id','qr-container');_this.div.setAttribute('style','position: absolute; top: 0; left: 0; margin:20px; border-radius: 15px; background-color: #444444;padding:10px; z-index: 1000');_this.div.appendChild(getImage());_this.div.onclick=_this.close;document.getElementsByTagName('body')[0].appendChild(_this.div)};function getImage(){var img=document.createElement('img'),imgSrc=_this.GetQRSrc(_this.GetCurrentPageEncoded());img.setAttribute('src',imgSrc);return img}_this.GetCurrentPageEncoded=function(){return encodeURIComponent(document.URL)};_this.GetQRSrc=function(url){return baseQRUrl+url};_this.close=function(){_this.div.parentNode.removeChild(_this.div)}};var qr=new QR();qr.appendDiv();
var QR = function () {
var _this = this;
var width = 400;
var heig
@notpushkin
notpushkin / .minttyrc
Created March 9, 2013 10:28
Monokai for mintty
BoldAsFont=yes
Term=xterm-256color
BoldAsColour=yes
Black=39,40,34
Red=249,38,114
Green=166,226,46
Yellow=230,219,116
Blue=102,217,239
Magenta=174,129,255
@SlexAxton
SlexAxton / .zshrc
Last active June 6, 2025 19:18
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else