Skip to content

Instantly share code, notes, and snippets.

View tjFogarty's full-sized avatar
🇮🇪

T.J. Fogarty tjFogarty

🇮🇪
View GitHub Profile
@tjFogarty
tjFogarty / main.js
Created October 17, 2014 11:40
Browserify main entry point example
$(document).ready(function () {
require('./modules/foundation');
require('./modules/foundation-media-queries');
require('./modules/slider');
});
@tjFogarty
tjFogarty / gulpfile.js
Created October 17, 2014 11:14
Example Gulp file
var gulp = require('gulp');
var spawn = require('child_process').spawn;
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var runSequence = require('run-sequence');
var penthouse = require('penthouse');
var cleanCSS = require('clean-css');
var fs = require('fs');
// load plugins
/* jshint node:true */
'use strict';
var gulp = require('gulp');
var traceur = require('gulp-traceur');
gulp.task('scripts', function () {
return gulp.src('js/main.js')
.pipe(traceur())
@tjFogarty
tjFogarty / penthouse-gulp.js
Created September 19, 2014 11:54
Penthouse - gulp
var penthouse = require('penthouse');
var fs = require('fs');
var cleanCSS = require('clean-css');
gulp.task('penthouse', ['styles'], function () {
penthouse({
url: ['http://chadwicks.dev'],
css: 'assets/css/application.css',
width: 480,
height: 800
@tjFogarty
tjFogarty / foundation-mq.js
Last active August 29, 2015 14:05
Check Foundation Media Queries
/* globals $, jQuery, Foundation */
/* jshint node:true */
'use strict';
window.MQ = (function(MQ, $, queries) {
/**
* $cache elements
* @type {Object}
// inject bower components
gulp.task('wiredep', function () {
gulp.src('./partials/*.php')
.pipe(wiredep({
directory: './bower_components/'
}))
.pipe(gulp.dest('./partials'));
});
### Keybase proof
I hereby claim:
* I am tjFogarty on github.
* I am fogarty (https://keybase.io/fogarty) on keybase.
* I have a public key whose fingerprint is F16E EE8B 30A4 6EA4 8B9B 3293 9C3D FA76 F916 7210
To claim this, I am signing this object:
@tjFogarty
tjFogarty / class.vimeothumbnail.php
Last active January 26, 2018 03:12
Get Vimeo thumbnail from video URL
<?php
/**
* Vimeo class to fetch thumbnails
* @example
* $video = new VimeoThumbnail(array(
* 'video_url' => $url
* ));
* echo $video->thumbnail;
*/
@tjFogarty
tjFogarty / image-performance.js
Last active August 29, 2015 14:02
This doesn't include checks to see if this is supported on certain browsers.
/**
* Detects using window.performance
* We can serve small images first, then upgrade on faster connections
* See: http://mattandrews.info/talks/port80-2013/#/
*/
(function () {
var perf = window.performance,
start = perf.timing.requestStart, // just before page is requested
end = perf.timing.responseStart, // first byte received