Skip to content

Instantly share code, notes, and snippets.

View lumaxis's full-sized avatar

Lukas Spieß lumaxis

View GitHub Profile
@lumaxis
lumaxis / config.json
Last active April 2, 2020 21:07
Homebridge plugin homebridge-http-lightbulb example configuration with Elgato Key Light
{
"bridge": {
"name": "Homebridge",
"username": "AA:BB:CC:DD:EE:FF",
"port": 51826,
"pin": "000-11-222"
},
"accessories": [
{
"accessory": "HTTP-LIGHTBULB",
v8.9.1
5.6.0
package@1.0.0 /path
├─┬ @private/package@1.2.9
│ ├── @private/package@1.2.2 deduped
│ ├── @private/package@0.3.4 deduped
│ ├─┬ @private/package@2.0.0
│ │ ├─┬ azure-storage@2.1.0
│ │ │ ├── browserify-mime@1.2.9 deduped
│ │ │ ├── extend@1.2.1
@lumaxis
lumaxis / sample.log
Created July 26, 2014 20:49
Slack.app process sample
Sampling process 831 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Slack (pid 831) every 1 millisecond
Process: Slack [831]
Path: /Applications/Slack.app/Contents/MacOS/Slack
Load Address: 0x100000000
Identifier: com.tinyspeck.slackmacgap
Version: 0.44.2 (73)
Code Type: X86-64
Parent Process: launchd [193]
@lumaxis
lumaxis / gmaps.py
Created July 23, 2014 17:29
Create Google Maps maps from csv
# -*- coding: utf-8 -*-
import pandas
from pymaps import Map, PyMap, Icon
# import data
data = pandas.read_csv('data.csv', index_col=0)
# prepare map
tmap = Map()
tmap.zoom = 2
@lumaxis
lumaxis / jsonWriting.m
Created July 17, 2014 12:45
iOS: Write a Foundation object as JSON file to disk
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:yourObject
options:(NSJSONWritingOptions) NSJSONWritingPrettyPrinted
error:&error];
NSString *jsonString;
if (! jsonData) {
NSLog(@"bv_jsonStringWithPrettyPrint: error: %@", error.localizedDescription);
jsonString = @"[]";
} else {
jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
@lumaxis
lumaxis / gist:6ce5c58c83bedc6d77dc
Last active August 29, 2015 14:04
iOS Calculate free disk space
-(uint64_t)getFreeDiskspace {
uint64_t totalSpace = 0;
uint64_t totalFreeSpace = 0;
NSError *error = nil;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
if (dictionary) {
NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];
NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
@lumaxis
lumaxis / Moves_changes.diff
Last active August 29, 2015 14:01
The changes in Moves.app's new Terms of Service and Privacy Policy
diff --git a/Summary of the Moves Terms of Use b/Summary of the Moves Terms of Use
index 466aae9..b2f23f3 100644
--- a/Summary of the Moves Terms of Use
+++ b/Summary of the Moves Terms of Use
@@ -3,16 +3,16 @@ Summary of the Moves Terms of Use
By using the Moves service, provided by ProtoGeo Oy (referred to as we), you agree to the terms and conditions set out in the Moves Terms of Use, which govern the contract between you and us. For your convenience, here is a non-legal description of some of the basic terms and general conditions of the Terms of Use:
Basic terms
-You must be of age or have your parent’s consent to use Moves.
-You accept our Privacy Policy and its implications.

Keybase proof

I hereby claim:

  • I am lumaxis on github.
  • I am lumaxis (https://keybase.io/lumaxis) on keybase.
  • I have a public key whose fingerprint is 0FF0 A711 CF83 2C73 0300 F64C E417 65C6 0D76 C57A

To claim this, I am signing this object:

tell application "Mail"
set _accounts to {account "Private", account "Monkeys"}
set _1ago to (current date) - 1 * days
set _3ago to (current date) - 3 * days
set _7ago to (current date) - 7 * days
repeat with _account in _accounts
set _inbox to mailbox "INBOX" of _account
set read status of (messages of mailbox "⌛1 Day" of _account) to false
set read status of (messages of mailbox "⌛3 Days" of _account) to false
@lumaxis
lumaxis / iMessage.py
Created February 18, 2013 13:02
iMessage in Python
cmd = """osascript<<END
tell application "iChat"
activate
log in
delay 3
send "text" to buddy "adress" of service 1
end tell
END"""