Skip to content

Instantly share code, notes, and snippets.

View tjFogarty's full-sized avatar
🇮🇪

T.J. Fogarty tjFogarty

🇮🇪
View GitHub Profile
@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
// given a date range
// and some unavailable dates
// construct multiple allocations to fit around them
// e.g., 21st - 28th with 23rd & 24th unavailable
// gives us 2 allocations: 21st - 22nd and 25th - 28th
import moment from 'moment';
function getDatesInRange(startDate, endDate) {
const dates = [];
@tjFogarty
tjFogarty / Gruntfile.js
Last active June 18, 2020 15:35
Gruntfile that I use for projects
// http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
module.exports = function(grunt) {
/**
* Saves having to declare each dependency
*/
require( "matchdep" ).filterDev( "grunt-*" ).forEach( grunt.loadNpmTasks );
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@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
<script>
import { onMount } from 'svelte'
import { records, record } from './stores'
import * as api from './api'
export let currentRecord
export let hasBeenClicked = false
record.subscribe(value => {
currentRecord = value
@tjFogarty
tjFogarty / wiredep.js
Created August 8, 2015 10:52
Gulp + Wiredep + Timber + Twig
var gulp = require('gulp');
var config = require('../config');
var wiredep = require('wiredep').stream;
gulp.task('wiredep', function () {
gulp.src(config.wiredep_file)
.pipe(wiredep({
directory: 'assets/lib',
ignorePath: '..',
fileTypes: {

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 3061 7481 280C 07B5 4542 02E2 AB51 0170 42A9 956C

To claim this, I am signing this object:

@tjFogarty
tjFogarty / class.formhandler.php
Last active February 7, 2018 11:36
Targets form fields with prefixes to their name, e.g. <input type="text" name="prefix_name"> it will collect all data will "prefix_" in the name, or any prefix you specify in the example.
<?php
/**
* FormHandler takes care of automatically collecting form data and sending the data to a specified email address
*
* @example:
* $form = new FormHandler($from = 'guess@what.com', $to = 'what@isit.com', $subject = $_POST['form-name'], $post_data_prefix = 'obf_');
*/
class FormHandler {
public $mail;
@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;
*/