Skip to content

Instantly share code, notes, and snippets.

View SandyChapman's full-sized avatar
😀

Sandy Chapman SandyChapman

😀
View GitHub Profile
@SandyChapman
SandyChapman / delete_zombie_gcal_events.py
Created February 3, 2021 13:08
Delete zombie Google Calendar Entries.
# To start, follow the Python Quickstart to get a credentials.json file:
# https://developers.google.com/calendar/quickstart/python
# Then edit the START_DATE_TIME and EVENT_SUMMARY_TO_DELETE constants and run the script.
#!/usr/bin/env python
from __future__ import print_function
import datetime
import pickle
import os.path
@SandyChapman
SandyChapman / DirectoryWatcher.swift
Last active April 24, 2018 18:58
Allows observing a directory for changes. Provides any files added or removed from the directory.
//
// DirectoryWatcher.swift
//
// Created by Sandy Chapman on 4/24/18.
//
import UIKit
@objc public class DirectoryWatcher : NSObject {
@SandyChapman
SandyChapman / delete_merged_branches.sh
Created September 2, 2016 00:50
Deletes all merged branches
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
@SandyChapman
SandyChapman / iOS Uptime
Created August 23, 2016 23:53
Tracks the uptime of the iOS device.
// Tracks the uptime of the iOS device.
- (time_t)uptime
{
struct timeval boottime;
int mib[2] = {CTL_KERN, KERN_BOOTTIME};
size_t size = sizeof(boottime);
time_t now;
time_t uptime = -1;
@SandyChapman
SandyChapman / Image Compress Pre-commit
Last active January 28, 2016 20:04
This is a Git pre-commit script that will losslessly compress newly added pngs and restage them.
#!/usr/bin/env python
import subprocess
import os
try:
pngs = subprocess.check_output("git status -s | grep '^A[^M].*.png'", shell=True)
except subprocess.CalledProcessError as e:
if e.returncode != 1:
print("Invalid exit code: " + e)
diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index a8ab582..f2445d5 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
@@ -306,6 +306,8 @@ gboolean gatt_service_add(struct btd_adapter *adapter, uint16_t uuid,
va_list args;
GSList *chrs, *l;
+ DBG("Adding GATT Service");
+