Skip to content

Instantly share code, notes, and snippets.

View matthewsimo's full-sized avatar
👨‍💻
Building

Matthew Simo matthewsimo

👨‍💻
Building
View GitHub Profile
@matthewsimo
matthewsimo / gzk
Last active December 17, 2015 11:59
quick little shell script to non-destructively gzip a file in place
#!/bin/bash
FILE=$1
$(gzip < $FILE > $FILE.gz)
@matthewsimo
matthewsimo / neonmob-collection-sort.js
Created May 17, 2013 15:33
Sort NeonMob collections from Extremely Rare to Common.
var common = [], uncommon = [], rare = [], veryRare = [], extremelyRare = [], itemGrid, items;
itemGrid = $("div.collection ul.item-grid");
items = itemGrid.children();
items.each(function(i,e){
var rarity;
if($(this).find("span.title").children("a").attr("class")) {
rarity = $(this).find("span.title").children("a").attr("class");
@matthewsimo
matthewsimo / compliments.coffee
Last active December 15, 2015 16:59
Levo script for patting people on the back.
# Allow Hubot to brighten someone\'s day.
#
# Commands:
# comp <name/me> - Give person a compliment!
# compliment <name/me> - Give person a compliment!
# Compliment data taken from http://emergencycompliment.com/ - thanks!
compliments = [
"Your prom date still thinks about you all the time.",
"All your friends worry they aren\u2019t as funny as you.",
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@matthewsimo
matthewsimo / findGroups.js
Last active December 13, 2015 17:18
Function to return array groups with each group consisting of a certain min size of elements of a matching selector
findGroups = function(selector, size) {
var groups = []; var group = [];
$(selector).each(function(i, v){
group.push(v);
if(group.length === size) {
groups.push(group);
group = [];
}
});
if(group.length !== 0)
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@matthewsimo
matthewsimo / footer.php
Last active December 11, 2015 12:18
Gallery Child Theme ready for Pjax Integration. Demo for upthemes blog post.
@matthewsimo
matthewsimo / SQL-Query-WP-Plugin-boilerplate.php
Created December 28, 2012 23:12
Boilerplate code for a plugin with the purpose of a SQL query.
<?php
/*
Plugin Name: Fix Such and Such Problem
Description: This plugin fixes such and such because such and such is broken
Version: 0.1
Author: Awesome Plugin Meister
*/
if(!class_exists('Such_Such_Fixer')){
class Such_Such_Fixer{
@matthewsimo
matthewsimo / insults.coffee
Created November 29, 2012 19:18
Insults script for hubot
# Allow Hubot to give a burn Shakespeare would approve of.
#
# Commands:
# insult <name> - Don't have a good comeback, ask for some backup.(name parameter optional)
data = [["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty","cullionly","fusty","caluminous","wimpled","burly-boned","misbegotten","odiferous","poisonous","fishified"],["tardy-gaited","rampallian","beef-witted","dizzy-eyed","fool-born","scurvy-valiant","brazen-faced","muddy-mettled","beetle-headed","boil-brained","clapper-clawed","folly-fallen","base-court","full-gorged","flap-mouthed","mot
@matthewsimo
matthewsimo / some.sh
Created October 11, 2012 18:54 — forked from tj/some.sh
change terminal tab name on cd
function tabname {
printf "\e]1;$1\a"
}
if [ x`type -t cd` == "xfunction" ]; then
# previously wrapped cd
eval $(type cd | grep -v 'cd is a function' | sed 's/^cd/original_cd/' | sed 's/^}/;}/' )
else
# builtin
eval "original_cd() { builtin cd \$*; }"