Skip to content

Instantly share code, notes, and snippets.

View chourobin's full-sized avatar

Robin Chou chourobin

View GitHub Profile
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 11, 2024 15:02
React Native Bridging Cheatsheet
@chourobin
chourobin / index.js
Created June 22, 2017 20:18 — forked from mrzmyr/index.js
React Native - Detect Double Tap
var Index = React.createClass({
getInitialState: function () {
return {
lastPress: 0
}
},
onPress: function () {
var delta = new Date().getTime() - this.state.lastPress;

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@chourobin
chourobin / MLWAsyncAVPlayer.h
Created June 20, 2017 04:23 — forked from k06a/MLWAsyncAVPlayer.h
Awesome optimized AVPlayer for smooth scrolling AVPlayerLayer inside UICollectionView/UITableView (tested on iOS10+)
#import <AVFoundation/AVFoundation.h>
@interface MLWAsyncAVPlayer : AVPlayer
@end

Keybase proof

I hereby claim:

  • I am chourobin on github.
  • I am robinchou (https://keybase.io/robinchou) on keybase.
  • I have a public key ASBUj_uuP1sOsaQ2FaG1ljzbnugx4PjNN9xIu8gFrpYvuAo

To claim this, I am signing this object:

@chourobin
chourobin / .eslintrc
Last active October 27, 2018 00:30
React Native General Eslint File
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"babel",
"react",
"react-native"
],
@chourobin
chourobin / RKAppDelegate.m
Last active October 22, 2018 14:22
Setting up magical record with RestKit
#import <RestKit/RestKit.h>
#import "CoreData+MagicalRecord.h"
// Use a class extension to expose access to MagicalRecord's private setter methods
@interface NSManagedObjectContext ()
+ (void)MR_setRootSavingContext:(NSManagedObjectContext *)context;
+ (void)MR_setDefaultContext:(NSManagedObjectContext *)moc;
@end
@implementation AppDelegate
@chourobin
chourobin / RNfontWeights.js
Created April 17, 2017 14:36 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@chourobin
chourobin / text-color.css
Created May 10, 2014 20:16
CSS Change text color animation
.site_title {
color: #f35626;
background-image: -webkit-linear-gradient(92deg,#f35626,#feab3a);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
-webkit-animation: hue 60s infinite linear;
}
@chourobin
chourobin / json_struct_example
Created January 20, 2014 01:28
Example creating structs on the fly
// http://play.golang.org/p/TVFHKUHO2p
package main
import "fmt"
import "encoding/json"
func main() {
type error struct {
Message string `json:"message"`