Skip to content

Instantly share code, notes, and snippets.

@git2358
git2358 / gist:90a313648cae8a1e71c2576def3e384a
Created September 3, 2016 03:12 — forked from ashishb/gist:da145a877139fcd91e3f
Fix for "Unapproved caller. SecurityAgent may only be invoked by Apple software"
- Start on single user mode: Hit the Command and S keys at start-up
Wait until the writing stops completely
-At the line, type (after root): /sbin/fsck -fy (space after the k)
Hit the ENTER key
wait until it finishes and says "... appears to be OK"
next, type: /sbin/mount -uw / (space after the t and after the w)
@git2358
git2358 / brettquix.txt
Created November 10, 2016 11:18 — forked from alexpos/brettquix.txt
Brett's Quix File
@Brett's searches
@Brett's custom searches
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo)
b https://duckduckgo.com/?q=%21%s Bang search (DuckDuckGo)
grep https://www.cueup.com/?q=%s&fq=1 Greplin
ss https://duckduckgo.com/site:%d%20%s Current site (DuckDuckGo)
bt https://duckduckgo.com/site:brettterpstra.com%20%s BrettTerpstra.com (DuckDuckGo)
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything)
hints http://hints.macworld.com/search.php?query=%s&keyType=all&datestart=&dateend=&topic=0&type=stories&results=50&mode=search Search Mac OS X Hints
mu http://www.macupdate.com/find/mac/%s Search MacUpdate (Software)
@git2358
git2358 / brettquix.txt
Created November 10, 2016 11:18 — forked from ttscoff/brettquix.txt
Brett's Quix File
@Brett's searches
@Brett's custom searches
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo)
b https://duckduckgo.com/?q=%21%s Bang search (DuckDuckGo)
grep https://www.cueup.com/?q=%s&fq=1 Greplin
ss https://duckduckgo.com/site:%d%20%s Current site (DuckDuckGo)
bt https://duckduckgo.com/site:brettterpstra.com%20%s BrettTerpstra.com (DuckDuckGo)
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything)
hints http://hints.macworld.com/search.php?query=%s&keyType=all&datestart=&dateend=&topic=0&type=stories&results=50&mode=search Search Mac OS X Hints
mu http://www.macupdate.com/find/mac/%s Search MacUpdate (Software)
@git2358
git2358 / Update Fork.md
Created March 1, 2017 11:42 — forked from seankross/Update Fork.md
Update a Github Fork from the Original Repo

Taken from here

Add remonte branch:

git remote add --track master mleung git://github.com/mleung/feather.git

Verify:

git remote

@git2358
git2358 / pliim-turnOff.scpt
Created November 24, 2017 01:26 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
@git2358
git2358 / sudo-keepalive-example.sh
Created March 13, 2018 12:25 — forked from cowboy/sudo-keepalive-example.sh
Bash: Sudo keep-alive (good for long-running scripts that need sudo internally but shouldn't be run with sudo)
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Example: do stuff over the next 30+ mins that requires sudo here or there.
function wait() {
@git2358
git2358 / event.js
Created April 11, 2018 23:14 — forked from netjordanlee/event.js
new Event() for old browsers
function Event(name, params) {
if(typeof name !== 'string') throw new Error('TypeError');
var _evt;
_evt = document.createEvent('Event');
_evt.initEvent(name, true, true);
if(typeof params === 'object')
for(var p in params) {
if(!_evt.hasOwnProperty(p)) {
_evt[p] = params[p];
@git2358
git2358 / loadingspinner.pde
Created June 7, 2018 01:54 — forked from marcedwards/loadingspinner.pde
A loading spinner with 6 dots
// A loading spinner with 6 dots.
// By @marcedwards from @bjango.
//
// Pretty messy and hacked together, but it works. ¯\_(ツ)_/¯
// Created using Processing 3.3.7.
float scaler = 0.24 * 4; // Scale the entire design.
float scalerb = 4; // Scale the entire design more.
int frame = 0;
@git2358
git2358 / javascript-localstorage-expiry.js
Created July 12, 2018 12:30 — forked from shaik2many/javascript-localstorage-expiry.js
set timeout for localStorage or sessionStorage
http://apassant.net/2012/01/16/timeout-for-html5-localstorage/
var hours = 24; // Reset when storage is more than 24hours
var now = new Date().getTime();
var setupTime = localStorage.getItem('setupTime');
if (setupTime == null) {
localStorage.setItem('setupTime', now)
} else {
if(now-setupTime > hours*60*60*1000) {
localStorage.clear()