Skip to content

Instantly share code, notes, and snippets.

@rob-gordon
rob-gordon / lamp-install.sh
Last active April 4, 2017 16:13 — forked from fideloper/install.sh
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@rob-gordon
rob-gordon / template-first-child.php
Created November 3, 2016 15:10
Wordpress Template Redirect
<?php
/* In a filenamed template-first-child.php */
/*
Template Name: Go to first child
*/
?>
pi@raspberrypi ~ $ Connection to 192.168.1.103 closed by remote host.
Connection to 192.168.1.103 closed.
Robs-MacBook-Air:js robgordon$ ssh -X [email protected]
[email protected]'s password:
Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
pi@raspberrypi / $ jackd -v -d alsa
jackdmp 1.9.9
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2012 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
Cannot lock down 82278944 byte memory area (Cannot allocate memory)
Jack: JackPosixThread::StartImp : create non RT thread
@rob-gordon
rob-gordon / gulpfile.js
Created October 12, 2016 12:37
Simple Sass / Browser-sync Gulpfile
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
// Static Server + watching scss/html files
// gulp.task('serve', ['sass'], function() {
// browserSync.init({
// server: "./app"
// });
### Keybase proof
I hereby claim:
* I am rob-gordon on github.
* I am robgordon (https://keybase.io/robgordon) on keybase.
* I have a public key whose fingerprint is 46AF 02BA E05E 0951 CECF D10D DD98 1C9D 421B 8F26
To claim this, I am signing this object:
function climb_and_return($elem, $test_fn, $default) {
$test = false;
while(!$test && $elem !== 0) {
$test = call_user_func($test_fn, $elem);
if ($test == false) {
if (is_page()) {
$elem = $elem->post_parent == 0 ? 0 : get_post($elem->post_parent);
@rob-gordon
rob-gordon / findTrackDeviceByName
Created March 7, 2015 18:15
max4live-js-api: Find Track Device By Name
function findTrackDeviceByName(name) {
var track = new LiveAPI('this_device canonical_parent'),
devices = track.get('devices'),
deviceID;
for (var i = devices.length - 1; i >= 0; i = i - 2) {
if ((new LiveAPI('id '+devices[i])).get('name') == name) {
deviceID = devices[i];
break;
}