Skip to content

Instantly share code, notes, and snippets.

@timsutton
timsutton / gist:b1affb996a2aa60b7927
Last active March 1, 2024 17:53
Pulling appcast URLs from brew-cask: about 500 so far
# list all local cask files and find the 'appcast' stanza
# - assumes you have brew cask installed:
# brew install caskroom/cask/brew-cask
for cask in `ls /usr/local/Library/Taps/caskroom/homebrew-cask/Casks | awk -F"." '{print $1}'`; do
cast=$(brew cask cat ${cask} | grep appcast | awk '{print $2}')
[ -n "${cast}" ] && echo "${cask}: ${cast}" | grep http
done
a-better-finder-attributes: 'http://www.publicspace.net/app/signed_abfa5.xml'
a-better-finder-rename: 'http://www.publicspace.net/app/signed_abfr9.xml'
@fractaledmind
fractaledmind / Insert Markdown Links for current Skim page (DEVONthink URL)
Last active April 8, 2020 00:14
REQUIRED PROGRAMS: -- Skim -- TextMate (I have alternate code for TextEdit as well) -- DEVONthink This script is a modification of a script by John Sidiropoulos at http://organognosi.blogspot.com. This script offers you a dialog box with two options: (1) insert a Markdown formatted Inline Link to the current page of the pdf you are viewing in Sk…
@pavel-sakun
pavel-sakun / QLTextFiles.sh
Last active June 9, 2018 16:23
Use OSX Finder Quicklook to preview all plain text files. Handy shortcut for actions need to install QLStephen plugin for OSX Finder's QuickLook. Please find info on QLStephen at https://github.com/whomwah/qlstephen Usage: curl https://raw.github.com/gist/6192519 | sh
#!/bin/bash
curl -O http://cloud.github.com/downloads/whomwah/qlstephen/QLStephen.qlgenerator.zip
unzip QLStephen.qlgenerator.zip
echo "Please enter your password when asked (the one sudo asks you for usuqlly). It's needed to copy some files to /Library/QuickLook"
sudo mv -f QLStephen.qlgenerator /Library/QuickLook
rm QLStephen.qlgenerator.zip
qlmanage -r
echo "We're done. Have fun and do not forget to give a credit to QLStephen's author Duncan@https://github.com/whomwah"
@hiilppp
hiilppp / sort.py
Last active February 8, 2019 13:02
Python script to sort lines of text in Pythonista and send them (back) to Drafts.
# To call script from Drafts, use the follwing URL as URL Action:
# <pythonista://sort?action=run&argv=[[draft]]>
import sys
import urllib
import webbrowser
a = sys.argv[1].split("\n")
a.sort(key=str.lower)
a = "\n".join(a)
@n8henrie
n8henrie / instapaperkindle.py
Created July 24, 2013 04:11
Manually trigger Instapaper to send your unread queue to your Kindle (assuming you have your settings set up at Instapaper.com).
#!/usr/local/bin/python
import requests
import re
import keychain
########
# Configure these settings
username = 'you@email.com'
mypass = keychain.get_password('instapaper', username)
@n8henrie
n8henrie / Create messages_phonebook.py
Last active July 10, 2022 14:59
Send iMessage messages with Quicksilver -- version 2. This version uses some Python to search a plaintext "phonebook" for non-email / non-phone number third-pane input (like a name). See the full post at http://n8henrie.com/2013/06/send-imessages-with-quicksilver-v2/
import os
import re
import sys
vcf_file = sys.argv[1]
def parse_file(infile):
card = ''
for line in infile:
if line.startswith('BEGIN:VCARD') and card.endswith('END:VCARD\r\n'):
@matthiaseisen
matthiaseisen / contact.html
Last active December 17, 2015 18:59
You are probably already familiar with the possibility of hosting static website on Amazon S3. If you're not you should read this great tutorial by Chad Thompson: http://chadthompson.me/2013/05/06/static-web-hosting-with-amazon-s3/. One common problem is that while being static your website still needs a contact form. Here's a solution for this …
<!-- You are probably already familiar with the possibility of hosting static websites on Amazon S3.
If not you should read this great tutorial by Chad Thompson: http://chadthompson.me/2013/05/06/static-web-hosting-with-amazon-s3/.
One common problem is that while being static your website still needs a contact form.
Here's a solution for this problem using Newman API (http://www.newmanapi.com). -->
<html>
<body>
<!-- First we set the 'action' attribute of <form> to point to Newman API -->
<form method="post" action="http://submit.newmanapi.com/" >
<!-- Now we create our input elements as we would in any other form -->
javascript:window.location='drafts://x-callback-url/create?text=text%3D%22'+encodeURIComponent(document.title)+'%22%20url%3D%22'+encodeURIComponent(location.href)+'%22&action=opml'
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active May 10, 2024 15:41
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
#!/bin/bash
# Original post at http://n8henrie.com/2012/12/pinboard-backups-with-curl-and-launchd/
curl -k -u "[username]:[password]" "https://api.pinboard.in/v1/posts/all?format=json" -o "/Users/[username]/Dropbox/[pathToBackup]/[filename].json"