Skip to content

Instantly share code, notes, and snippets.

View hhua's full-sized avatar

Han Hua hhua

  • GV
  • Bay Area
View GitHub Profile
@hhua
hhua / Dockerfile
Last active August 29, 2015 14:18
Cron on Docker
FROM node:0.10.35
RUN apt-get update && apt-get install -y cron rsyslog
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN ln -s /usr/src/app/lib/sample_cron /etc/cron.d/sample_cron
RUN touch /var/log/cron.log

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
[self.tableView setEditing:NO];
}];
moreAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
[self.tableView setEditing:NO];
}];
@hhua
hhua / foo.html
Created February 24, 2014 02:06
Advanced CSS
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="box box-round"></div>
<div class="box box_shadow"></div>
<div class="box box_gradient"></div>
<div class="box box_rgba"></div>
<div class="box box_rotate"></div>
@hhua
hhua / foo.html
Created February 4, 2014 04:37
CSS Study 1
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="text">
<span class="block">Hello World</span>
<p id="second-text" class="block">Hello World</p>
<p id="third-text" class="block">Hello World</p>
<p class="image">Hello World</p>
<!DOCTYPE html>
<html>
<head>
<title>Learning</title>
</head>
<body>
<a href="http://www.google.com">google</a>
<!-- start of header -->
<h1>Hello</h1>
@hhua
hhua / fork.html
Last active January 4, 2016 04:59
Day 1
<!DOCTYPE html>
<html>
<head>
<title>Learning</title>
</head>
<body>
<a href="http://www.google.com">google</a>
<!-- start of header -->
<h1>Hello</h1>
@hhua
hhua / pr.md
Created November 13, 2013 21:03 — forked from piscisaureus/pr.md

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:

<html>
<head></head>
<body>
<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
var player = $f('player'); // You should pass player id, which is 'player'
player.api('ready', function() {