Skip to content

Instantly share code, notes, and snippets.

@stinoga
stinoga / Rabbits.js
Created December 6, 2013 05:07
Applying arguments to objects. Works especially well if those objects are rabbits.
// define the function to see what the rabbits say
function speak (line) {
console.log("The ", this.adjective, " rabbit says ", line);
}
// define some rabbit objects
var whiteRabbit = {adjective: "white", speak: speak};
var fatRabbit = {adjective: "fat", speak: speak};
// apply an array of arguments to our fatter of the two rabbit objects
@stinoga
stinoga / .htaccess
Last active December 20, 2015 10:49
Busting cache with Grunt and Apache.
# To understand why this is important and a better idea than `*.css?v231`, read:
# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
</IfModule>
@stinoga
stinoga / decode.js
Created July 30, 2013 20:39
Decode cookie, and parse into JSON object w/ JQuery
$.parseJSON(decodeURIComponent($.getCookie('COOKIE_NAME')));
@stinoga
stinoga / lazy.js
Created June 26, 2013 19:49
Lazy Loading Images based on adjacent section headers. Dependencies: JQuery, Lo-Dash
// Defer Image loading until parent headers come into view
// =======================================================
// Setup vars
var win = $(window),
lazyScrollDelta = 200,
headerIndex = 0,
sectionCount = all_products.length - 1;
// Bind scroll event
@stinoga
stinoga / index.html
Last active December 16, 2015 10:48
Responsive Google Maps
<section class="map cf">
<header>
<h3>Super Responsive Map</h3>
</header>
<div class="map" id="map"></div>
<ul class="mapinfo"></ul>
</section>

Contract

Revised date: [date]

Between Rob Stinogle and [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@stinoga
stinoga / nav.js
Created December 14, 2012 02:24
Off canvas nav in SASS
// Off canvas navigation
$(document).ready(function() {
$('body').addClass('js');
var $menulink = $('.menu-link');
$menulink.click(function() {
event.preventDefault();
@stinoga
stinoga / post-commit
Created August 13, 2012 12:25
Use Dropbox as a git repo
#!/bin/sh
# This hook is used to push a mirrored version of all committed files to your dropbox repo after they are commited (optional)
# Replace this variable with your remote repo name
REPO=dropbox
echo
echo "==== Sending changes to $REPO repo ===="
echo
@stinoga
stinoga / .htaccess
Created August 8, 2012 01:38 — forked from jswartwood/Run in LOCAL terminal...
Automatic Git deploys on Dreamhost
# deny access to the top-level git repository:
RewriteEngine On
RewriteRule \.git - [F,L]
@stinoga
stinoga / functions.php
Created August 1, 2012 02:32
Responsive images in Wordpress posts
// Remove image width/height, so everything can work responsively in posts
function strip_size($html, $id) {
$html = preg_replace('/\<(.*?)(width="(.*?)")(.*?)(height="(.*?)")(.*?)\>/i', '<$1$4$7>',$html);
return $html;
}
add_filter('get_image_tag', 'strip_size', 10, 2);
function remove_thumbnail_dimensions( $html ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );