Skip to content

Instantly share code, notes, and snippets.

Mike Green mikedamage

Block or report user

Report or block mikedamage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mikedamage / usb-phone-control.zsh
Created Apr 25, 2019
Control an Android phone over USB and toggle tethering
View usb-phone-control.zsh
typeset -A keys
power 26
home 3
up 19
down 20
left 21
right 22
enter 66
mikedamage /
Last active Jun 26, 2017 Matrix Server Beta Instructions
View Matrix Chat Server Instructions

I've decided to change the communication protocol used by the chat server from XMPP to I just finished setting up a Matrix instance on the chat server, and it's ready for some intrepid guinea pigs to kick the tires! There's a long winded explanation of why I'm switching us over to Matrix, but I put it below the instructions in case you don't really care.

TL;DR Matrix is easier for me to manage, more secure for you, and everybody can access the server using same app, with the same awesome features, on pretty much any device or operating system in existence.

Coming Soon: Once I set the Matrix server up properly, we'll be able to do real-time, person to person voice and video calls in addition to text chat!

How to Connect

mikedamage / collatz.js
Created May 3, 2015
Collatz Conjecture in JS
View collatz.js
#!/usr/bin/env node
'use strict'
function collatz(num) {
var result;
if (num % 2 === 0) {
result = num / 2;
} else {
mikedamage / jquery.transitions.js
Created Apr 28, 2015
jQuery CSS Transition Callbacks Plugin (ES6)
View jquery.transitions.js
* jQuery Transition Callbacks Module
* by Mike Green <>
/* jshint esnext: true, globalstrict: true, browser: true */
'use strict';
import $ from 'jquery';
mikedamage / gist.zsh
Created Apr 27, 2015
Quick and dirty time-based file removal
View gist.zsh
#!/usr/bin/env zsh
# Files older than this will be deleted
for f in $files; do
mikedamage /
Created Feb 24, 2015
Force a WiFi scan
gksudo iwlist wlan0 scan
zenity --info --title="WiFi Scan" --text="WiFi scan complete!"
mikedamage / snip.html
Created Feb 17, 2015
Inline styles vs. classes and external stylesheets
View snip.html
<!-- This is bad for business: -->
<p style="margin: 15px;">
<strong style="color: #f00;">This is important!</strong>
<span style="color #ccc;">This isn't.</span>
<!-- Instead, define a class with a semantic, descriptive name, and style it in an external stylesheet: -->
<!-- in <head>: -->
<link rel="stylesheet" href="style.css">
mikedamage /
Created Feb 6, 2015
Java class auto-compiler
# Inotify Java Watcher
# by Mike Green <>
# Automatically compiles Java classes when their files are saved.
# = Installation: Save this script into the root folder of your Java projects, then run:
# $ cd whatever-your-folder-is-called && chmod +x
mikedamage /
Created Dec 2, 2014
Changing your Ubuntu password

Changing Your Ubuntu Password

  1. Hit Ctrl-Alt-T to open a Terminal window.
  2. Type passwd and hit Enter.
  3. Type your current password and hit Enter. Nothing will show up on the screen when you type. This is for security.
  4. Type a new password and hit Enter.
  5. Retype the new password and hit Enter again.
  6. Close the Terminal window.
mikedamage /
Last active Aug 29, 2015
Pimp your prompt

Setting up ZSH and Installing Prezto

1. Install a newer version of ZSH

The version of ZSH that comes with OS X is outdated. Grab the most recent one with Homebrew:

brew update
brew install zsh
You can’t perform that action at this time.