Skip to content

Instantly share code, notes, and snippets.

Nick Brook nrbrook

View GitHub Profile
@nrbrook
nrbrook / create_native_gecko.py
Last active Apr 10, 2018
A python script to extract the events from SI Labs native_gecko.h into an event loop handler that calls weak functions, allowing you to define event handler functions with parameters instead of a big switch statement with an event data struct.
View create_native_gecko.py
#!/usr/bin/env python
import re
native_gecko_file = open("/Applications/Simplicity Studio.app/Contents/Eclipse/developer/sdks/gecko_sdk_suite/v2.2/protocol/bluetooth/ble_stack/inc/soc/native_gecko.h", "r")
contents = native_gecko_file.read()
native_gecko_file.close()
pattern = re.compile(r'gecko_evt_(.*?)_id\s')
View addKey
# in ~/Library/LaunchAgents/com.user.addkeyonlogin.plist (replace <path to home>)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.addkeyonlogin</string>
<key>Program</key>
<string><path to home>/.ssh/addkeyonlogin</string>
You can’t perform that action at this time.