Skip to content

Instantly share code, notes, and snippets.

View HoundstoothSTL's full-sized avatar

Rob Bennet HoundstoothSTL

View GitHub Profile
@HoundstoothSTL
HoundstoothSTL / rsync.bash
Created September 25, 2013 22:15
Rsync syntax
rsync -zvr /from/here /to/here
@HoundstoothSTL
HoundstoothSTL / Tumblr.js
Created September 23, 2013 17:50
Load Tumblr Posts from Tumblr.js module
var Tumblr = {
posts: {
// this will get filled by the ajax response upon success
},
config: {
dataType: 'jsonp',
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
limit: '1',
endpoint: 'http://api.tumblr.com/v2/blog/pixelpressgame.tumblr.com/posts/text',
@HoundstoothSTL
HoundstoothSTL / sql_import.bash
Created September 13, 2013 16:42
Add sql data from file
mysql -u USERNAME -p -h localhost YOUR-DATA-BASE-NAME-HERE < YOUR-.SQL.FILE-NAME-HERE
@HoundstoothSTL
HoundstoothSTL / php_object_literal.php
Created June 1, 2013 02:48
PHP Object Literal Pattern
<?php
/**********
***** PHP Object Literal Pattern
***********/
$object = (object) [
'config' => (object) [
'username' => 'Rob Bennet',
'email' => 'rob@madebyhoundstooth.com'
],
@HoundstoothSTL
HoundstoothSTL / Embed.js
Last active October 12, 2020 03:29
On-demand vimeo embedded videos with oEmbed API, no jQuery, just javascript. Videos are not loaded on page load for performance reasons, use placeholder images, then on click, fire off the javascript.
var Embed = {
config : {
elementId : 'embed',
trigger: document.querySelectorAll('[data-js="embedTrigger"]'),
videoId : 7100569,
autoplay : true,
vidWidth: 640,
vidHeight: 400
},

DocPad: Minify your assets with Grunt

The following will minify your assets with grunt each time a generation write completes.

Installation

  1. Install Dependencies
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@HoundstoothSTL
HoundstoothSTL / anchor-scroll-with-offset.js
Created May 3, 2013 15:43
Anchor scroll with fixed header offset
(function($) {
$('a[href*=#]:not([href=#])').click(function()
{
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname)
{
var target = $(this.hash),
headerHeight = $(".primary-header").height() + 5; // Get fixed header height
@HoundstoothSTL
HoundstoothSTL / starter.html
Last active December 11, 2015 21:59
Basic HTML starter
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">