Skip to content

Instantly share code, notes, and snippets.

View tjFogarty's full-sized avatar
🇮🇪

T.J. Fogarty tjFogarty

🇮🇪
View GitHub Profile
@carolineschnapp
carolineschnapp / related-products.liquid
Last active December 22, 2022 21:29
Related Products — to add to product.liquid
@anhang
anhang / localStorage.js
Created July 20, 2011 23:07
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}
@paulnicholson
paulnicholson / powssl
Last active November 24, 2021 16:40
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@smeranda
smeranda / facebook_like-box_responsive.css
Created May 1, 2012 20:37
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@lounestor
lounestor / PrimeNumbers.java
Created November 22, 2012 00:13
Getting Prime Numbers
public class PrimeNumber {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//specific prime and nonprime numbers in range
for (long i=1; i<50; ++i){
@GianlucaGuarini
GianlucaGuarini / post-merge
Last active August 22, 2023 20:54 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
@jonespen
jonespen / gist:8579542
Created January 23, 2014 14:41
equal height grid columns using susy and flexbox
@import "susy";
$total-columns : 7;
$column-width : 4em;
$gutter-width : 1em;
$grid-padding : $gutter-width;
$break : 12;
@mixin flex-span-columns($columns, $context: $total-columns, $padding: false, $from: $from-direction, $style: fix-static-misalignment()){
@include span-columns($columns, $context, $padding, $from, $style);
@laracasts
laracasts / gulpfile.js
Last active February 10, 2024 10:57
Example Laravel-specific Gulpfile from Laracasts.com
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@antonioribeiro
antonioribeiro / gist:8838286
Last active August 29, 2015 13:56
Shared Hosting & PHP
| PHP | 5.4 | 5.5 | Mention date | PHP version information link
+----------------------+-----+-----+--------------+------------------------------------------------------------------------
| justHost.com | X | | 2013-09-06 | https://my.justhost.com/cgi/help/447
| NetworkSolutions | X | | 2013-03-17 | http://forums.networksolutions.com/index.php?showtopic=10601&mode=linearplus
| BlueHost | X | | Today? | https://my.bluehost.com/cgi/help/php-version
| HostGator | X | X | Today | https://support.hostgator.com/articles/hosting-guide/hardware-software/what-version-of-php-are-you-using
| 1&1 | X | X | Today | http://www.1and1.com/details-php-programming
| FatCow | X | | ? | http://www.mybestwebhostingsites.com/details/fatcow-wordpress/
| Hub | X | | 2012-04-17 | http://www.webhostinghub.com/help/news/archive-announcements/php-5-4
| G
@cferdinandi
cferdinandi / stop-video.js
Last active February 15, 2024 17:03
A simple method to stop YouTube, Vimeo, and HTML5 videos from playing.
/**
* Stop an iframe or HTML5 <video> from playing
* @param {Element} element The element that contains the video
*/
var stopVideo = function ( element ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;