Skip to content

Instantly share code, notes, and snippets.

View jim-lake's full-sized avatar

Jim Lake jim-lake

  • Santa Monica, CA
View GitHub Profile
@jim-lake
jim-lake / foo.sh
Created July 19, 2018 18:43
Imagemagick
convert favicon.png -define icon:auto-resize=64,48,32,16 favicon.ico
function cleanup_circular(obj,stack,clones) {
if (!stack) {
stack = [];
}
if (!clones) {
clones = [];
}
function maybe_clone(key,new_value) {
if (clones.indexOf(obj) == -1) {
@jim-lake
jim-lake / BeaconModule.m
Last active January 18, 2016 16:55
iOS Send Message
NSString *messageToSend = [options objectForKey:@"message"];
uint16_t endpoint = [[options objectForKey:@"endpoint"] integerValue];
NSString *networkId = [options objectForKey:@"networkId"];
bool __block sent = false;
[[UBUMeshBeaconManager sharedInstance]
sendMeshMessage:messageToSend
networkId:[[NSUUID alloc] initWithUUIDString:networkId]
toDevice:(uint16_t)endpoint
@jim-lake
jim-lake / gist:07a6d6476b31f92c64c8
Created September 10, 2014 01:20
python client helo parser
def _parse_tls(data):
bytes = array.array('B')
bytes.fromstring(data)
p = Parser(bytes)
content_type = p.get(1)
if content_type == 0x16:
ssl_version = (p.get(1),p.get(1))
if ssl_version[0] > 3 or ( ssl_version[0] == 3 and ssl_version[1] > 0 ):
packet_length = p.get(2)
msg_type = p.get(1)