Skip to content

Instantly share code, notes, and snippets.


Josh Dick joshdick

View GitHub Profile
chockenberry /
Last active Jun 25, 2020
A shell script for Tot
basename=`basename $0`
if [ -z "$*" ]; then
echo "usage: ${basename} <dot> [ -o | -r | <file> | - ]"
echo ""
echo "options:"
echo " -o open dot in window with keyboard focus"
echo " -r read contents of dot"
cinakyn / Vim.scpt
Created Oct 29, 2019
Open files with iTerm vim
View Vim.scpt
-- forked version of
on run {input, parameters}
set paths to ""
repeat with i from 1 to length of input
set cur to item i of input
set paths to paths & " " & quote & POSIX path of cur & quote
end repeat
set cmd to "vim -p" & paths
tell application "iTerm"
lorenzoferrante / Shortify.js
Created Dec 2, 2018
Get track or playlist URL from user query
View Shortify.js
// Base64 encoding of your credentials
let clientID = '<your client id>'
let clientSecret = '<your client secret>'
let cred = clientID + ':' + clientSecret
let credEncoded = Data.fromString(cred).toBase64String()
let auth = 'Basic ' + credEncoded
// Get token
let tokenURL = ''
var reqToken = new Request(tokenURL)
ChristoferK / Open URLs in Safari.applescript
Created Jun 17, 2018
[Open URLs in Safari] An AppleScript that receives a list of URLs as input and opens them in new tabs of a specified existing window or, optionally, a new window, and can be set to do this in the background or by raising Safari to the foreground #Safari #tabs #URLs #AppleScript
View Open URLs in Safari.applescript
property S : a reference to application "Safari"
global W
on run input -- input is a list of URLs
if (count input) is 0 then ¬
set the input to
"", ¬
"stackoverflow", ¬
charlietran / TerminalVim.scpt
Last active Aug 6, 2020
Open file in iTerm vim for MacOS Sierra
View TerminalVim.scpt
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
joepie91 / .md
Last active Aug 4, 2020
Running a Node.js application using nvm as a systemd service
View .md

Read this first!

Hi there! Since this post was originally written, nvm has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!

The original article

Trickier than it seems.

marcoarment / FCPrivateBatteryStatus.m
Created Jan 29, 2016
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
View FCPrivateBatteryStatus.m
#import <Foundation/Foundation.h>
#include <dlfcn.h>
NSDictionary *FCPrivateBatteryStatus()
static mach_port_t *s_kIOMasterPortDefault;
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options);
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT);
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name);
dperelman /
Last active Jan 27, 2020
Download all items in a podcast.
#!/usr/bin/env python
from __future__ import print_function
import datetime
import feedparser
import time
import os
import sys
from six.moves import urllib
lukf / generate_personal_podcast.rb
Last active Jun 25, 2020 — forked from sjschultze/generate_personal_podcast.rb
automatically hosting a podcast in your Dropbox public folder
View generate_personal_podcast.rb
#!/usr/bin/env ruby -wKU
# by Kelan Champagne
# with edits by sjschultze
# and advanced metadata handling by lukf
# A script to generate a personal podcast feed, hosted on Dropbox
# Inspired by
marcoarment / ATPLogoView.m
Created Apr 29, 2014
Source for the Accidental Tech Podcast (ATP) T-Shirt
View ATPLogoView.m
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// By Marco Arment, April 28, 2014. MIT license.
@implementation ATPLogoView
- (void)drawRect:(CGRect)rectIgnored
NSString *fontName = @"MyriadPro-Semibold";
You can’t perform that action at this time.