Skip to content

Instantly share code, notes, and snippets.

View youngshook's full-sized avatar
🐝
Working

YoungShook youngshook

🐝
Working
View GitHub Profile
@youngshook
youngshook / sh
Created October 9, 2015 03:12
Instead of reinstating the symlinks, the better way to do it would be to use brew link
brew list | xargs -I % sh -c 'brew unlink %; brew link %'
@youngshook
youngshook / HZClassUsingEnum.h
Last active November 17, 2017 08:41 — forked from hezi/HZClassUsingEnum.h
Objective-C Enum-TO-NSString and Vice versa.
// Declare enums like so:
#define IMAGE_STATUS(XX) \
XX(kDOImageStatusOK, = 0) \
XX(kDOImageStatusCached, )\
XX(kDOImageStatusRetry, )
DECLARE_ENUM(DOImageStatus, IMAGE_STATUS)
@youngshook
youngshook / mianshiwentitxt
Last active August 26, 2015 12:08 — forked from onlytiancai/mianshiwentitxt
面试问的问题-草稿
为了更全面的展示你自己,你可以回答以下题目,每个问题你都可以不作答,不会减分,只是答的好的话会加分。
1. 有哪些兴趣爱好和擅长
2. 常去哪些技术网站和社区
3. 参与过开源项目,做了什么贡献
4. 常用哪些组件,库或框架,哪个是你最熟悉最拿手的
5. 完整看完过哪些技术书籍,哪本是你反复看过的,哪本对你影像最大
6. 使用过哪些编程语言,最擅长哪个语言?
7. 有没有自己的域名,网站,博客,github,stackoverflow ,v2ex,知乎,微博,twitter,google plus账号
8. 精通正则表达式吗?
9. c学的如何? 计算机组成原理学的咋样?
@youngshook
youngshook / gist:f177c3a8bfe00c3b1251
Last active August 29, 2015 14:17
repair xcode plugin
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID`
@youngshook
youngshook / Button_TouchPoint.m
Created January 18, 2015 13:04
放大UIButton点击热区
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event
{
    CGRect bounds = self.bounds;
    //若原热区小于44x44,则放大热区,否则保持原大小不变
CGFloat widthDelta = MAX(44.0 - bounds.size.width, 0);
CGFloat heightDelta = MAX(44.0 - bounds.size.height, 0);
bounds = CGRectInset(bounds, -0.5 * widthDelta, -0.5 * heightDelta);
return CGRectContainsPoint(bounds, point);
}
# 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)
@youngshook
youngshook / separatorLine.m
Created December 14, 2014 10:40
自绘分割线
//
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextFillRect(context, rect);
CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0xE2/255.0f green:0xE2/255.0f blue:0xE2/255.0f alpha:1].CGColor);
CGContextStrokeRect(context, CGRectMake(0, rect.size.height - 1, rect.size.width, 1));
@youngshook
youngshook / build-libssl.sh
Created November 18, 2014 03:54
Automatic build script for libssl and libcrypto for iPhoneOS and iPhoneSimulator
#!/bin/sh
# Automatic build script for libssl and libcrypto
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 16.12.10.
# Copyright 2010 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

//
// NTBProxyImageView.h
// Vectoria Squared
//
// Created by Nigel Barber on 22/04/2013.
// Copyright (c) 2013 Nigel Barber. All rights reserved.
//
#import <UIKit/UIKit.h>