Skip to content

Instantly share code, notes, and snippets.

View tobyjsullivan's full-sized avatar

Toby Sullivan tobyjsullivan

View GitHub Profile

New MacBook Checklist

Setup to adjust macbook to my personal preferences.

System Settings

General

  • About > Name: (change default hostname)

Keyboard

@tobyjsullivan
tobyjsullivan / print_pdf.md
Last active January 9, 2021 19:52
How to print any Adobe doc to PDF

How to print to PDF from Adobe Reader (on a mac)

Motivation

Adobe has introduced some obnoxious new PDF form technology which I am seeing more commonly in the wild. These PDF forms can only be used with the official Adobe Reader® software.

You will know you've hit one of these documents when you try to open a PDF in your web browser or Preview and you only see this text.

Please wait...
@tobyjsullivan
tobyjsullivan / beautifulFilesize.js
Created November 20, 2020 20:38
Format File Sizes in JavaScript
const UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte'];
function beautifulFilesize(filesizeBytes) {
let unitIdx = 0;
let magnitude = filesizeBytes;
while (magnitude > 1000 && unitIdx < UNITS.length - 1) {
unitIdx++;
magnitude /= 1000.0;
}
const numberFmt = new Intl.NumberFormat('en', {
@tobyjsullivan
tobyjsullivan / adblock_comment_filter.txt
Last active July 28, 2017 00:41
Block comment sections via AdBlock
[Adblock Plus 2.0]
news.ycombinator.com##table.comment-tree
@tobyjsullivan
tobyjsullivan / abbreviateNum.js
Created May 31, 2017 00:57
Abbreviate large numbers in Javascript
// Iterated from: https://stackoverflow.com/questions/10599933/convert-long-number-into-abbreviated-string-in-javascript-with-a-special-shortn
function abbreviateNumber(value) {
let newValue = value;
const suffixes = ["", "K", "M", "B","T"];
let suffixNum = 0;
while (newValue >= 1000) {
newValue /= 1000;
suffixNum++;
}
@tobyjsullivan
tobyjsullivan / personality-insights.json
Created January 6, 2017 23:15
1 year of my own tweets, run through IBM Watson's Personality Insights service
{
"word_count": 5054,
"processed_language": "en",
"personality": [
{
"trait_id": "big5_openness",
"name": "Openness",
"category": "personality",
"percentile": 0.79548652792948,
"children": [

Keybase proof

I hereby claim:

  • I am tobyjsullivan on github.
  • I am tobyjsullivan (https://keybase.io/tobyjsullivan) on keybase.
  • I have a public key whose fingerprint is 83B7 3260 0458 4279 4822 08B3 6841 6B6A C3FD 5E88

To claim this, I am signing this object:

@tobyjsullivan
tobyjsullivan / format-preserving-scrubber.sql
Created July 6, 2016 21:23
The Worst FP-scrubber ever
select
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
Taken from: https://www.google.com/js/th/xcoWlAKVx6cl2goeDVagdx3OJQvQ3hwXRwBhFWqI9A0.js
@tobyjsullivan
tobyjsullivan / vim.md
Created May 28, 2016 18:25
Uji's VIM Session at PolglotConf 2016

Polyglot Conference 2016

Agenda

10:47 Current Vim topic 10:59 Vim plugins / Basic Vim editing 11:15 Buffer 11:30 :wq!

  1. Knows everything in vimtutor