Skip to content

Instantly share code, notes, and snippets.

View zhigang1992's full-sized avatar
:octocat:
Focusing

Kyle Fang zhigang1992

:octocat:
Focusing
View GitHub Profile
@zhigang1992
zhigang1992 / javascript_resources.md
Created March 27, 2014 11:09 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
keyboard_notification = -> name {
NSNotificationCenter.defaultCenter.rac_addObserverForName(name, object:nil)
}
rac.showing_keyboard = RACSignal.merge!(
keyboard_notification.call(UIKeyboardWillShowNotification).map! {|_| true },
keyboard_notification.call(UIKeyboardWillHideNotification).map! {|_| false}
).takeUntil(self.rac_willDeallocSignal)
set-window-option -g mode-keys vi
set-option -g status-keys vi
# switch windows alt+number
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
@zhigang1992
zhigang1992 / SassMeister-input.scss
Created December 7, 2014 06:16
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
.parent {
$color: red;
.son {
$color: black;
color: $color;
@zhigang1992
zhigang1992 / image_cropper.rb
Created April 22, 2015 03:16
Rubymotion Versions Of Image_Cropper
class UIImage
def crop_at(rect)
UIGraphicsBeginImageContext(rect.size)
context = UIGraphicsGetCurrentContext()
clipped_rect = CGRectMake(0, 0, rect.size.width, rect.size.height)
CGContextClipToRect( context, clipped_rect)
draw_rect = CGRectMake(rect.origin.x * -1,
rect.origin.y * -1,
@zhigang1992
zhigang1992 / racui.rb
Last active August 29, 2015 14:25
ReactiveCocoa RubyMotion Extension
class UITextField
alias_method :text_signal, :rac_textSignal
end
class UIActionSheet
alias_method :button_signal, :rac_buttonClickedSignal
end
class UIControl
alias_method :event_signal, :rac_signalForControlEvents
@zhigang1992
zhigang1992 / AlfredGitClone.sh
Last active December 14, 2015 06:39
Clone Git Repos with Alfred.
cd ~/Temp;
IFS='/' read -a array <<< "{query}";
folder=`echo ${array[${#array[@]}-1]} | cut -d \. -f 1`
if [ ! -d $folder ]; then
git clone "{query}";
cd `echo $folder`;
open .;
@zhigang1992
zhigang1992 / gist:6445845
Created September 5, 2013 03:45
UESTC_hosts
222.197.165.180 ecard.uestc.edu.cn
202.112.14.179 www.xkjs.uestc.edu.cn
222.197.164.247 webpac.uestc.edu.cn
222.197.164.43 www.bb.uestc.edu.cn
222.197.164.72 portal.uestc.edu.cn
222.197.164.72 freshman.uestc.edu.cn
222.197.164.72 sa.uestc.edu.cn
222.197.164.74 ea.uestc.edu.cn
222.197.164.236 mail.std.uestc.edu.cn
222.197.165.118 www.spead.uestc.edu.cn
@zhigang1992
zhigang1992 / gist:7615409
Last active December 29, 2015 04:29
iOS development roadmap

iOS development roadmap

  1. Stanford CS193P. All session, all homework. By the end of it, you should know how MVC works, having a deep understanding at delegation, protocols and etc.
  2. Start to build something small, get familiar with UIKit. For example, UITableView, UISeachView, UICollectionView. Pay attention to autolayout, new APIs introduced in iOS7.
  3. WWDC videos, you may not fully understand what they are talking about, but just bear with it, It's will worth your while.
  4. �Now, you are ready to work on actual projects. Network � and database related stuff, try using Apple's native api(NSConnection, CoreData). And after you feel depressed, try to find the open-source replacements(AFNetworking, MagicalRecord), which will make your life much easier. Mean time, learn how to use cocoapods, because you are going to need it.
  5. "Pushing the limits of iOS." (Book, it's a great read)
  6. When you are ready, try to understand the codes from open-source projects. Maybe even find fixes or bugs. Sending pull req
@zhigang1992
zhigang1992 / private.xml
Last active December 30, 2015 21:19
Dvorak for external USB keyboard (KeyRemap4MacBook)
<?xml version="1.0"?>
<root>
<item>
<name>Hyper key stuff</name>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, F19)</appendix>
<identifier>private.f192f19</identifier>
<autogen>
--KeyOverlaidModifier--