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 / 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 / .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.
#
{
"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 / .vim
Created July 5, 2016 16:35
negative lookahead vim search
/<?\(p\)\@!
@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],
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 / 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"
// Fetch the book data
var books = fetch('http://someaweomseapi.com/api')
.then(function(response){
return response.json();
})
.then(function(json){
console.log('fetch result:', json)
return json
})
@matthewsimo
matthewsimo / ExampleUsage.tsx
Last active September 9, 2023 14:01
Help Storybook properly handle the relevant Stitches variants & props
import type * as Stitches from "@stitches/react";
import { modifyVariantsForStory } from "../../../.storybook/type-utils";
import { styled } from "../../stitches.config";
const Example = styles("div", {
// ...
});
export default Example;