Skip to content

Instantly share code, notes, and snippets.

@tpkemme
tpkemme / xdebug-setup.sh
Created December 11, 2017 19:39
Setup Xdebug on Mac with PHPStorm
# 1. Access box via ssh
vagrant ssh
# 2. Update packages and make sure debug is install
sudo apt-get update
sudo apt-get install php-xdebug
# 3. Open Xdebug Config File
@eristic
eristic / functions.php
Last active April 3, 2024 19:42
Gulp file for using Gulp with Underscores theme. Place in root theme directory, saved as gulpfile.js
/*
This is taken directly from here and modified to fit our needs: https://developer.wordpress.org/themes/basics/including-css-javascript/
*/
function add_that_css_and_js() {
wp_enqueue_style( 'enqueue-that-css', get_template_directory_uri() . '/css/main.css', array(), '1.0', 'all');
wp_enqueue_script( 'enqueue-that-js', get_template_directory_uri() . '/js/min/main.min.js', array ( 'jquery' ), 1.0, true);
@keithws
keithws / mkto.form.listener.html
Last active November 22, 2023 18:59
Marketo Form Listener for Google Tag Manager (GTM)
<script>
/**
* push events to Google Tag Manager when the Marketo Forms 2 Javascript is
* loaded and executed and when Marketo form events occur
* uses the Marketo Forms 2.0 API
* http://developers.marketo.com/documentation/websites/forms-2-0/
*
* @author Keith W. Shaw <keith.w.shaw@gmail.com>
* @license MIT
*/
@cfxd
cfxd / gist:9ddbba4607ceec5a2a2e
Last active February 2, 2021 10:02
Install The CSS3 Font Converter (http://www.useragentman.com/blog/the-css3-font-converter/) on OS X Yosemite for on demand @font-face conversion on the command line. Also see http://cfxdesign.com/css3-font-converter-is-a-command-line-font-face-converter
1. $ brew install fontforge ttf2eot ttfautohint
2. $ brew tap bramstein/webfonttools && brew install sfnt2woff
3. Download/clone https://github.com/google/woff2 into any handy dir
cd into dir and:
$ git submodule init
$ git submodule update
$ make clean all
then:
@majodev
majodev / capture.js
Created July 22, 2014 17:21
Capture screenshots (png) from multiple sites with phantomjs
// How to: save as capture.js and run with "phantomjs capture.js"
// Setup by modifying URLS, PAGE_WIDTH AND PAGE_HEIGHT constants!
// Hint: set PAGE_WIDTH or PAGE_HEIGHT to 0 to capture full page!
// modified version of script at http://www.cameronjtinker.com/post/2011/09/26/Take-Screenshot-of-all-HTML-documents-in-a-folder-using-PhantomJS.aspx
var PAGE_WIDTH = 960;
var PAGE_HEIGHT = 640;
var URLS = [
"http://github.com",
@gavinhungry
gavinhungry / nginx-tls.conf
Last active March 11, 2024 14:51
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
"Afghanistan",
"Albania",
"Algeria",
"Andorra",
"Angola",
"Antigua and Barbuda",
"Argentina",
"Armenia",
"Australia",
"Austria",
@mikemurray
mikemurray / Gruntfile.js
Created July 26, 2013 22:02
Gruntfile for PHP and LESS with livereloading
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
php: {
dev: {
options: {
hostname: '127.0.0.1',