Skip to content

Instantly share code, notes, and snippets.

@brentsimmons
brentsimmons / JavaScript Indent.js
Last active May 28, 2024 17:42
This is a BBEdit text filter for indenting (and beautifying) JavaScript.
#!/usr/local/bin/node
// PBS 12/5/13
// This is a BBEdit text filter for indenting (and beautifying) JavaScript.
// It goes in ~/Library/Application Support/BBEdit/Text Filters/
//
// On my machine I assigned it a keyboard shortcut: cmd-'
//
// It requires the js-beautify Node module: https://github.com/einars/js-beautify
//
@frenchesco
frenchesco / backtick-edit-page.md
Last active October 25, 2018 09:27 — forked from JoelBesada/README.md
A backtick command to make a page editable

This is a command for Backtick. It allows you to make a web page editable. Once you run the command you can click anywhere on the page and delete elements or type something.

To use this:

  1. Download Backtick.
  2. Copy the following ID of this Gist 7556270.
  3. Paste the ID into the custom commands field in the Backtick settings. You can easily access the settings by clicking the Backtick icon on the command execution console.
@lyoshenka
lyoshenka / pinboard-rename-tag.php
Created September 15, 2013 00:57
Merge two Pinboard tags into one, or rename a tag.
#!/usr/bin/env php
<?php
if (!isset($argv[2]))
{
echo "${argv[0]} FROM TO\n";
exit(1);
}
include 'pinboard-api.php'; // https://github.com/kijin/pinboard-api
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 11, 2025 19:59
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
mkdir -p ~/.ssh
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
To: Phil Schiller <[email protected]>
Subject: Dev Center downtime
Dear Phil,
As I'm sure you're aware, the Mac and iOS Dev Centers have been down for more than a day. This means developers can't:
• Discuss issues in the forums
• Read iOS7 and Mavericks documentation
• Watch WWDC videos
@dlo
dlo / export_pinboard.py
Last active December 23, 2024 01:40
Export all Pinboard.in bookmarks with a specific tag.
#!/usr/bin/env python
"""
This script is designed to generate a simple HTML file with _all_ of your
Pinboard.in bookmarks.
You should edit the `username`, `password`, `bookmark_filename`, and `tag`
variables.
Requirements:
@n8henrie
n8henrie / UpdateiOSApps.applescript
Last active September 28, 2024 04:08
Uses UI Scripting to Update iOS Apps in iTunes
(*
Many thanks to those unknowing contributers that share their Applescript on the web. A few that helped with this script include:
- Most of the UI Scripting came from Yoshimasa Niwa here: https://gist.github.com/4223249
- Code for checking if an app is running came from here: http://codesnippets.joyent.com/posts/show/1124
#### n8henrie Sat Mar 16 14:41:41 MDT 2013
* Added several delays that seemed to be responsible for breaking this script in iTunes 11
#### n8henrie Sun Mar 17 09:57:47 MDT 2013
* Added compatibility with iTunes 10 (untested, please confirm if you can)
@chockenberry
chockenberry / gist:5469201
Created April 26, 2013 18:09
Unicode trim 2
> var buf_ucs2 = new Buffer([0x35,0xD8,0x9c,0xDC])
undefined
> buf_ucs2.toString('ucs2')
'𝒜'
> var str = buf_ucs2.toString('ucs2')
undefined
> str
'𝒜'
> var buf_utf8 = new Buffer(str, 'utf8')
undefined
@chockenberry
chockenberry / gist:5464387
Created April 26, 2013 00:45
Unicode trim
// Names: HEAVY BLACK HEART <space> EXTRATERRESTRIAL ALIEN <space> FIRE <space> PILE OF POO
// Unicode: U+2764 U+1F47D U+1F525 U+1F4A9
// UTF-8 E2 9D A4 F0 9F 91 BD F0 9F 94 A5 F0 9F 92 A9
> var str = '❤ 👽 🔥 💩'
> str
'❤ 👽 🔥 💩'
undefined
> var buf = new Buffer(str, 'utf8')
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active March 25, 2025 18:03
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.