Skip to content

Instantly share code, notes, and snippets.

View marksharrison's full-sized avatar

Mark Harrison marksharrison

View GitHub Profile

Description

A Dashing widget for displaying tasks assigned to you in Asana.

Dependencies

@marksharrison
marksharrison / OSX-Mac-App-Store-Auto-Updates-Enable.txt
Created October 29, 2015 11:52
Enable Mac App Store Auto Updates
# Enable Mac App Store Auto Updates
# Quit System Preferences app
osascript -e "tell application \"System Preferences\" to quit"
# Disable softwareupdate as workaround for defaults cache breaking
sudo softwareupdate --schedule off
# Automatically check for updates
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticCheckEnabled -bool True
# Download newly available updates in background
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticDownload -bool True
# Install OS X updates
@marksharrison
marksharrison / OSX-10.11-Clean-Install.md
Last active July 16, 2020 18:20
OS X 10.11 El Capitan Clean Install

OS X El Capitan 10.11 Clean Install

Download OS X El Capitan 10.11.1

OSX

Create OS X El Capitan 10.11 Bootable Installer USB Flash Drive

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/ElCapInstaller --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
@marksharrison
marksharrison / impbcopy.m
Created November 18, 2015 10:51 — forked from kenkeiter/impbcopy.m
Take a selfie, archive it, and copy it to the clipboard -- all from the terminal! (bash + os x)
/////////////////////////////////////////////////////////
// Copied from http://www.alecjacobson.com/weblog/?p=3816
/////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
@marksharrison
marksharrison / Shorty.gs
Last active September 26, 2018 17:30
Google Sheets apps script for Goo.gl URL Shortener & Simple Analytics
//Goog.gl Shortener API - https://developers.google.com/url-shortener/v1/
//Requires URL Shortener API to be enable in Resources > Advanced Google Services of Script Editor
//Requires cFlatten reference "MqxKdBrlw18FDd-X5zQLd7yz3TLx7pV4j" in Resources > Lirbraries... of Script Editor - http://goo.gl/U4v9q2
function onOpen() {
SpreadsheetApp.getUi()
.createMenu("Goo.gl")
.addItem("Shorten Selected URL(s)","setURLShorts")
.addItem("Fetch Selected URL(s) Analytics","getURLAnalytics")
.addToUi()
@marksharrison
marksharrison / homebrew.bash_profile
Created August 17, 2016 11:27
Homebrew .bash_profile functions
# fixBrewPerms:
# -------------------------------------------------------------------
fixBrewPerms(){
sudo chown -R $(whoami) /usr/local/bin /usr/local/Cellar /usr/local/share /usr/local/share/man /usr/local/share/man/man1
}
# upgradeBrew:
# -------------------------------------------------------------------
upgradeBrew(){
fixBrewPerms
@marksharrison
marksharrison / Simple YAML Editor
Created August 18, 2016 13:57
Simple in browser YAML editor that extends "data:text/html,<html contenteditable>".
data:text/html,<style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/twilight");e.getSession().setMode("ace/mode/yaml");e.setFontSize("20");e.focus();</script>
@marksharrison
marksharrison / Simple Text Editor
Created August 18, 2016 14:14
Simple in browser text editor that extends "data:text/html,<html contenteditable>". Raw
data:text/html,<style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/terminal");e.getSession().setMode("ace/mode/text");e.setFontSize("20");e.focus();</script>
printf "\nHello World!\n"
echo $1
HELLO_WORLD_URL="https://gist.githubusercontent.com/MarkSHarrison/8b5d0f5e3dff96fe80caabf8b2df2801/raw"

# Execute remote bash script via curl 
curl -s ${HELLO_WORLD_URL} | bash
curl -s ${HELLO_WORLD_URL} | bash -s arg1 arg2

bash <(curl -s ${HELLO_WORLD_URL}) arg1
eval "$(curl -s ${HELLO_WORLD_URL})"
source &lt;(curl -s ${HELLO_WORLD_URL})