Skip to content

Instantly share code, notes, and snippets.

@llakewood
llakewood / WPML Nav Hack
Created February 9, 2021 18:00
We had a network wide nav in Blog 1 that would not translate to French. WPML Translation Management must be installed for this to work.
<?php
/* Problem: We had a network wide nav in Blog 1 that would not translate to French.
WPML Translation Management must be installed for this to work. */
//Determine which menu to serve (sql or codex)
function serve_wpml_menu($term_taxonomy_id, $post_parent, $callback) {
if($callback) {
if(ICL_LANGUAGE_CODE === 'en') {
$callback();
{
"DBID": "286513575",
"RF_ELEMENT_TYPE": "ADDRESS",
"LABEL": "2;;;;ASPERMONT;;CRES;;;;BRAMPTON",
"LONGITUDE": -79.669274830478,
"LATITUDE": 43.7971760108252,
"PHUB": "PB01",
"NODE": "161389",
"SHUB": "160147"
}
@llakewood
llakewood / git-post-receive-hook.md
Last active January 8, 2019 16:48
Deploy Remotely via Git Post Receive Hook

Deploy via Git Once you’ve added your app “appname” under “appuser”, we can create a git repository on the server which will deploy the app once pushed to.

Log in as appuser. Create the git repo:

mkdir -p ~/repo/appname.git
cd ~/repo/appname.git
git init --bare

Next, create a post-receive script

@llakewood
llakewood / gist:fe53906bef636730f90da128de202253
Created November 20, 2017 16:47
Git Deploy Remotely - Script and instructions.
#Log in as appuser. Create the git repo:
mkdir -p ~/repo/appname.git
cd ~/repo/appname.git
git init --bare
#Next, create a post-receive script
vi hooks/post-receive
@llakewood
llakewood / map.js
Created June 14, 2017 19:28
Google Maps JavaScript (Beer Finder)
/*jslint browser: true */
/*global $, jQuery, alert, console, gcMap:true */
var console = console || { log: function() { 'use strict'; } }; // jshint ignore:line
var APIKEY = 'AIzaSyCjOhYTFNQIGg2mIITJITOPc1WI6OSXTdM';
window.gcMap = window.gcMap || {};
(function($) {
@llakewood
llakewood / concierge.js
Created June 14, 2017 19:27
A wiring class for JavaScript projects
/*jslint browser: true */
/*global $, jQuery, alert, console, gcConcierge:true */
/***
* Welcome to the Concierge.
* This is where we will kick off the JavaScript for this app.
* Here we will check our browser and server variables, set-up the pages,
* and listen for changes along the way.
*
* Related classes:
@llakewood
llakewood / utilities.js
Created June 14, 2017 19:26
Handful of useful JavaScript utilities
/*jslint browser: true */
/*global $, jQuery, alert, console, gcUtz:true */
var console = console || { log: function() { 'use strict'; } }; // jshint ignore:line
window.gcUtz = window.gcUtz || {};
(function($) {
// all Javascript code goes here
@llakewood
llakewood / htmlClasses.js
Last active June 14, 2017 19:34
htmlClasses - Uses Bowser and DOM info to apply useful classes to the <html> element
var bp = 1000
//htmlClasses - Uses Bowser and DOM info to apply useful classes to the html tag
(function () {
var browserWidth = (whatWidth() > bp + 1 ? { "desktop" : true, "handheld" : false } : { "desktop" : false, "handheld" : true } );
var browserOrientation = (whatOrientation() > 0 ? { "landscape" : true, "portrait" : false } : { "portrait" : true, "landscape" : false } );
var protocol = (window.location.protocol === "https:" ? { "https" : true, "http" : false } : { "https" : false, "http" : true } );
var browserInfo = {},
htmlClasses = {},
@llakewood
llakewood / Makefile
Created October 21, 2016 14:46 — forked from pwenzel/Makefile
Wordpress Makefile Workflow
.PHONY: install
install: clean wordpress phpunit wp-cli
git submodule init;
@echo "\n\nNOTICE: You may need to configure a MySQL database for your Wordpress installation. Just run:"
@echo " mysql -u root -p;"
@echo " CREATE DATABASE example_site; \n"
wordpress: latest.tar.gz
tar -zxvf latest.tar.gz;
@llakewood
llakewood / Scratch API 2.0.markdown
Last active May 23, 2016 20:42
Scratch API 2.0