Skip to content

Instantly share code, notes, and snippets.

View ethangardner's full-sized avatar

Ethan Gardner ethangardner

View GitHub Profile
@avinashbangar
avinashbangar / yql_flickr.php
Created November 6, 2010 06:44
Getting photos from Flickr using YQL
<!-->
Following code gets information about photos from Flickr via YQL for the given search term
Author : avinash
Email : avinash@tutkiun.com
<-->
<h2>Using YQL to Access the Flickr API</h2>
<form name='upcoming_form'>
@archangel-irk
archangel-irk / grunt-hash.js
Last active December 23, 2015 21:29
grunt hash (.md5) checksum file for uglify.
uglify: {
production: {
options: {
report: 'min'
},
files: [{
expand: true,
cwd: '<%= dir.tempJS %>/',
src: '*.js',
dest: '<%= dir.publicJS %>',
@wrboyce
wrboyce / gist:786460
Created January 19, 2011 17:12
pre-commit hook to automatically minify javascript/css
#!/usr/bin/zsh
COMPRESSOR=$(whence -p yui-compressor)
[ -z $COMPRESSOR ] && exit 0;
function _compress {
local fname=$1:t
local dest_path=$1:h
local min_fname="$dest_path/${fname:r}.min.${fname:e}"
$COMPRESSOR $1 > $min_fname
@mdesanti
mdesanti / build-and-deploy.sh
Created February 14, 2016 18:24
Build and upload code to lambda
#!/bin/bash
echo 'Zipping folders for save function'
zip -r Save.zip node_modules save.js
echo 'Zipped... uploading to AWS'
aws lambda update-function-code --region us-east-1 --function-name saveEmailSubscriptor --zip-file fileb://./Save.zip --profile your-profile
echo 'Zipping folders for list function'
zip -r List.zip node_modules list.js
echo 'Zipped... uploading to AWS'
aws lambda update-function-code --region us-east-1 --function-name listEmailSubscriptors --zip-file fileb://./List.zip --profile your-profile
@mvital
mvital / excerpt-as-instant-article-subtitle.php
Created January 11, 2017 15:42 — forked from webdados/excerpt-as-instant-article-subtitle.php
Use WordPress post excerpt as Facebook Instant Article subtitle
<?php
/* Instant Articles (https://wordpress.org/plugins/fb-instant-articles/) - Use post excerpt as subtitle */
add_filter( 'instant_articles_subtitle', 'hf_instant_articles_subtitle' );
function hf_instant_articles_subtitle( $subtitle ) {
$excerpt = get_the_excerpt();
if ( trim($excerpt)!='' ) $subtitle = trim($excerpt);
return $subtitle;
}
@ole-boss
ole-boss / Big Query Google Analytics sessions export including site speed metrics.sql
Last active June 13, 2020 14:41
This script helps you creating sessions from Google Analytics raw data on hit level in Google Big Query. The export will also include some metrics related to site speed based on Google's Latency Tracking KPIs.
SELECT
first_sessions.sid AS sessionId,
visitorId,
first_transactions.transactionId AS transactionId,
timestamp,
deviceCategory,
landingPage,
pageviews,
timeOnSite,
channel,
@designermonkey
designermonkey / A-Symphony-Workflow.markdown
Created February 17, 2011 00:51
Just mapping out a git workflow for Symphony development

A Symphony Workflow

I'm describing my workflow in these articles, before I start my next Symphony project. Mostly for myself, to iron out my recurring problems, it is based on solid git techniques, taking heed of advice learned from Symphony community members, many many tips on the web, and flicking through the pages of O'Reilly's Version Control with git.

The core aim of this article, is to get a good Symphony development and deployment environment using git as the basis for the organisation, and have it written down for reference.

This workflow can be applied to any project, in theory, that has a starting point being a private remote git repo.

Disclaimer

@milon
milon / elasticsearch_on_homestead.md
Last active November 23, 2022 15:18
Install Elasticsearch on Laravel Homestead

Install Elasticsearch on Laravel Homestead

Install Java

sudo apt-get install openjdk-7-jre-headless -y

Download & install the Public Signing Key

wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
@pmeenan
pmeenan / wpt-hints.md
Last active March 18, 2023 16:48
Testing Priority Hints with WebPageTest

Priority Hints is rolling out to Chrome in the 101 release which is currently available in the Dev/Beta channel of Chrome and available in WebPageTest when using the Chrome Canary browser selection.

To make it easier to experiment with priority hints (particularly for LCP images) without making production changes, I set up a couple of public Cloudflare Workers that can be used dynamically with WebPageTest to inject priority hints into existing pages and to preload arbitrary images when combined with WebPageTest's overrideHost script command.

Injecting Priority Hints

There is a cloudflare worker at hint.perf.workers.dev that will take a CSS selector from the x-hint HTTP header and add fetchpriority=high to any elements in the HTML that match the selector. The easiest way to experiment with this is to use Chrome's dev tools locally, identify the element that hosts the imag

@jakub-g
jakub-g / _1_"script async defer" blocks "load" event.md
Last active August 22, 2023 10:10
Beware of "script async defer" blocking HTML "load" event

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures

TL;DR