Skip to content

Instantly share code, notes, and snippets.

View ezza's full-sized avatar

Erin Francis ezza

  • Chargefox
  • Melbourne AU
View GitHub Profile
@ezza
ezza / set-screenshot-location.sh
Created February 17, 2017 00:41
Save screenshots in a subfolder of documents, not the desktop
mkdir ~/Documents/Screenshots
defaults write com.apple.screencapture location ~/Documents/Screenshots/
killall SystemUIServer
@ezza
ezza / gist:bedaae613be47fe4a6835a08a647668c
Created December 22, 2016 01:31 — forked from jacobh/gist:9884192
LIFX build status light
require 'LIFX'
require 'net/http'
require 'json'
# LIFX setup
green = LIFX::Color.green saturation: 1
red = LIFX::Color.red saturation: 1
white = LIFX::Color.white
off_color = LIFX::Color.white brightness: 0
@ezza
ezza / .profile
Last active January 18, 2016 03:44
Colourify SSH terminal sessions
# Add this to ~/.profile
function tabc() {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change
# "Default" to the name of your default theme
echo -e "\033]50;SetProfile=$NAME\a"
}
function colorssh() {
@ezza
ezza / gist:9590fc468dd3ecac5141
Last active August 29, 2015 14:19
AWS IO benchmarks
EBS optimized r3.xlarge instance with 3.3TB EBS volume attached.
###### Write benchmarks #########
sudo dd bs=1M count=2048 if=/dev/zero of=foo oflag=dsync
## 16GB EBS System Partition
2147483648 bytes (2.1 GB) copied, 51.1244 s, 42.0 MB/s
## 75GB Instance Store
2147483648 bytes (2.1 GB) copied, 24.5199 s, 87.6 MB/s
@ezza
ezza / word-loop.md
Last active August 29, 2015 14:05
Codeday Friday: Wordloop

Given a single word as input try to find a repeated letter inside of it such that you can loop the text around and reuse that letter. For example:

$ ruby word_loop.rb Mississippi
 i

 p
 p

Mis

 ss

 si
@ezza
ezza / mysql-grant
Last active January 3, 2016 09:59
Grant access to the flippa DBs if your VM init script fails.
mysql -u root -e "GRANT ALL ON flippa.* TO flippa@localhost IDENTIFIED BY 'flippa';"
mysql -u root -e "GRANT ALL ON commerce.* TO flippa@localhost IDENTIFIED BY 'flippa';"
mysql -u root -e "GRANT ALL ON commerce.* TO commerce@localhost IDENTIFIED BY 'commerce';"
mysql -u root -e "CREATE DATABASE flippatest;"
mysql -u root -e "GRANT ALL ON flippatest.* TO flippa@localhost IDENTIFIED BY 'flippa';"
@ezza
ezza / git-stash-grep
Last active December 28, 2015 02:09 — forked from hartym/git-stash-grep
Add to bashrc so you can stashgrep term
# added to ~/.bashrc
stashgrep() {
for i in `git stash list --format="%gd"`; do
git stash show -p $i | grep -H --label="$i" "$1"
done
}
# usage:
# stashgrep zip
# returns
// ==UserScript==
// @name G+ Hangouts Autojoin
// @description Automatically click the join button when loading a hangout
// @include https://plus.google.com/hangouts/_/*
// @match https://plus.google.com/hangouts/_/*
// @version 0.1.0
// ==/UserScript==
(function(){
@ezza
ezza / gist:2626598
Created May 7, 2012 08:08
manually kick off csd notifications in a dev db
CsdNotification.destroy_all
CsdTransaction.destroy_all
icp = Icp.held.last
CsdNotification.create_all_for_icp!(icp, {:change_datetime => Time.now})
CsdNotification.process!
CsdTransaction.all.each do |transaction|
puts "\n\n\n"
puts transaction.transaction_type
@ezza
ezza / .bashrc
Created March 1, 2012 03:20
Add beetil# prefixes to the commit message if your branch looks like it matches a beetil
# Verbose commit all changes to tracked files
alias gcav='git commit -avem "$(beetil_commit_prefix)"'
# Verbose commit specified files
# eg gcv app/views app/models/user.rb
gcv() {
git commit -vem "$(beetil_commit_prefix)" "$@"
}
# Warning: If you close the edit message window unchanged,