Skip to content

Instantly share code, notes, and snippets.

@hongvuxuan
hongvuxuan / Default-568h@2x.png
Last active August 29, 2015 04:27 — forked from uebo/Default-568h@2x.png
iOS Sample Launch Screen File
Default-568h@2x.png
@hongvuxuan
hongvuxuan / UIWebView+JSONObjectByEvaluatingJavascript.h
Created October 7, 2015 09:27 — forked from beccadax/UIWebView+JSONObjectByEvaluatingJavascript.h
A category on UIWebView that lets you return any JSON-compatible content from Javascript code. (This means arrays, objects/dictionaries, strings, numbers, and nulls.)
//
// UIWebView+JSONObjectByEvaluatingJavascript.h
// Feeder
//
// Created by Brent Royal-Gordon on 7/1/13.
// Copyright (c) 2013 Architechies. All rights reserved.
//
@interface UIWebView (Additions)
@hongvuxuan
hongvuxuan / cracking.md
Created November 4, 2015 11:09 — forked from vertexclique/cracking.md
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@hongvuxuan
hongvuxuan / UITableView_SeparatorLine.md
Created November 5, 2015 10:01 — forked from TonnyXu/UITableView_SeparatorLine.md
set UITableView.separatorLine to 2px and with different colors each pixel

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer

@hongvuxuan
hongvuxuan / EYInfiniteEquilateralTriangleAnimationView.h
Created November 9, 2015 15:47 — forked from erkanyildiz/EYInfiniteEquilateralTriangleAnimationView.h
Infinite Equilateral Triangle Animation as Activity Indicator
// erkanyildiz
// 20150813-1940
//
// EYInfiniteEquilateralTriangleAnimationView.h
#import <UIKit/UIKit.h>
@interface EYInfiniteEquilateralTriangleAnimationView : UIView
- (instancetype) initWithSide:(CGFloat)side andCenter:(CGPoint)center;
- (void) start;
@hongvuxuan
hongvuxuan / UICollectionView+ReloadItemsAnimated.h
Created February 29, 2016 02:46 — forked from mipstian/UICollectionView+ReloadItemsAnimated.h
UICollectionView category to disable animation on reloadItemsAtIndexPaths:
#import <UIKit/UIKit.h>
@interface UICollectionView (ReloadItemsAnimated)
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths animated:(BOOL)animated;
@end
@hongvuxuan
hongvuxuan / NSHTTPCookieStorage+FreezeDry.h
Created March 25, 2016 08:50 — forked from maciekish/NSHTTPCookieStorage+FreezeDry.h
Persists UIWebView cookies to disk. To send the cookies with an initial NSURLRequest you must do the following after loading the cookies: NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:yourURL]; NSDictionary* headers = [NSHTTPCookie requestHeaderFieldsWithCookies:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]]; [requ…
//
// NSHTTPCookieStorage+FreezeDry.h
//
// Created by Maciej Swic on 19/08/13.
//  
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@hongvuxuan
hongvuxuan / pr.md
Created May 22, 2016 16:42 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@hongvuxuan
hongvuxuan / swiftDelegateExample.swift
Created October 24, 2016 10:22 — forked from austinzheng/swiftDelegateExample.swift
A simple example of setting up a delegate in Swift.
//
// ExampleCode.swift
//
import UIKit
// MARK: - Protocol
protocol SearchQueryProviderProtocol : class { // 'class' means only class types can implement it
func searchQueryData() -> String
@hongvuxuan
hongvuxuan / macos_sierra_upgrade.md
Created October 26, 2016 08:46 — forked from henrik/macos_sierra_upgrade.md
macOS Sierra update: Ruby, Rails, homebrew, VirtualBox/Vagrant, Elixir etc.

My notes from updating to macOS Sierra, as a Ruby/Rails developer working in VirtualBox/Vagrant.

Homebrew

brew doctor told me to fix /usr/local ownership:

sudo chown -R $(whoami) /usr/local

It also said Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool.