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
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
keys=(
power 26
home 3
up 19
down 20
left 21
right 22
enter 66
)
@mikedamage
mikedamage / matrix-beta-instructions.md
Last active Jun 26, 2017
Mikedamage.info Matrix Server Beta Instructions
View matrix-beta-instructions.md

Mikedamage.info Matrix Chat Server Instructions

I've decided to change the communication protocol used by the mikedamage.info chat server from XMPP to Matrix.org. 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
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
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 <mike@fifthroomcreative.com>
*/
/* jshint esnext: true, globalstrict: true, browser: true */
'use strict';
import $ from 'jquery';
@mikedamage
mikedamage / gist.zsh
Created Apr 27, 2015
Quick and dirty time-based file removal
View gist.zsh
#!/usr/bin/env zsh
setopt NULL_GLOB EXTENDED_GLOB
# Files older than this will be deleted
KEEP_DAYS=30
files=($PWD/*(.Nmd+$KEEP_DAYS))
for f in $files; do
@mikedamage
mikedamage / rescan.sh
Created Feb 24, 2015
Force a WiFi scan
View rescan.sh
#!/bin/bash
gksudo iwlist wlan0 scan
zenity --info --title="WiFi Scan" --text="WiFi scan complete!"
@mikedamage
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>
</p>
<!-- 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
mikedamage / java-watcher.sh
Created Feb 6, 2015
Java class auto-compiler
View java-watcher.sh
#!/bin/bash
#
# Inotify Java Watcher
# by Mike Green <mike.is.green@gmail.com>
#
# 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 java-watcher.sh
#
@mikedamage
mikedamage / passwd.md
Created Dec 2, 2014
Changing your Ubuntu password
View passwd.md

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
mikedamage / instructions.md
Last active Aug 29, 2015
Pimp your prompt
View instructions.md

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.