Skip to content

Instantly share code, notes, and snippets.

@replete
replete / _block-grid-5.scss
Created September 19, 2013 08:32
Zurb Foundation 5's missing block-grid (for 4.3)
//
// Block Grid Variables
//
$include-html-grid-classes: $include-html-classes !default;
// We use this to control the maximum number of block grid elements per row
$block-grid-elements: 12 !default;
$block-grid-default-spacing: emCalc(20) !default;
// Enables media queries for block-grid classes. Set to false if writing semantic HTML.
@replete
replete / zurb-foundation-4-orbit-thumbnails.html
Created October 14, 2013 17:04
Add thumbnails to Orbit Bullets in Zurb Foundation 4.
<!DOCTYPE html>
<html class="no-js" lang="en"><head>
<head>
<title>Zurb Foundation 4 Orbit Thumbnails</title>
</head>
<body>
<style type="text/css">
.orbit-bullets.has-thumbs {
padding-left: 0;
bottom: 0;
@replete
replete / _lt-ie9-foundation-grid.scss
Last active May 26, 2017 07:34
Foundation Zurb Grid 4/5 in IE7 & IE8.
@charset "UTF-8";
/*---------------------------------------------------------------
IE78 - Zurb Foundation 4 Grid
ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ
https://gist.github.com/replete/7082477
(an enhanced fork of https://gist.github.com/zurbchris/5068210 )
1) Make sure $row-width-px = your max large breakpoint row width (e.g. 960px)
@replete
replete / _lt-ie8-foundation-box-sizing.scss
Created October 21, 2013 11:42
Zurb Foundation Grid 4/5 IE7 support.
@charset "UTF-8";
/*---------------------------------------------------------------
IE6-7 Box-sizing polyfill, for Zurb ruleset
ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ
https://gist.github.com/replete/7082518
1) Requires box-sizing.htc from https://github.com/Schepp/box-sizing-polyfill
˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭*/
@replete
replete / FindDynamicUnCSSClasses.js
Created May 11, 2015 18:48
Add this code to your site. Open your console. Click everything interactive. Copy CSS classes into UnCSS ignore list.
(function(){
'use strict';
// Feature Detection
var MutationObserver = (function () {
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
for(var i=0; i < prefixes.length; i++) {
if(prefixes[i] + 'MutationObserver' in window) {
return window[prefixes[i] + 'MutationObserver'];
}
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
@replete
replete / stringToTemplate.ES6.js
Created November 22, 2015 16:43
Allows strings to be parsed as if they were ES6 `template string interpolations`.
// phil@replete.nu
// Method for rendering normal strings as if they were ES6 `template strings like ${this}`
String.prototype.toTemplate = function() { return this.replace(/(\$\{.*?\})/g, m => eval('`'+m+'`')) };
@replete
replete / osx_ramdisk.sh
Created December 2, 2015 16:57 — forked from jnschulze/osx_ramdisk.sh
Move Chrome, Safari and iTunes Cache to Ramdisk.
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
@replete
replete / task-runner.es6.js
Created December 28, 2016 17:25
Basic task runner - replace gulp with CLI
/**
Beginnings of ES6 node Task runner to replace gulp.
This example uses PostCSS and Pug to process CSS and HTML templates.
*/
// Global dependencies
const fs = require('fs-extra');
const bs = require('browser-sync').create();
const glob = require('glob');
@replete
replete / hashSafePropertyName.js
Created January 5, 2017 09:41
'Hash' safe property name. Take an object and represent it as a 'safe' javascript property string, for purposes of memoization.
/**
* @param {Object|string} input - The string or object to flatten into a hash key string
* @returns {string} - a string representing the object as a unique string.
* @example hashSafePropertyName({a:200,b:500,c:[300,200,'eggs']}); // 'a$200_b$500_c$__300_200_eggs__'
*/
function hashSafePropertyName(input) {
var isString = _.isString(input);
var isObject = _.isObject(input) && !_.isEmpty(input) && _.isArray(input);
if (!isString && !isObject) {