Skip to content

Instantly share code, notes, and snippets.

View kafaichoi's full-sized avatar
🍃

KaFai kafaichoi

🍃
View GitHub Profile
stack install hakyll
hakyll-init my-site
cd my-site
stack init  # creates stack.yaml file based on my-site.cabal
stack build
stack exec site build #create _site(HTML&asset, ready to be deployed), _cache(used by Hakyll)

stack exec site watch # preview and now go to localhost:8000
It's consisted of encoder and decoder.
Encoders(Autoencoders) are networks(unsuperprised learning, feed-forward), which try to reconstruct their own input
(reproduct input as output). You construct the network so that it reduces the input size by using one or more hidden layers,
until it reaches a reasonably small hidden layer in the middle. As a result your data has been compressed (encoded) into
a few variables. From this hidden representation the network tries to reconstruct (decode) the input again.
In order to do a good job at reconstructing the input the network has to learn a good representation of the data in
the middle hidden layer. This can be useful for dimensionality reduction, or for generating new “synthetic” data
from a given hidden representation.
@kafaichoi
kafaichoi / js-tips.md
Last active May 30, 2017 06:16
JS Tips
// Using proxy in redux action.
const types = {
  FETCH_FILE_REQUEST: 'fetch_file_request',
  FETCH_FILE_SUCCESS: 'fetch_file_success',
  FETCH_FILE_FAIL: 'fetch_file_fail'
}

const typeValidator = {
 get(obj, prop) {
@kafaichoi
kafaichoi / upgrade-postgres-9.3-to-9.5.md
Created June 6, 2016 03:34 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@kafaichoi
kafaichoi / install.sh
Created May 16, 2016 13:21 — forked from chaos-ad/install.sh
Installing erlang in ubuntu
#!/bin/bash
# installing erlang on ubuntu's
VERSION="R15B01"
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev
sudo mkdir -p /opt/erlang/
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl
sudo mv kerl /opt/erlang/
:e. :edit . at current working directory
:sp. :split . in split at current working directory
:vs. :vsplit . in vertical split at current working directory
:E :Explore at directory of current file
:Se :Sexplore in split at directory of current file
:Vex :Vexplore in vertical split at directory of current file
% create a new file
d create a new directory
R rename the file/directory under the cursor
@kafaichoi
kafaichoi / gist:aac9865ae19fa20666c7
Last active August 29, 2015 14:07
CQL create table
CREATE TABLE shake_magnitudes (
event_id int,
user_id int,
recorded_at timestamp,
magnitude float,
PRIMARY KEY (event_id, user_id, recorded_at)
)
WITH CLUSTERING ORDER BY (user_id ASC, recorded_at ASC);
@kafaichoi
kafaichoi / gist:a6f8bda444da4e3a5886
Created September 17, 2014 06:39
Setting Up test build for Ionic App for HockeyApp
Register in HockeyApp
-Android
1. cordova build --release android
2. keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
3. jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name
4. zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk
5. upload apk file to HockeyApp
-IOS
1. cordova build --release ios