Skip to content

Instantly share code, notes, and snippets.

@atkit
atkit / UIView+Activity.h
Last active October 13, 2015 01:17
Category: Activity View [ARC]
//
// UIView+Activity.h
//
// Created by Andrew on 7/7/11.
// Copyright 2011 Al Digit. All rights reserved.
//
// Based on GIST: https://gist.github.com/andrew-tokarev/4116199
//
// Updated at 9/05/2013 - Version 1.4
/* [UIColor colorWithHex:0xFF0000]; */
#import <UIKit/UIKit.h>
@interface UIColor (Hex)
+(UIColor*) colorWithHex:(int)hex;
@end
@atkit
atkit / pseudocode.m
Last active December 26, 2015 02:39
Stick to Keyboard Animation Curve
// We may use it in viewWillAppear/viewWillDisappear
- (void) addKeyboardObserver
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
}
- (void) removeKeyboardObserver
{
@atkit
atkit / .gitconfig
Last active January 3, 2016 14:19
.gitconfig stub
[user]
name = "<YOUR NAME>"
email = "<E-MAIL>"
[alias]
co = checkout
ci = commit
st = status
br = branch
lol = log --graph --decorate --pretty=oneline --abbrev-commit
l = log --pretty=oneline --graph --abbrev-commit --stat
@atkit
atkit / Alert.h
Created January 23, 2014 10:33
Alert Builder - how to use (pseudo code) - Alert.h - Alert.m
//
// AlertBuilder
//
#import <Foundation/Foundation.h>
typedef void (^AlertButtonBlock) ();
@interface Alert : NSObject <UIAlertViewDelegate>
@atkit
atkit / upstream.sh
Created June 26, 2014 14:17
My git fork/upstream synchronization script
#!/bin/bash
for D in *; do
if [ -d "${D}" ]; then
cd ${D}
echo ${D}
echo ================================
git fetch upstream
git checkout master
@atkit
atkit / git-pull-all.sh
Created August 26, 2014 14:24
Recursive Git Pull
#!/bin/bash
for dir in $(find . -name ".git"); do
echo "Pulling " ${dir%/*}
cd ${dir%/*}
git pull --ff
cd - > /dev/null
@atkit
atkit / .gitignore
Created August 26, 2014 14:29
My XCode .gitignore
# Xcode
.DS_Store
/build/*
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
@atkit
atkit / syncgateway_walrus_config.json
Created August 26, 2014 15:14
Couchbase Sync Gateway Config for Walrus
{
"log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Shadow", "Shadow+", "Changes", "Changes+"],
"interface":":4984",
"adminInterface":":14985",
"facebook":{
"register":true
},
"databases":{
"gw":{
"server":"walrus:data",
@atkit
atkit / syncgateway_config.json
Created August 26, 2014 15:35
Couchbase Sync Gateway Config
{
"log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Shadow", "Shadow+", "Changes", "Changes+"],
"interface":":4984",
"adminInterface":":14985",
"facebook":{
"register":true
},
"databases":{
"gw":{
"server":"http://localhost:8091",