Skip to content

Instantly share code, notes, and snippets.

Max Mitchell mazuhl

Block or report user

Report or block mazuhl

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
mazuhl /
Last active Oct 21, 2015
Command line bash functions to list odd/even lines form input file
# usage: odd numbers.txt
function odd() {
# print odd lines from file
awk 'NR%2==1 {print}' $1
function even() {
# print even lines from file
awk 'NR%2==0 {print}' $1
mazuhl /
Last active Feb 9, 2016
Get screenshots and resize/crop them
pageres 1024x768 < urls.txt ; mogrify -resize 474 -crop 474x501+0+0 *.png
# Go get screenshots from list in clipboard
# Once that's done, resize all the images
# and crop them
# And then optimise them: /Applications/ *.png
mazuhl /
Last active Aug 29, 2015
Get MODx version number from GitHub Master branch and paste into Google Spreadsheet
function myFunction() {
var response = UrlFetchApp.fetch("");
mazuhl / check-url-status.rb
Created May 12, 2014
Check URL status from input file list
View check-url-status.rb
File.foreach('URLS.txt') { |l|
system("curl -sL -w '%{http_code} %{url_effective}\\n' '#{l.chomp}' -o /dev/null")
mazuhl / gist:9366311
Last active Aug 29, 2015
Javascript - modified scoping example from p. 36 of Javascript: The Good Parts
View gist:9366311
var foo = function() {
var a = 3, b = 5;
console.log("a: " + a + ", b: " + b);
if (typeof c === "undefined") { console.log("c is undefined"); }
var bar = function() {
var b = 7, c = 11;
mazuhl / url-grabber.rb
Last active Dec 23, 2015
Scan website and save all URLs to text file
View url-grabber.rb
require 'rubygems'
require 'spidr'
links = []
wesite = ""
puts "Scanning #{website} for links"
puts ""
f ="urls.txt","w");
mazuhl / bookmarklet
Last active Dec 23, 2015
Bookmarklet to give you a simple browser-based text editor
View bookmarklet
mazuhl / gist:3946402
Created Oct 24, 2012
Diff all files in a folder
View gist:3946402
diff -rq folder1 folder2
# show summary of differences
diff -r folder1 folder2
# show full differences
mazuhl / gist:3097044
Created Jul 12, 2012
Regex to find line without an @ sign
mazuhl / gist:3096899
Created Jul 12, 2012
Use ImageMagick to identify image compression level
View gist:3096899
identify -verbose filename.jpg | grep "Quality"
You can’t perform that action at this time.