Skip to content

Instantly share code, notes, and snippets.

View cbracco's full-sized avatar

Chris Bracco cbracco

View GitHub Profile
/*
* Scale CSS
* =========
*
* API
* ---
*
* Use an @import file to override the
* `--ratio` variable.
* Default is the golden ratio or phi
@Cosmicist
Cosmicist / gist:3860074
Created October 9, 2012 17:05 — forked from wrboyce/gist:786460
pre-commit hook to automatically minify javascript/css
#!/bin/bash
# Search YUI Compressor anywhere in your home dir
echo "Searching for YUI Compressor..."
YUIC=`find ~/. -type f -name yuicompressor\*.jar`
if ! [ $YUIC ]
then
echo "Unable to find YUI Compressor! Goodbye!"
exit
fi
@cballenar
cballenar / css-baseline-grid.css
Last active October 14, 2015 00:08
/* This gist was inspired by DigitPaint [ http://advent2012.digitpaint.nl/13/ ] */ This is a baseline grid created using some (perhaps all) of the new CSS background properties. it simulates a baseline grid based on ems which will allow you to size according to your site's font size. A clear disadvantage is that it is limited to be a background.…
/* ---------------------------------------------------
Production Versions ( Minified )
--------------------------------------------------- */
/* Background */
/**/ .baseline{font-size:1em;background:none;background-image:-webkit-linear-gradient(rgba(0,0,0,0.2) 1px,transparent 1px);background-image:-moz-linear-gradient(rgba(0,0,0,0.2) 1px,transparent 1px);background-image:linear-gradient(rgba(0,0,0,0.2) 1px,transparent 1px);background-size:100% 1.5em;background-origin:content-box;background-attachment:local}
/**/ .baseline *{background:none !important;outline:1px dashed rgba(100%,0%,0%,.5)}
/* Overlay + Hover switch */
/**/ body{position:relative}body:hover:before{width:100%;height:100%;display:block;content:"";position:absolute;z-index:9999;pointer-events:none;background-size:100% .75em;background-origin:content-box;background-attachment:local;background-image:-webkit-linear-gradient(rgba(0,255,255,.75) 1px,transparent 1px);background-image:-moz-linear-gradient(rgba(0,255,255,.75) 1px,transparent 1px);bac
@mscharl
mscharl / SharePopup.js
Created August 29, 2013 10:52
jQuery plugin for links to open in a popup (built for share links)
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ( $, window, document, undefined ) {
// undefined is used here as the undefined global variable in ECMAScript 3 is
// mutable (ie. it can be changed by someone else). undefined isn't really being
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined
// can no longer be modified.
// window and document are passed through as local variable rather than global
@flarik
flarik / Carousel.js
Created October 22, 2013 08:55
Test implementation of http://eightmedia.github.io/hammer.js/examples/carousel.html but then with variable unit selection px or %. Android seems to have a problem with percentages, at least in Cordova, switching to px solves this.
@joshnesbitt
joshnesbitt / watch.rb
Created November 30, 2012 15:05 — forked from JamieMason/watch.rb
Watch a folder for changes to files, then reload Chrome
#!/usr/bin/env ruby
require 'tempfile'
require 'fileutils'
# Signals
trap("SIGINT") { exit }
# Setup
TARGET_FOLDER = ARGV[0]
TARGET_URL = ARGV[1]
@xjamundx
xjamundx / svg.md
Created August 14, 2012 20:12
Everything I Know About SVG

Everything I Know About SVG

SVG is arguably going to be the main image format of the modern web. I recently wrote an article for Safari Books Online called SVG Icons for New Devices that covers some of the basics of dealing with SVG. This article covers more the pain points of using SVG in production and as it turns out there are many.

Plain Old <img> Tags

Here's how you link to your amazing vector image.

<img src="/images/logo.svg">
@iansinnott
iansinnott / gulpfile.js
Last active July 9, 2016 19:37
A gulpfile for working with Jekyll
// gulpfile.js
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
shell = require('gulp-shell'),
livereload = require('gulp-livereload'),
lr = require('tiny-lr'),
var app = app || {};
//object literal
app = {
init: function(){
this.cache();
this.bind();
},
cache: function(){
@jswebschmiede
jswebschmiede / snippet.js
Created September 6, 2012 22:31 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
* Tip: http://pivotallabs.com/users/jdean/blog/articles/1400-working-with-asynchronously-loaded-javascript
*/
(function(doc, script) {
var js,