Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / .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 / 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
{
/* [UIColor colorWithHex:0xFF0000]; */
#import <UIKit/UIKit.h>
@interface UIColor (Hex)
+(UIColor*) colorWithHex:(int)hex;
@end
@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