Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jordansaints on github.
  • I am jordan_saints (https://keybase.io/jordan_saints) on keybase.
  • I have a public key ASClkysTPfSO21Qe6myeb0iXAGXlTcIP26LwnLVsshvT9Qo

To claim this, I am signing this object:

@jordansaints
jordansaints / bash_separator.sh
Created September 15, 2018 19:28
Custom terminal prompt to inject separation lines between commands (repost)
############################################
# Modified from emilis bash prompt script
# from https://github.com/emilis/emilis-config/blob/master/.bash_ps1
#
# Modified for Mac OS X by
# @corndogcomputer
###########################################
# Fill with minuses
# (this is recalculated every time the prompt is shown in function prompt_command):
fill="—- "
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
aria: false,
actions: {
toggleAria() {
this.set('aria', !this.get('aria'));
var links = [];
var quotes = [];
var tempUrl = [];
var infos = [];
var maxLinks = 10;
var firstUrl = 'http://www.imdb.com/search/title?at=0&num_votes=5000,&sort=user_rating,desc&start=1&title_type=tv_infoss';
var newUrl;
var x = require('casper').selectXPath;
@jordansaints
jordansaints / pojo-diff.js
Last active February 22, 2017 21:27 — forked from zackthehuman/gist:5762171
JavaScript object difference using Underscore
var objectA = { a: '1a', b: '1b', c: '1c' };
var objectB = { a: '2a', b: '2b', d: '2d' };
function objectDifference(minuend, subtrahend) {
var firstIntersection = _.omit(minuend, _.keys(subtrahend)),
secondIntersection = _.omit(subtrahend, _.keys(minuend));
return _.extend(firstIntersection, secondIntersection);
}
@jordansaints
jordansaints / flush-dns-cache.scpt
Last active August 29, 2015 14:23
OS X version-aware flushing of the DNS cache
-- OS X version-aware flushing of the DNS cache
-- Intended for use in an Alfred Flush-DNS workflow
set os_version to do shell script "sw_vers -productVersion"
if os_version ≥ "10.3" and os_version < "10.5" then
do shell script "lookupd -flushcache"
else if os_version < "10.7" then
do shell script "dscacheutil -flushcache"
else if os_version < "10.9" then
do shell script "killall -HUP mDNSResponder" with administrator privileges
@jordansaints
jordansaints / DNSCrypt + okTurtles DNSChain
Last active August 29, 2015 14:23 — forked from taoeffect/gist:8855230
DNSChain + DNSCrypt! :-D
dnscrypt-proxy --local-address=127.0.0.1:53 --resolver-address=23.226.227.93:443 --provider-name=2.dnscrypt-cert.okturtles.com --provider-key=1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB
#
# Apache directives for serving a javascript application.
# Requests that don't match a file or directory are served
# the index.html file so that your javascript router may load
# and handle the requested route.
# by Jordan Saints, www.jordansaints.com
#
# Optional, easier than sudo copying your app to your DocumentRoot.
Alias /app /path/to/your/app
@jordansaints
jordansaints / firefox-duplicate-tab.scpt
Last active December 25, 2015 19:49
Duplicates Firefox's currently open tab; most convenient when assigned to a keyboard shortcut.
-- Duplicate Firefox's currently open tab
-- by Jordan Saints, www.jordansaints.com
tell application "Firefox"
activate
end tell
delay 0.2
tell application "System Events" to key code 37 using {command down} -- cmd+L focuses on address bar
tell application "System Events" to key code 36 using {option down} -- alt+Return duplicates tab in foreground
@jordansaints
jordansaints / chrome-duplicate-tab.scpt
Last active December 25, 2015 19:39
Duplicates Chrome's currently open tab in the background; most convenient when assigned to a keyboard shortcut.
-- Duplicate Chrome's currently open tab in the background
-- by Jordan Saints, www.jordansaints.com
tell application "Google Chrome"
activate
end tell
tell application "System Events" to key code 37 using {command down} -- cmd+L focuses on omnibar
tell application "System Events" to key code 36 using {command down} -- cmd+Return duplicates tab in background