Skip to content

Instantly share code, notes, and snippets.

View avisser's full-sized avatar

Andy Visser avisser

View GitHub Profile
@JKCooper2
JKCooper2 / utility.cls
Last active September 19, 2017 00:33
APEX sObject sObjectHasProperty, sObjectHasPath, getSObjectPath (including default)
/*
Provides utility functions for checking/accessing sObject properties
Updates:
- Namespace no longer required
- Replaced getPopulatedFieldsAsMap() with a plain try catch to improve speed
- Allowed for returns of SObjects
- Throw out SObjectException where the field exists but wasn't queried
To Do:
@theapi
theapi / knock.py
Last active November 27, 2018 01:11
Simple demo to detect knocking from a piezo sensor on the Raspberry Pi.
#!/usr/bin/python
import time, signal, sys
from Adafruit_ADS1x15 import ADS1x15
def signal_handler(signal, frame):
print 'You pressed Ctrl+C!'
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'