Skip to content

Instantly share code, notes, and snippets.

View lumaxis's full-sized avatar

Lukas Spieß lumaxis

View GitHub Profile
@lumaxis
lumaxis / A9.c
Created January 26, 2012 17:59
Mittelwert beliebig vieler Zahlen
#include "stdio.h"
#include "stdlib.h"
void inputNumbers(int *size, double **numbers){
int i;
/* Abfrage nach Anzahl der Zahlen */
printf("Anzahl der zu speichernden Zahlen:\n");
scanf("%d", size);
@lumaxis
lumaxis / gist:1691199
Created January 27, 2012 22:11
Verkettete Liste
#include <stdio.h>
#include <stdlib.h>
struct IntKnotenStruct {
int data;
struct IntKnotenStruct *next;
struct IntKnotenStruct *prev;
};
typedef struct IntKnotenStruct IntKnoten;
@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"""
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

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:

@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.
@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 / 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 / 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 / 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]