Skip to content

Instantly share code, notes, and snippets.

View mattbanks's full-sized avatar

Matt Banks mattbanks

View GitHub Profile
@mattbanks
mattbanks / package.json
Last active March 12, 2018 17:59
base package.json for jest and eslint
{
"name": "project-name",
"description": "project description",
"author": "Matt Banks <[email protected]>",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "project-url-here"
},
"scripts": {
@mattbanks
mattbanks / .editorconfig
Created March 12, 2018 17:48
base editorconfig
# EditorConfig coding styles definitions. For more information about the
# properties used in this file, please see the EditorConfig documentation:
# http://editorconfig.org/
# indicate this is the root of the project
root = true
[*]
charset = utf-8
end_of_line = lf
module.exports = {
// collectCoverage: true,
// collectCoverageFrom: [
// 'app/**/*.js'
// ],
testResultsProcessor: 'jest-junit',
};
@mattbanks
mattbanks / .eslintrc
Created March 12, 2018 17:47
base eslintrc
{
"extends": [
"airbnb-base",
"prettier"
],
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"classes": true
}
@mattbanks
mattbanks / .hyper.js
Created May 10, 2017 13:34
Hyper config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
/* ==========================================================================
Grid
========================================================================== */
$pad: 20px;
.grid {
margin: 0 0 $pad 0;
@include clearfix();
}
@mattbanks
mattbanks / Contract Killer 3.md
Created March 7, 2016 01:50
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@mattbanks
mattbanks / 0_reuse_code.js
Created September 29, 2015 19:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mattbanks
mattbanks / gist:55c990b1d5b517ccf043
Created June 3, 2015 15:10
TextExpander 5 snippet for a new WP_Query wrapped in a transient
// Get any existing copy of our transient data
if ( false === ( $%filltext:name=Query Name:default=myquery% = get_transient( '%filltext:name=Query Name:default=myquery%' ) ) ) {
// It wasn't there, so regenerate the data and save the transient
$%filltext:name=Query Name:default=myquery%_args = array(
'post_type' => '%filltext:name=Post Type:default=post%',
'order' => '%fillpopup:name=Order:default=ASC:DESC%',
'orderby' => '%fillpopup:name=Orderby:default=date:ID:rand:title:author:menu_order%',
'post_status' => 'publish',
'posts_per_page' => %filltext:name=Posts Per Page:default=-1%
@mattbanks
mattbanks / index.php
Created August 5, 2014 16:43
Awful loop usage in WordPress theme index.php
<?php global $wp_query;
query_posts(
array_merge(
$wp_query->query,
array(
'orderby' => 'post_date',
'order' => 'desc'
)
)
);