Skip to content

Instantly share code, notes, and snippets.

View tomoakley's full-sized avatar

Tom Oakley tomoakley

View GitHub Profile
@tomoakley
tomoakley / deploy.sh
Created March 21, 2023 14:50
CodePush version picker
#! /bin/bash
set -e
while getopts ":i:a:c:p:h" opt; do
case $opt in
i) IOS="$OPTARG"
;;
a) ANDROID="$OPTARG"
;;
@tomoakley
tomoakley / PHP Variable Scope with Wordpress shortcode attributes
Last active November 19, 2018 01:26
PHP Variable Scope with Wordpress shortcode attributes
<?php
// I have a function, embedVine(), which is a Wordpress shortcode. It uses one attribute, $id which I've assigned to $vine_id to avoid confusion ($post_id etc). This shortcode takes the ID (Vine IDs are the ending of the Vine URL, e.g http://vine.co/v/hx9LlrZxdqV, the id = hx9LlrZxdqV) and embed's the Vine within a Wordpress post. The shortcode markup is [vine id='...'].
function embedVine($atts) {
extract(shortcode_atts(array(
"id" => ''
), $atts));