Skip to content

Instantly share code, notes, and snippets.

View abalone0204's full-sized avatar
💭
Coding

Denny Ku abalone0204

💭
Coding
View GitHub Profile
@abalone0204
abalone0204 / MarketShit.rb
Last active August 29, 2015 14:10
三商美邦分公司分佈
require 'rubygems'
require 'nokogiri'
require 'restclient'
module MarketShit
def hello
puts "jelko"
end
def main
@abalone0204
abalone0204 / withBuiltInCreateStore.js
Last active November 28, 2015 08:40
Redux Store Implmentation
const store = createStore(counter);
const showCurrentState = () => {
console.log('Current State is: ',store.getState())
}
showCurrentState();
store.subscribe(showCurrentState);
store.dispatch({type: 'INC'});
store.dispatch({type: 'INC'});
store.dispatch({type: 'DEC'});
@abalone0204
abalone0204 / createStore.js
Created November 28, 2015 08:33
Redux Implementation: createStore Implementation
function createStore (reducer) {
var state;
var listeners = [];
const getState = () => state;
const dispatch = (action) => {
state = reducer(state, action);
listeners.forEach(listener => listener());
};
const subscribe = (listener) => {
@abalone0204
abalone0204 / reducer.js
Created November 28, 2015 08:37
Counter reducder
const counter = (state =0 , action) => {
switch(action.type) {
case 'INC':
return state+1;
case 'DEC':
return state -1;
default:
return state;
}
}
@abalone0204
abalone0204 / card.scss
Last active December 5, 2015 06:37
card.scss
.flipflap_card {
@include transition(all ease 0.5s);
.card_reveal {
@include transition(all ease 0.5s);
@include transform(rotateY(180deg));
opacity: 0;
}
&:hover {
@include transform(rotateY(180deg));
.card_reveal {
SELECT
IFNULL(pcr.transid,
IFNULL(acr.gwsr,
IFNULL(ncr.ordernumber_timestamp,0))) auth ,
NULLIF( (pcr.transid, IFNULL( acr.gwsr, IFNULL( ncr.ordernumber_timestamp, 0)) ), '')
@abalone0204
abalone0204 / PrimeGenerator-before.java
Created May 10, 2016 04:54
Clean Code - annotation
/**
* This class Generates prime numbers up to a user specified
* maximum. The algorithm used is the Sieve of Eratosthenes.
* <p>
* Eratosthenes of Cyrene, b. c. 276 BC, Cyrene, Libya --
* d. c. 194, Alexandria. The first man to calculate the
* circumference of the Earth. Also known for working on
* calendars with leap years and ran the library at Alexandria.
* <p>
* The algorithm is quite simple. Given an array of integers
@abalone0204
abalone0204 / octave.md
Created November 14, 2016 02:02 — forked from obstschale/octave.md
An Octave introduction cheat sheet.

Octave CheatSheet

GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)

Basics

  • not equal ~=
  • logical AND &amp;&amp;
@abalone0204
abalone0204 / AWSRegionsAndAZs.md
Created November 21, 2016 18:01
List of AWS availability zones for each AWS region
AWS region code AWS region name Number of AZs AZ names
us-east-1 Virginia 4 us-east-1a, us-east-1b, us-east-1c, us-east-1e
us-west-1 N. California 2 us-west-1a, us-west-1b
us-west-2 Oregon 3 us-west-2a, us-west-2b, us-west-2c
eu-west-1 Ireland 3 eu-west-1a, eu-west-1b, eu-west-1c
eu-central-1 Frankfurt 2 eu-central-1a, eu-central-1b
ap-southeast-1 Singapore 2 ap-southeast-1a, ap-southeast-1b
ap-southeast-2 Sydney 2 ap-southeast-2a, ap-southeast-2b, ap-southeast-2c
ap-northeast-1 Tokyo 2 ap-northeast-1a, ap-nort