Skip to content

Instantly share code, notes, and snippets.

Edward Kim haruair

Block or report user

Report or block haruair

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
haruair / event-sourcing-pattern-in-js-1.js
Last active Feb 25, 2019
Event Sourcing Pattern in JS
View event-sourcing-pattern-in-js-1.js
class AggregateRoot {
apply(event) {
return this
handle(event) {
var eventName =
var eventMethod = `apply${eventName}`
haruair /
Created Dec 5, 2016
Git Client-side pre-commit hook for SwiftLint
# hook script for swiftlint. It will triggered when you make a commit.
# If you want to use, type commands in your console.
# $ ln -s ../../ .git/hooks/pre-commit
# $ chmod +x .git/hooks/pre-commit
LINT=$(which swiftlint)
haruair / gist:b8ff4fb128488f5e1dbf
Last active May 6, 2018
How to get all category tree node in Magento
View gist:b8ff4fb128488f5e1dbf
// Usually, you can get category tree from category helper
$helper = Mage::helper('catalog/category');
$nodes = $helper->getStoreCategories();
// return Varien_Data_Tree_Node_Collection
// via Mage_Catalog_Model_Resource_Category
// However, this get method return active category only.
// Most of the samples are for collection of the category.
View dm.js
var OldTrigger = $.fn.trigger;
$.fn.trigger = function () {
if (arguments[0] === 'dmp_AD_FETCHER_RESPONDED') {
return OldTrigger.apply(this, arguments);
View gist:5a6e43fd6ca1da5ed9a8d51e7b400835
mkdir helloworld && cd helloworld
echo "# HelloWorld" >
dotnet new sln -n HelloWorld
mkdir src test
dotnet new angular --output src/HelloWorld.WebApp --name HelloWorld.WebApp
dotnet new xunit --output test/HelloWorld.WebApp.Tests --name HelloWorld.WebApp.Tests
cd test/HelloWorld.WebApp.Tests
haruair / fwp-bulk-zap.php
Created Apr 8, 2016
FeedWordPress Bulk Zap Action
View fwp-bulk-zap.php
Plugin Name: FeedWordPress Bulk Zap
Plugin URI:
Description: Code snipet for bulk zap of FeedWordPress
Version: 0.1
Author: Haruair
Author URI:
License: GPL v2
haruair / es.js
Created Aug 31, 2017
event sourcing js practice code
View es.js
function generatedId() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
class LocalStorageEventStore {
getStorage() {
var raw = window.localStorage.getItem('event-store')
var data = JSON.parse(raw) || []
View chicken.php
interface FoodInterface
class FriedChicken implements FoodInterface
public function getName()
return self::class;
haruair / DI.php
Last active Apr 20, 2017
small DI classes
View DI.php
namespace Wattle\DI;
use ReflectionClass;
use Exception;
use Closure;
* Scope Implementation.
View .tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
set -g prefix ^b
setw -g xterm-keys on
set -g default-terminal "screen-256color"
# Automatically set window title
set-window-option -g automatic-rename on
You can’t perform that action at this time.