Skip to content

Instantly share code, notes, and snippets.

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

Kyle 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)
@zhigang1992
zhigang1992 / index.d.ts
Created May 23, 2017 10:50 — forked from hktonylee/index.d.ts
Typescript Typing Definition for react-native-fbsdk
declare module "react-native-fbsdk" {
import * as React from 'react'
export interface LoginResult {
isCancelled: boolean,
grantedPermissions?: Array<string>,
declinedPermissions?: Array<string>,
}
export type DefaultAudience = 'friends' | 'everyone' | 'only_me';
@zhigang1992
zhigang1992 / renderRect.js
Created January 1, 2020 15:14 — forked from mlewand/renderRect.js
DOMRect visualisation - a small helper for visualizing DOMRect objects.
( function() {
/**
* A helper function to visualize DOMRect or set of DOMRect instances.
*
* Subsequent calls will remove previously marked elements.
*
* Debug a element currently focused in your devtools inspector.
* window.markRect( $0.getBoundingClientRect() );
* // Debug a selection.
* window.markRect( document.getSelection().getRangeAt( 0 ).getClientRects() );