Skip to content

Instantly share code, notes, and snippets.

@andrewkchan
andrewkchan / rootRenderScene.js
Created March 14, 2017 03:49
Root component - renderScene method
import YourPage from "../components/YourPage";
class Root extends Component {
renderScene(route, navigator) {
let renderedScene;
switch (route.id) {
case "dashboard": {
renderedScene = (
<Dashboard />
);
@andrewkchan
andrewkchan / commands.config
Created April 27, 2017 00:49
ElasticBeanstalk - C9 ebextension
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "npm start"
ProxyServer: apache
GzipCompression: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/00_set_tmp_permissions.sh":
mode: "000755"
owner: root
group: root
@andrewkchan
andrewkchan / porter_stemmer.py
Created July 19, 2017 17:55
Porter stemming algorithm in Python 3.
#!/usr/bin/env python3
"""Porter Stemming Algorithm
This is the Porter stemming algorithm, ported to Python from the
version coded up in ANSI C by the author. It may be be regarded
as canonical, in that it follows the algorithm presented in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 130-137,