Skip to content

Instantly share code, notes, and snippets.

View jcmaslan's full-sized avatar

Carter Maslan jcmaslan

View GitHub Profile
switch(this.event_type) {
case 0:
// We treat all subtypes as the same currently
return "entry.unlocked";
case 4:
switch(this.event_subtype) {
case 8:
case 210:
case 211:
return "entry.forcedopen";
@jcmaslan
jcmaslan / config_boxes.py
Created November 3, 2019 21:23
Set the event_auto_upload_query_filter for CSV file list
#!/usr/bin/env python
"""
Example:
config_boxes.py --file test_config_boxes.csv --token MYTOKEN --dryrun
Loops through each row of CSV file and posts the new config for event_auto_upload_query_filter like:
{
"device_id": "AQAG***REDACTED***MrOIwnr",
"event_auto_upload_query_filter": {
"text": "7pm to 10am"
#!/bin/sh
# concatenate all the mp4 files in the argument directory.
# Examples:
# ./ffconcat.sh /Users/Carter/Downloads/video
#
#
IN_DIR="$1";
if [ "$IN_DIR" = '' ] ; then
IN_DIR="."
fi
curl \
-H "Content-Type: application/json" \
-d '[{"timestamp":"2018-06-25T17:04:51.460+0700", "labels_to_add": ["badge123", "unlocked"]}]' \
-X PUT https://camio.com/api/users/xyzpdq/devices/site1/annotations
curl \
-H "Authorization: token abc123" \
-d '{"Front Door": ["home", "San Mateo"], "Office Entrance":["work"]}' \
-X POST \
https://camio.com/api/cameras/labels
@jcmaslan
jcmaslan / query_link_creation_request.json
Created April 10, 2017 04:30
Example of a Query Link creation json payload