Skip to content

Instantly share code, notes, and snippets.

@stvhwrd
stvhwrd / icon-restore.md
Last active August 29, 2015 14:19
Restore original icons for system folders by deleting custom icon folders (such as those created by MEGA sync) on Mac OS X

####Remove custom icon from folder your_folder:

cd your_folder; rm Icon$'\r'

After executing this command, the operating system should immediately restore the default folder icon.

####Example usage:

# This script prevents Spotify's Auto-updating on OS X (tested on OS X 10.10.3 with Spotify 1.0.3.101.gbfa97dfe)
# Based on this tutorial:
# http://supraliminal.net/blog/2013/4/21/how-to-revert-back-to-the-older-better-spotify-client
#
# This script must be run as root:
# sudo sh doNotUpdateSpotify.sh
#
FILE="/tmp/out.$$"
if [ "$(id -u)" != "0" ]; then
@stvhwrd
stvhwrd / uvicMAC.sh
Last active August 29, 2015 14:20
Set up the UVic iMacs to suit my workflow. [Update: This Gist inspired a new project - Red-Carpet: https://www.github.com/stvhwrd/red-carpet]
#!/bin/bash
# #download dmg
# curl -LOC - http://foo.bar/file.ext
# #mount
# hdiutil mount ~/Chromium_OSX_42.0.2311.152.dmg
# #copy the app
#!/bin/bash
### Disable animation of hotkey window on iTerm2:
defaults write com.googlecode.iterm2 HotkeyTermAnimationDuration -float 0.00001
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
# Stevie Howard <stvhwrd@outlook.com>
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
# Stevie Howard <stvhwrd@outlook.com>
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
@stvhwrd
stvhwrd / sublime-text-CLI-launcher.md
Last active September 13, 2015 16:27
Create a shortcut so we can launch Sublime Text from the command-line, eg. "subl list.txt"

####Create a shortcut so we can launch Sublime Text from the terminal:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Now you can open a file with subl myfile.py

or start a new project in the current directory with subl .

@ CSC230 -- Elevator simulation program
@ Template Author: Dr. Micaela Serra
@ Modified by: Stevie Howard
@===== STAGE 0
@ Sets initial outputs and screen
@ Enters IDLE state and updates simulated time every second
@ Polls for left black button to exit simulation
@stvhwrd
stvhwrd / Makefile
Last active May 23, 2016 20:15
This is a sweet boilerplate makefile for cmake
# This is a sweet boilerplate makefile for cmake
CC= gcc
CFLAGS= -Wall -O -g -ansi
SRCS= main.c queue.c
OBJS= main.o queue.o
PROGRAM= queuetest
MKDEP= gccmakedep
${PROGRAM}: ${OBJS}