Skip to content

Instantly share code, notes, and snippets.

View danielmurphy's full-sized avatar

Daniel Murphy danielmurphy

View GitHub Profile
### Keybase proof
I hereby claim:
* I am danielmurphy on github.
* I am danielmurphy (https://keybase.io/danielmurphy) on keybase.
* I have a public key whose fingerprint is B635 ECCA 6630 03FF EFD5 5264 A0F2 DC51 BB76 422B
To claim this, I am signing this object:
@danielmurphy
danielmurphy / image download.php
Last active August 29, 2015 13:56
Use OAuth to download an image attachment.
<?php
$oauth = new OAuth($consumer_key, $consumer_secret);
$oauth->setToken($access_token, $access_token_secret);
$oauth->disableRedirects();
$oauth->fetch('https://planningcenteronline.com/attachments/23128559');
$response_info = $oauth->getLastResponseInfo();
copy($response_info['redirect_url'], './file.jpg');
?>
@danielmurphy
danielmurphy / bottle_song.rb
Created December 6, 2013 16:31
A solution to the 99 Bottles Song
class BottlesSong
def sing
verses(99, 0)
end
def verses(upper_bound, lower_bound)
upper_bound.downto(lower_bound).collect {|n| verse(n) + "\n"}.join
end
def verse(number)
@danielmurphy
danielmurphy / Person API.json
Last active December 17, 2015 13:19
Example parameters for creating a person
{ "person":
{
"first_name": "PiCO",
"last_name": "Das Robot",
"contact_data": {
"addresses": [{
"city": "Carlsbad",
"state": "CA",
"street": "2790 Gateway Dr.",
"zip": "92009",
{ "person":
{ "first_name": "John",
"last_name": "Doe",
"contact_data": {
"email_addresses": [
{
"address": "chris@example.com"
}
]
}
@danielmurphy
danielmurphy / gist:1256347
Created October 1, 2011 17:16
Custom Report Example
{% for category in plan.ministry.plan_person_categories %}
{% for position in category.positions %}
{% if postion.name == "Monitor Engineer" %}
Your monitor engineer today is: {% for person in position.people %}{{ person.name }}{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}