Skip to content

Instantly share code, notes, and snippets.

@curran
curran / .block
Last active December 10, 2023 12:48
Download SVG from Data URL
license: mit
@gruber
gruber / New Folder or Window.scpt
Last active September 21, 2023 22:37
Finder: Use Cmd-N to Create a New Folder or a New Finder Window
(*
This script is for anyone who still has the classic Mac OS era habit of using
Command-N to create a new folder in the Finder. It's intended for use with
Red Sweater Software's excellent FastScripts utility -- a replacement for the
system's build-in Scripts menu that allows for assigning keyboard shortcuts
to scripts, on a per-application basis.
FastScripts: https://red-sweater.com/fastscripts/
Install the script here: ~/Library/Scripts/Applications/Finder/
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber:
@chockenberry
chockenberry / signature.txt
Last active October 22, 2020 19:25
El Cap code signing
$ spctl --verbose=4 --assess --type execute xScope.app
xScope.app: rejected
source=obsolete resource envelope
$ codesign --verify --verbose=4 xScope.app
--prepared:/Users/craig/Downloads/xScope.app/Contents/Frameworks/Sparkle.framework/Versions/Current/.
--validated:/Users/craig/Downloads/xScope.app/Contents/Frameworks/Sparkle.framework/Versions/Current/.
--prepared:/Users/craig/Downloads/xScope.app/Contents/Frameworks/YAML.framework/Versions/Current/.
--validated:/Users/craig/Downloads/xScope.app/Contents/Frameworks/YAML.framework/Versions/Current/.
@ccstone
ccstone / References For Learning & Using Applescript.md
Last active April 14, 2025 10:57
References For Learning & Using Applescript

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

@chockenberry
chockenberry / elcap.html
Created July 7, 2015 20:23
San Francisco not available as CSS?
<!DOCTYPE html>
<head>
<title>El Capitan</title>
<style>
body {
font-size: 2em;
}
h1 {
font-family: "System Font Black", HelveticaNeue-CondensedBlack, ComicSansMS;
@gruber
gruber / Paste URL From Safari Tab.scpt
Created June 29, 2015 00:01
Paste URL From Safari Tabs
set _old_delims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {""}
tell application "System Events"
set _current_app to name of the first process whose frontmost is true
end tell
tell application "Safari"
set _urls to {}
repeat with i from 1 to 6 -- how many Safari windows to show URLs from
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active April 5, 2025 04:55
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@getify
getify / gist:2b53198906d320abe650
Created March 23, 2015 17:02
ES6 highlight reel
function foo(x) { x = (typeof x != "undefined") ? x : 10; .. }
function foo(x = 10) { .. }
function foo(x,y,z) { .. }; foo.apply(null,[1,2,3]);
function foo(x,y,z) { .. }; foo(...[1,2,3]);
function foo() { var args = [].slice.call(arguments); .. }
function foo(...args) { .. }
var o = { x: 2, y: 3 }, x = o.x, y = o.y, z = (typeof o.z != "undefined") ? o.z : 10;
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active March 19, 2025 07:02
The best FRP iOS resources.

Videos