Skip to content

Instantly share code, notes, and snippets.

View dvdsmpsn's full-sized avatar

David Simpson dvdsmpsn

View GitHub Profile
@dvdsmpsn
dvdsmpsn / .profile
Created May 17, 2012 10:09
David's .profile for Atlassian development
PATH=$PATH:.
PATH=$PATH:$HOME
PATH=$PATH:$HOME/bin
PATH=$PATH:$HOME/bin/atlassian-cli-2.5.0
PATH=$PATH:$HOME/.rvm/bin
## XAMPP
PATH=$PATH:/Applications/XAMPP/xamppfiles/bin
## Atlassian SDK
// from this:
// HTML output
$this->load->view('common_assets/simple_page', $data, true);
// to this:
// PDF output:
$html = $this->load->view('common_assets/simple_page', $data, true);
$this->load->library('pdf');
$pdf = $this->pdf->load();
@dvdsmpsn
dvdsmpsn / gist:3815232
Created October 1, 2012 23:45
Jive Apps - get App properties
// require: https://raw.github.com/derek-watson/jsUri/master/Uri.js
osapi.http.get({'href' : 'http://market.apps.jivesoftware.com/',
nocache: 'true',
'authz': 'signed'}).execute(
function(r) {
var uri = new Uri(r.headers.location);
var oo_id = unescape(uri.getQueryParamValue('opensocial_owner_id'));
var jiveUserId = oo_id.split('@')[0];
@dvdsmpsn
dvdsmpsn / daysUntilChristmas.php
Created October 3, 2012 10:37
PHP Days until Christmas
<?php
function daysUntilChristmas()
{
$month = 12;
$day = 25;
$year = date("Y");
$yearNext = $year+1;
$days = (int)((mktime (0,0,0,$month,$day,$year) - time())/86400);
if ($days < 0)
@dvdsmpsn
dvdsmpsn / sibling-tabs.usermacro.vm
Last active December 11, 2017 06:45
Sibling Tabs User Macro
#### Update 2013-10-22:
#### Olha Vdovych asked me via email how to limit the number of tabs
#### and how to get the order of the tabs to be consistent with the
#### natural ordering within Confluence.
#### I’ve updated the user macro below for both requests:
## Macro title: Sibling Tabs
## Macro has a body: N
## Body processing: Selected body processing option
@dvdsmpsn
dvdsmpsn / zen-fooundation-reset.css
Created October 19, 2012 12:29
Zen Foundation reset CSS for default Confluence functionality
/************* Zen Foundation reset CSS for default Confluence functionality *************/
/* .aui-tabs.horizontal-tabs */
#com-atlassian-confluence .aui-tabs.horizontal-tabs ul.tabs-menu {
margin: 0;
padding: 0;
}
#com-atlassian-confluence .aui-tabs.horizontal-tabs > ul.tabs-menu > li {
@dvdsmpsn
dvdsmpsn / gist:4014341
Created November 4, 2012 23:23
Using Raspberry Pi as a cheap Airplay audio receiver

I'm using the Raspberry Pi as an airplay receiver to bring my 1970s hifi system a little more up to date.

Here are the steps I took and some references at the end.

Download the installer & insert an SD card

Davids-MacBook-Pro:tmp david$ curl -O http://svn.stmlabs.com/svn/raspbmc/testing/installers/python/install.py
Davids-MacBook-Pro:tmp david$ chmod +x install.py
Davids-MacBook-Pro:tmp david$ sudo ./install.py
@dvdsmpsn
dvdsmpsn / gist:4111898
Created November 19, 2012 17:02
How do I get the "educations" item from the LinkedIn REST API?
@dvdsmpsn
dvdsmpsn / gist:4125147
Created November 21, 2012 14:39
kernel.log problems
Nov 14 05:09:28 localhost kernel[0]: SMC::smcInitHelper ERROR: MMIO regMap == NULL - fall back to old SMC mode
Nov 14 05:09:30 localhost kernel[0]: SMC::smcReadKeyAction ERROR: smcReadData8 failed for key MOTP (kSMCKeyNotFound)
Nov 14 11:30:14 Davids-MacBook-Pro kernel[0]: [SendHCIRequestFormatted] ### ERROR: [0x0C3F] (Set AFH Host Channel Classification) -- Send request failed (err = 0xE00002ED (kIOReturnNotResponding))
Nov 14 12:08:33 Davids-MacBook-Pro kernel[0]: [SendHCIRequestFormatted] ### ERROR: [0x0C3F] (Set AFH Host Channel Classification) -- Send request failed (err = 0xE00002ED (kIOReturnNotResponding))
Nov 14 14:26:59 localhost kernel[0]: SMC::smcInitHelper ERROR: MMIO regMap == NULL - fall back to old SMC mode
Nov 14 14:27:01 localhost kernel[0]: SMC::smcReadKeyAction ERROR: smcReadData8 failed for key MOTP (kSMCKeyNotFound)
Nov 14 14:32:26 localhost kernel[0]: SMC::smcInitHelper ERROR: MMIO regMap == NULL - fall back to old SMC mode
Nov 14 14:32:28 localhost kernel[0]: SM
PATH=$PATH:.
PATH=$PATH:$HOME
PATH=$PATH:$HOME/bin
PATH=$PATH:$HOME/bin/atlassian-cli-2.5.0
PATH=$PATH:$HOME/.rvm/bin
## XAMPP
PATH=$PATH:/Applications/XAMPP/xamppfiles/bin
## Atlassian SDK