Skip to content

Instantly share code, notes, and snippets.

@matthewsimo
matthewsimo / svgo.json
Created August 30, 2016 10:45 — forked from bendc/svgo.json
Sketch's SVGO Compressor settings
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": false,
"indent": 2,
"plugins": [
{
"name": "cleanupAttrs"
},
{
"name": "cleanupEnableBackground"
git log --author="YOUR_NAME_HERE" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
@matthewsimo
matthewsimo / gist:37044f03bd48645de7ef02d33e2327f4
Created August 8, 2016 21:43 — forked from IanLunn/gist:4666512
Reverse a two-point cubic bezier
/* sample cubic beziers */
linear = [0.250, 0.250, 0.750, 0.750];
ease = [0.250, 0.100, 0.250, 1.000];
easeIn = [0.420, 0.000, 1.000, 1.000];
easeOut = [0.000, 0.000, 0.580, 1.000];
easeInOut = [0.420, 0.000, 0.580, 1.000];
function reverseCubicBezier(cubicBezier) {
return [
1 - cubicBezier[2],
@matthewsimo
matthewsimo / .vim
Created July 5, 2016 16:35
negative lookahead vim search
/<?\(p\)\@!
{
"title": "Quotes App",
"quotes": [{
"body": "It was the best of times, it was the worst of times",
"author": "Charles Dickens",
"date": "1859",
"source": "A Tale of Two Cities"
}, { .. }]
}
@matthewsimo
matthewsimo / .tree
Last active December 27, 2015 13:59
Tree bash command
# Accepts a path, defaults to .
function tree {
local dir=${1:-.};
find $dir -print | sed -e 's;[^/]*/;|--;g;s;--|; |;g';
}
#
# Just add this into a file in your path, .bashrc for example.
#
@matthewsimo
matthewsimo / twitter-card-generator.php
Created September 11, 2013 21:26
Beginnings of a class for building out meta tags for twitter cards. https://dev.twitter.com/docs/cards
<?php
/*
Plugin Name: Twitter Card Generator
Description: This plugin provides a class to generate the meta tag properties for a player twitter card.
Version: 0.1
Author: Matthew Simo
*/
if(!class_exists('Twitter_Card')){
class Twitter_Card{
@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
@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 / 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)