Skip to content

Instantly share code, notes, and snippets.

View marshallshen's full-sized avatar

Marshall Shen marshallshen

View GitHub Profile

Title: Build React Native app with Redux and React Navigation

First Principle

Mobile development centers around User Experience with a limited amount of space estate. Two key areas of mobile developments are navigation and data management. Regardless of development frameworks and devices types, mobile app makers need to address the questions on behalf of users:

  1. How can I have great navigation experience within the app?
  2. How can I load information the moment I need it?

Inside React Native framework, Redux is a powerful tool for data management and React Navigation is a powerful tool for navigation.

@marshallshen
marshallshen / db.go
Last active August 11, 2017 14:40
Instructions
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
"gopkg.in/gorp.v1"
"log"
)
func initDb() *gorp.DbMap {
db, err := sql.Open("mysql", "root:password@/instructions")
checkErr(err, "sql.Open failed")
@marshallshen
marshallshen / demo.js
Created March 13, 2017 21:39 — forked from russau/demo.js
Lambda function for ElasticTranscoder
console.log('Loading event');
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
console.log('Received event:');
console.log(JSON.stringify(event, null, ' '));
// Get the object from the event and show its content type
var bucket = event.Records[0].s3.bucket.name;
var key = event.Records[0].s3.object.key;
var output = Math.random().toString(36).substring(7) + ".webm";
@marshallshen
marshallshen / launch_sublime_from_terminal.markdown
Created July 15, 2016 18:53 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

public class MainActivity extends Activity {
// Method to start the service
public void startService(View view) {
startService(new Intent(getBaseContext(), MyService.class));
}
// Method to stop the service
public void stopService(View view) {
stopService(new Intent(getBaseContext(), MyService.class));
}
context 'performance' do
before do
require 'benchmark'
@posts = []
@users = []
8.times do |n|
user = Factory.create(:user)
@users << user
aspect = user.aspects.create(:name => 'people')
connect_users(@user, @aspect0, user, aspect)
@marshallshen
marshallshen / nat.scala
Created October 9, 2013 01:26
Piano Numbers serves as the basis for floating numbers
package pianoNumbers
abstract class Nat {
def isZero: Boolean
def successor = new Succ(this)
def successor: Nat
def +(that: Nat): Nat
def -(+that: Nat): Nat
}
@marshallshen
marshallshen / test.js
Created September 2, 2013 19:22
Ember.js testing framework
module("Basic Routing", {
setup: function() {
Ember.run(function() {
App = Ember.Application.create({
name: "App",
rootElement: '#qunit-fixture'
});
App.deferReadiness();
@marshallshen
marshallshen / geekon_todo.md
Last active December 20, 2015 04:29
Geekon TODO list

Dexter

  • Enable dexter new [project-name]command to set up a JB project. DONE
  • Update features on JB.
  • Research on how to setup personal blog on github.groupondev.com (is it possible?)
  • Logo, design external-facing page for Dexter

Jekyll Bootstrap

  • Improve initial launch theme
  • Create rake theme:extract name:theme-name to enable people to open source their theme
  • Research on Jekyll plugin, see if JB can automate that.