Skip to content

Instantly share code, notes, and snippets.

Christoph Halang bestimmaa

Block or report user

Report or block bestimmaa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bestimmaa
bestimmaa / apache_force_type
Created Nov 7, 2016
How to add Content/Type header to file without extension on Apache2
View apache_force_type
<Files "FILENAME">
ForceType application/json
</Files>
View ocmock-cheatsheet.m
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
@bestimmaa
bestimmaa / ReusableCellExample.m
Created Aug 16, 2016 — forked from bunnyhero/ReusableCellExample.m
Example of Reactive Cocoa binding for a reusable cell.
View ReusableCellExample.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:REUSABLE_CELL_ID];
UILabel *label = (UILabel *)[cell viewWithTag:VIEW_TAG];
Model *someModel = [self getModelFromIndexPath:indexPath];
// `takeUntil:` makes the RACObserve() signal complete (and thus breaks the subscription)
// when the cell is recycled.
@bestimmaa
bestimmaa / keyboard.swift
Created Jul 22, 2016
Handle UIKeyboard for form screens on iOS
View keyboard.swift
func keyboardShow(notification: NSNotification) {
let info: NSDictionary = notification.userInfo!
let frameV: NSValue = info[UIKeyboardFrameEndUserInfoKey] as! NSValue
let frame: CGRect = frameV.CGRectValue()
UIView.animateWithDuration(0.2, animations: {
() in
self.sview.contentInset = UIEdgeInsetsMake(0, 0, frame.size.height, 0)
})
}
@bestimmaa
bestimmaa / custom_seperator.m
Created Nov 11, 2015
iOS Custom UITableViewCell Seperator
View custom_seperator.m
// Use a custom seperator of full width
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = kColorSeperator;
lineView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:lineView];
[lineView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.contentView];
[lineView autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.contentView];
[lineView autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self];
[lineView addConstraint:[NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeHeight multiplier:1.0 constant:1]];
@bestimmaa
bestimmaa / notification.m
Created Jul 2, 2015
iOS - Post and subscribe to NSNotification
View notification.m
// declare notification name in something.h
extern NSString* const touchEndNotification;
// define notification name in something.m
NSString* const touchEndNotification = @"StimulusRotationDidEnd";
// post notification
[[NSNotificationCenter defaultCenter] postNotificationName:touchEndNotification object:self];
// subscribe to notification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateSurfaceView) name:touchEndNotification object:nil];
View .gitignore
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
[Ll]ibrary/
sysinfo.txt
# ===================================== #
@bestimmaa
bestimmaa / cinderblock.xml
Created Sep 19, 2014
Cinder-KCB2 cinderblock file for x86
View cinderblock.xml
<?xml version="1.0" encoding="UTF-8" ?>
<cinder>
<block
name="Cinder-KCB2"
id="com.wk.kcb2"
author="Wieden+Kennedy"
license="BSD"
summary="Kinect v2 Common Bridge block for Cinder"
git="git@github.com:wieden-kennedy/Cinder-KCB2.git"
version="0.2"
@bestimmaa
bestimmaa / AutoHotkey.ahk
Last active Aug 29, 2015
AutoHotkey Script for using Apple Keyboard on Windows
View AutoHotkey.ahk
LAlt::RAlt
RAlt::LAlt
LWin::LControl
View APPNAME
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
You can’t perform that action at this time.