Skip to content

Instantly share code, notes, and snippets.

View thisislawatts's full-sized avatar

Luke Watts thisislawatts

View GitHub Profile
@thisislawatts
thisislawatts / equal-heights.js
Created October 7, 2014 22:10
All items on the same row should have equal heights
(function() {
/*
* http://benhowdle.im/2014/01/29/easy-peasy-equal-heights/
*/
function sameHeights(selector) {
var selector = selector || '[data-equal-height]';
query = document.querySelectorAll(selector),
elements = query.length,
max = 0;
# Uploads latest screengrabs to S3 Bucket
#
# Requires: s3tools.org & S3 Bucket
function grabgo {
screengrabs_location=$(defaults read com.apple.screencapture location)
file_name=$(ls -t $screengrabs_location | head -n1)
s3cmd put --acl-public --guess-mime-type "$screengrabs_location$file_name" s3://bucketname
}
@thisislawatts
thisislawatts / gist:f035081c4ba94446cb51
Created September 23, 2014 15:04
Elongate your footage (n) times
function elongate() {
file_path=$(pwd)
file_name=$(basename "${1}")
file_ext="${file_name##*.}"
file_name="${file_name%.*}"
loop_by=10
if [ "$2" ]
then
loop_by=${2}
@thisislawatts
thisislawatts / gist:1fc2ebad1a7666052caa
Last active August 29, 2015 14:06
Email last ten items of project's git log to someone
git log --pretty=format:"%h%x09%ad%x09%s" -10 | mail -s "Repo Updates: $(date)" [email protected] -f [email protected]
@thisislawatts
thisislawatts / filter.php
Last active August 29, 2015 14:05
WordPress Faux Pages
<?php
/**
* project filters
*
* @package project
*/
function project_page_title( $title, $sep ) {
global $wp_query;
@thisislawatts
thisislawatts / Query Site
Last active August 29, 2015 14:05
WordPress Public API, Problem where querying via batch consistently returns HTTP error
https://public-api.wordpress.com/rest/v1/sites/www.mosaicrooms.org
{
"ID": 71655423,
"name": "The Mosaic Rooms",
"description": "Contemporary Culture from the Arab World",
"URL": "http://www.mosaicrooms.org",
"jetpack": true,
"subscribers_count": 0,
"is_private": false,
@thisislawatts
thisislawatts / eg.html
Created August 5, 2014 13:36
HTML Markup Example
<section>
<h1 id="main">Styleguide</h1>
<p>The purpose of this HTML is to help determine what default settings are and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr>
<h1 id="headings">Headings</h1>
<h1>h1. Heading</h1>
var gulp = require('gulp');
var sass = require('gulp-sass');
var cssmin = require('gulp-cssmin');
gulp.task('sass', function() {
gulp.src('./assets/scss/*.scss')
.pipe(sass({
includePaths: require('node-bourbon').includePaths,
logErrorToConsole: true
}))
<style type="text/css">
/*---BODY and MAIN---*/
body{
background-image: url("");
background-repeat: no-repeat;
background-position: center top;
background-attachment: scroll;
}
@thisislawatts
thisislawatts / post-type-switcher.php
Last active June 25, 2016 21:05
Post Type Switcher - Fixes multiple post_type bug
<?php
/**
* Post Type Switcher
*
* Allow switching of a post type while editing a post (in post publish section)
*
* @package PostTypeSwitcher
* @subpackage Main
*/