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 / 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 / footer.php
Last active December 11, 2015 12:18
Gallery Child Theme ready for Pjax Integration. Demo for upthemes blog post.
/* ---------------------------------------------------------- */
/* */
/* 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 / 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)
// 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 / 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.",
@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 / 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 / goto
Last active October 9, 2019 14:45
goto & save
function goto {
local item=$1;
if [[ ${item} == '--list' || ${item} == '-l' ]]
then
boom p;
else
cd $(boom echo $item);
fi
@matthewsimo
matthewsimo / .gitconfig
Last active December 22, 2015 09:18
Here's my .gitconfig, be sure and replace with your github token.
[user]
name = Matthew Simo
email = matthew.a.simo@gmail.com
[core]
excludesfile = /Users/matthewsimo/.gitignore_global
editor = vim
ui = true
[alias]
st = status
ci = commit