Skip to content

Instantly share code, notes, and snippets.

View hjazz's full-sized avatar
🏠
Working from home

jazz-triple hjazz

🏠
Working from home
View GitHub Profile
@hjazz
hjazz / subversion_adapter.rb
Created December 14, 2012 09:19
Redmine Subversion SSL Issue
def credentials_string
str = ''
str << " --username #{shell_quote(@login)}" unless @login.blank?
str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
str << " --trust-server-cert --no-auth-cache --non-interactive"
str
end
@hjazz
hjazz / gist:5812513
Last active December 18, 2015 16:39
UIView Popup Animation
- (IBAction)showpopup:(id)sender {
zoomview.hidden=NO;
[self.view addSubview:zoomview];
zoomview.frame = CGRectMake(0,0,0,0); // wherever
zoomview.transform = CGAffineTransformMakeScale(0.5,0.5);
[UIView animateWithDuration:0.9 animations:^{
zoomview.transform = CGAffineTransformMakeScale(1,1);
} completion:^(BOOL finished) {
}];
@hjazz
hjazz / BlurFilter
Created November 27, 2013 07:03
adopt GaussianBlur Fiilter to UIImage
UIImage *myImage = [UIImage imageNamed:@"some_image"];
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *inputImage = [CIImage imageWithCGImage:myImage.CGImage];
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:@8.f forKey:@"inputRadius"]; // Default Value is 10.f
CIImage *result = [filter valueForKey:kCIOutputImageKey];
CGImageRef cgImage = [context createCGImage:result fromRect:[inputImage extent]];
@hjazz
hjazz / TerminalNotification Version
Last active August 29, 2015 13:56
TestFlight Upload Archive Script (put this script Schema's Archive Post-actions)
#
# Terminal Notification!
# if you don't have terminal-notifier command line tool,
# >brew install terminal-notifier
#
API_TOKEN="API_TOKEN"
TEAM_TOKEN="TEAM_TOKEN"
SIGNING_IDENTITY="iPhone Distribution: ..."
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/...mobileprovision"
@hjazz
hjazz / .bash_profile
Created February 11, 2014 02:05
Terminal Config
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
export TERM="xterm-color"
export GREP_OPTIONS='--color=auto'
TITLEBAR='\[\e]0;\u@\h:\w \a\]'
alias ls="ls -v"
alias ll="ls -alv"
@hjazz
hjazz / podConfig
Created February 11, 2014 02:08
Script for cocoapods install before build (Put this script under Pre-actions in Build Scheme)
cd $SRCROOT
/usr/local/opt/ruby/bin/pod
@hjazz
hjazz / build_number_from_git
Created February 11, 2014 05:55
Automatically Update Xcode Build Numbers from Git
#Update build number with number of git commits if in release mode
if [ ${CONFIGURATION} == "Release" ]; then
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ')
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
fi;
@hjazz
hjazz / .vimrc
Created February 14, 2014 09:56
vimrc
set nocompatible " 오리지날 VI와 호환하지 않음
set autoindent " 자동 들여쓰기
set cindent " C 프로그래밍용 자동 들여쓰기
set smartindent " 스마트한 들여쓰기
set wrap
set nowrapscan " 검색할 때 문서의 끝에서 처음으로 안돌아감
set nobackup " 백업 파일을 안만듬
set visualbell " 키를 잘못눌렀을 때 화면 프레시
set ruler " 화면 우측 하단에 현재 커서의 위치(줄,칸) 표시
set shiftwidth=4 " 자동 들여쓰기 4칸
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@hjazz
hjazz / sha256.m
Created March 9, 2014 07:51
sha256 string
#import <CommonCrypto/CommonDigest.h>
+ (NSString*)sha256HashFor:(NSString*)input
{
const char* str = [input UTF8String];
unsigned char result[CC_SHA256_DIGEST_LENGTH];
CC_SHA256(str, (unsigned int)strlen(str), result);
NSMutableString *ret = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH*2];
for(int i = 0; i<CC_SHA256_DIGEST_LENGTH; i++)