Skip to content

Instantly share code, notes, and snippets.

View sebk's full-sized avatar

Sebastian Kruschwitz sebk

View GitHub Profile
@sebk
sebk / immich_download.py
Created March 29, 2026 09:21
immich download
import requests
import os
from datetime import datetime
# only tested with immich server v2.1.0
# =========================
# CONFIG
# =========================
API_KEY = "API_KEY"
@sebk
sebk / BL on or off
Last active August 29, 2015 14:23
Bluetooth on/off test
#import "ViewController.h"
@import CoreBluetooth;
@interface ViewController () <CBCentralManagerDelegate>
@property(nonatomic, strong) CBCentralManager *cbManager;
@end
@implementation ViewController
@sebk
sebk / bashprombt
Created September 28, 2012 11:31
better bash prompt with git branch
#source: http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
@sebk
sebk / gist:3691003
Created September 10, 2012 13:43
UIPanGestureRecognizer - determine direction
CGPoint velocity = [gestureRecognizer velocityInView:currentView];
if (velocity.x * lastGestureVelocity.x + velocity.y * lastGestureVelocity.y > 0) {
//NSLog(@"gesture went in same direction");
}
else {
NSLog(@"gesture went in opposite direction");
}
lastGestureVelocity = velocity;
@sebk
sebk / panGesture.m
Created May 4, 2012 07:14
Move component with UIPanGestureRecognizer
- (void)viewDidLoad {
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"BUTTON" forState:UIControlStateNormal];
[button setFrame:CGRectMake(50, 50, 150, 150)];
[self.view addSubview:button];
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(invokePanGesture:)];