Skip to content

Instantly share code, notes, and snippets.

View zfrankdesign's full-sized avatar

Zach Frank zfrankdesign

  • zfrankdesign
  • Minneapolis, MN
View GitHub Profile
@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active February 27, 2025 20:09
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@ChrisLusted
ChrisLusted / gist:9440912
Last active August 29, 2015 13:57
Foundation 5 block grids for bootstrap 3 sass
// Adapted from the awesome zurb foundation
// https://github.com/zurb/foundation/blob/v5.2.0/scss/foundation/components/_block-grid.scss
//
// Block Grid Mixins
//
// We use this to control the maximum number of block grid elements per row
$block-grid-elements: 12 !default;
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 12, 2025 01:22
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@balupton
balupton / README.md
Last active December 9, 2015 23:18
DocPad: Get Ruby, SASS and DocPad working on Heroku

DocPad: Get Ruby, SASS and DocPad working on Heroku

Getting Ruby, SASS and DocPad working on Heroku involves two steps:

  1. Ensuring all your plugins are the latest version. Open up your package.json and change all your docpad plugin dependency versions to 2.x and your docpad version to 6.x. Once done, run rm -Rf node_modules; npm install to grab the latest versions of everything.

  2. Installing Ruby and SASS on Heroku. Copy over the Gemfile, Gemfile.lock, and the .buildpacks files from https://github.com/docpad/sass-heroku-test to your own website. Then run heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git to tell heroku to use multiple buildpacks. Once done, deploy to heroku via git push heroku master and you may need to run heroku restart as sometimes the initial deploy fails.

@WhatIsHeDoing
WhatIsHeDoing / gist:3179370
Created July 25, 2012 23:38
Embedding and Using Custom Fonts with SASS
/*
* _mixins.scss
*/
$font_dir: '../fonts/';
/* _simple-font-url('Chunkfive', 'eot'); */
@function _simple-font-url($name, $extension)
{
@return url($font_dir + $name + '-webfont.' + $extension);
@brubrant
brubrant / get-sprite.scss
Created July 23, 2012 23:20 — forked from dfadler/get-sprite.sass
A SASS (SCSS) mixin for generating a sprite declaration block that will work with media queries
// http://compass-style.org/reference/compass/helpers/sprites/
@mixin get-sprite($map, $sprite, $repeat: no-repeat, $height: true, $width: true) {
//http://compass-style.org/reference/compass/helpers/sprites/#sprite-file
$sprite-image: sprite-file($map, $sprite);
// http://compass-style.org/reference/compass/helpers/sprites/#sprite-url
$sprite-map: sprite-url($map);
// http://compass-style.org/reference/compass/helpers/sprites/#sprite-position