Skip to content

Instantly share code, notes, and snippets.

View mattcassinelli's full-sized avatar

Matthew Cassinelli mattcassinelli

View GitHub Profile
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active May 29, 2024 00:03
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
@gfontenot
gfontenot / oopsiefocus.scpt
Created June 28, 2011 14:16
Modified version of Shawn Blanc's OopsieFocus script
(*
OopsieFocus
A script to launch OmniFocus and activate the Quick Entry Panel
By Shawn Blanc (http://shawnblanc.net)
May 20, 2011
With code used from the Toggle Twitter script by Red Sweater Software:
http://www.red-sweater.com/blog/1646/toggle-twitter
@sillygwailo
sillygwailo / Open in Chrome from Safari.scpt
Created September 23, 2011 07:16
Open in Chrome from Safari and vice versa
-- from http://www.tuaw.com/2011/03/14/use-applescript-to-open-current-safari-url-in-google-chrome/
-- install FastScripts http://www.red-sweater.com/fastscripts/ and place this AppleScript in the Scripts applications folder for Google Chrome.
-- For me that was ~/Library/Scripts/Applications/Safari
-- You can then assign it a keyboard shortcut. I went with Cmd-Shift-C
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "Google Chrome"
@nloko
nloko / rdio_pl_export.js
Last active March 9, 2019 14:51
Export Rdio playlist as CSV
javascript:(function() {
var bookmarklet = {
init: function() {
this.parse();
},
parse: function() {
page = "";
/* you must be viewing songs ie. http://www.rdio.com/people/nloko/collection/songs/
when exporting a collection and this will only export the songs loaded in view,
@ttscoff
ttscoff / itunesicon.rb
Last active January 13, 2022 10:07
Retrieve a 512 x 512px icon for an iOS app
#!/usr/bin/ruby
# encoding: utf-8
#
# Updated 2017-10-25:
# - Defaults to large size (512)
# - If ImageMagick is installed:
# - rounds the corners (copped from @bradjasper, https://github.com/bradjasper/Download-iTunes-Icon/blob/master/itunesicon.rb)
# - replace original with rounded version, converting to png if necessary
#
# Retrieve an iOS app icon at the highest available resolution
@ttscoff
ttscoff / grab links.bookmarklet
Last active June 16, 2024 16:40
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.
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
@epramono
epramono / NewListinClearFromLCP
Created October 14, 2013 15:16
This action allows you to use separate lines for each item that you want to add to a new list in Clear. If you want to add to an existing list, provide the existing list name in the first prompt. Requires: Clear 1.2 and Launch Center Pro 2.0.
clearapp://list/create?
listName=[prompt:List Name]&
tasks=[prompt-list:List Items]
@zacs
zacs / footnotes.js
Created January 19, 2014 02:44
Code for adding Grantland-style footnotes to Jekyll.
var Utils = {
cache: {},
watchResize: function(callback) {
//throttled resize
var resizing;
callback.size = 0;
function done()
{
var curr_size = window.innerWidth;
clearTimeout(resizing);
@viticci
viticci / Launch Center Pro action menu
Created February 4, 2014 16:18
iOS bookmarklet for Launch Center Pro
javascript:window.location='launchpro://?url='+encodeURIComponent('launchpro://?url=[list:URL: ' +location.href+'|🔵 Tweetbot=tweetbot://viticci/post?text={{'+location.href+'}}|📌 Pinswift=pinswift://x-callback-url/add?url={{'+location.href+'}}|✅ To Check Out=drafts://x-callback-url/create?text={{'+location.href+'}}&action={{Stuff To Check Out}}|🔴 Reminder=fantastical2://parse?sentence={{'+location.href+'}}&reminder=1|🔒 Open In 1Password=op'+location.href+'|🔗 Clean Link=clean-links://x-callback-url/clean?url={{'+location.href+'}}]')