Skip to content

Instantly share code, notes, and snippets.

View CosmicPuppy's full-sized avatar

Terry Gauchat CosmicPuppy

View GitHub Profile
@CosmicPuppy
CosmicPuppy / smartpower-outlet-test.groovy
Created May 23, 2016 20:02
SmartPower Outlet configure reporting test...
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@alexklibisz
alexklibisz / Creating an Effective Firebase Backup Solution.md
Last active July 14, 2020 04:31
Creating an Effective Firebase Backup Solution

Preface and Problem

There is a project that I've spent the last two to three months working on that uses Firebase. The project includes a web app and iOS application and focuses heavily on real-time user interaction. We've really enjoyed working with Firebase and the Firebase web and iOS SDKs. It makes this real-time programming much simpler than rolling our own data-syncing solution for the server and multiple client language.

It will soon (in the next two weeks) be time to release the project, and we have no effective way in place to back up our data. Firebase offers a "private backups" feature for the "Bonfire" plan, but we obviously don't want to pay the $150 / month until we absolutely have to. Until we reach a point where we will use the Bonfire plan, we are forced to roll our own solution.

The Goal

Must-haves:

mappings {
path("/stamp") {
action: [
GET: "checkStamp",
]
}
path("/reschedule") {
action: [
GET: "reschedule",
]
@jmdaly
jmdaly / flasher_ii.groovy
Created January 4, 2015 22:57
This is a modification of the SmartThings The Flasher app to allow flashing at specified times.
/**
* The Flasher II
*
* Author: jmdaly
* Date: 2015-01-03
*/
definition(
name: "The Flasher II",
namespace: "jmdaly",
author: "John M. Daly",
@aurman
aurman / exampleOauth.php
Last active July 4, 2022 13:00
SmartThings .php example authenticating and controlling SmartThings API endpoints
<?php
//client id and client secret
$client = '';
$secret = '';
//hardcode the full url to redirect to this file
$url = "";
//STEP 1 - Get Access Code
@markjaquith
markjaquith / off-limits-when-not-home.groovy
Last active August 29, 2015 13:56
Alerts me when someone opens my office door when I'm not at home
/**
* My office is off-limits when I am gone
*
* Author: Mark Jaquith
* Date: 2014-03-01
*/
preferences {
section("Monitor this door") {
input "door", "capability.contactSensor"
@aurman
aurman / Shield_on_off_hello.ino
Last active September 20, 2016 23:37
Arduino On Off Hello
//*****************************************************************************
/// @file
/// @brief
/// Arduino SmartThings Shield LED Example
//*****************************************************************************
#include <SoftwareSerial.h> //TODO need to set due to some weird wire language linker, should we absorb this whole library into smartthings
#include <SmartThings.h>
#define PIN_THING_RX 3
@poteto
poteto / ip_lookup.py
Created May 27, 2012 13:37
Batch IP Geolocation script
#!/usr/bin/python
# ip_lookup.py by poteto
#
# Batch processes many IP addresses, and traces their geolocation.
# The script outputs a .txt file which is then renamed to .csv, and is usable in Excel
#
# Use:
# 1. Save your user email and IP addresses in a .csv file
# - Each email and IP should be in its own column in Excel (or separated by commas)
# - Enter the name of your .csv file: