Skip to content

Instantly share code, notes, and snippets.

View jeffkibuule's full-sized avatar

Joefrey Kibuule jeffkibuule

View GitHub Profile
@jeffkibuule
jeffkibuule / setup.sh
Last active January 23, 2022 00:54 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@jeffkibuule
jeffkibuule / Console
Created July 11, 2014 20:15
ContextHub Console
// Log some info
// Go to the logs tab and scroll to the bottom to see logs
console.log("This event happened")
@jeffkibuule
jeffkibuule / Push
Created July 11, 2014 20:13
ContextHub Push
// Send push to a device that created an event
push.sendToDeviceID(event.data.device_id, "You just generated an event")
// Send push to an alias "iPad" which one or more devices have reigstered
push.sendToAlias("iPad", "Your iPad just generated an event")
// Send push to a tag "device" which several devices have registered
push.sendToTags("device", "Here's a message!")
// Send a background push with custom data to a device that created an event but no sound
@jeffkibuule
jeffkibuule / Vault
Created July 11, 2014 20:07
ContextHub Vault
// Store custom data sent in a payload in the vault with a tag temp
vault.create(JSON.stringify({temperature: event.payload.temperature}), "temp")
// Update a pre-existing item with a tag temp
var tempVault = vault.find("temp")
vault.update(tempVault.vault_info.id, JSON.stringify({temperature: event.payload.temperature}))
// Delete a vault item
var tempVault = vault.find("temp")
vault.destroy(tempVault.vault_info.id)