Skip to content

Instantly share code, notes, and snippets.

View jaysoo's full-sized avatar

Jack Hsu jaysoo

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jaysoo on github.
* I am jaysoo (https://keybase.io/jaysoo) on keybase.
* I have a public key whose fingerprint is BFC9 808A 5899 4F0E 0A99 2E53 49CC D477 8776 E138
To claim this, I am signing this object:
@jaysoo
jaysoo / software-development-talks.markdown
Last active August 29, 2015 14:09
Software development related talks that I enjoyed.
@jaysoo
jaysoo / reactive-design-and-lang-paradigms.md
Last active August 29, 2015 14:14
Notes for Reactive Design & Language Paradigms
  • Composibility in functional programming is much better than object-oriented composition.

  • HTTP became a great vehicle because it does very little (just text and status codes).

  • Very easy to build on top of common data structures.

  • Referential transparency makes testing much easier.

  • Separation of state and behaviour is desirable.

@jaysoo
jaysoo / coding-exercise.md
Created March 4, 2015 15:04
Nulogy Coding Exercise

Instructions

  1. Please answer the following question using Ruby, JavaScript or Java without using any third party gems, plugins, or jar files with the exception of MiniTest/RSpec, Jasmine, or JUnit for tests.

  2. Treat this problem as a library. No UI or file/console input is expected or required.

  3. Please submit via publicly accessible repo so that we can review your commits.

This is a proposal to simplify our frontend workflow.

Current setup

  1. Work on JS source code in client/ folder.
  2. Run gulp watch, which will:
  • Compile Angular and Handlebars templates.
  • Copy client/**/* to public/client/app/, so source + compiled templates can be served through Rails.
  1. No-pipe sets client/app as the baseUrl for RequireJS.
  2. Third-party components are installed to public/client/bower_components/ (see bower.json).

This is a proposal to simplify our frontend setup.

Motivation

The current frontend setup has some cognitive overhead in how we use it.

Problems:

  1. Using third-party components is not straight forward.
  • Have to remember what bower installs to public/client/bower_components/
# Count total memory by user
ps --no-headers -u username -o rss | (tr '\n' +; echo 0) | bc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id="Server" class="org.mortbay.jetty.Server">
<Get id="oldhandler" name="handler"/>
<Set name="handler">
<New id="Rewrite" class="org.mortbay.jetty.handler.rewrite.RewriteHandler">
<Set name="rewriteRequestURI">true</Set>
<Set name="rewritePathInfo">false</Set>
<Set name="originalPathAttribute">requestedPath</Set>
@jaysoo
jaysoo / pack.rb
Created August 11, 2010 18:23 — forked from sstephenson/pack.rb
#!/usr/bin/env ruby
# js1k packer
if ARGV[0] == "-n"
ARGV.shift
wrap = false
else
wrap = true
end
// Using types with reduc-actions
// See: https://github.com/borisyankov/DefinitelyTyped/pull/5827
import { handleActions, Action } from 'redux-actions';
const reducer = handleActions<number>({
'INCREMENT': (state: number, action: Action) => state + 1,
'DECREMENT': (state: number, action: Action) => state - 1
});