Skip to content

Instantly share code, notes, and snippets.

🐾
にゃ〜ん

あろえりーな aloerina01

🐾
にゃ〜ん
Block or report user

Report or block aloerina01

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
@aloerina01
aloerina01 / Immutable.js
Last active Apr 27, 2017
Immutable Object pattern with JS Module
View Immutable.js
class Immutable {
constructor(val) {
this._val = val;
}
get val() {
return this._val;
}
}
function of(val) {
@aloerina01
aloerina01 / Singleton.js
Last active Apr 27, 2017
Singleton pattern with JS Module
View Singleton.js
class Singleton {
constructor() {
this.init();
}
init() {
// fetch values
this._showHeader = true;
this._pattern = 101;
}
get isShowHeader() {
View keybindings.json
[{
"key": "alt+left",
"command": "workbench.action.navigateBack"
},{
"key": "alt+right",
"command": "workbench.action.navigateForward"
}
]
@aloerina01
aloerina01 / Config.js
Created Mar 14, 2017
ES6 Proxy - 実用例ModuleBuilderでSingletonクラスをつくる
View Config.js
import ModuleBuilder, { Handlers } from './ModuleBuilder';
/**
* Module
*/
class Config {
constructor() {
this._fetchConfig((result) => {
this._accountId = result.accountId;
this._name = result.name;
@aloerina01
aloerina01 / Datetime.js
Last active Mar 14, 2017
ES6 Proxy - 実用例ModuleBuilderでImmutableクラスをつくる
View Datetime.js
import ModuleBuilder, { Handlers } from './ModuleBuilder';
/**
* Module
*/
class Datetime {
constructor(datetimeString) {
this._source = datetimeString;
this._datetime = this.to(datetimeString);
}
@aloerina01
aloerina01 / ModuleBuilder.js
Last active Mar 14, 2017
ES6 Proxy - 実用例ModuleBuilder
View ModuleBuilder.js
export default class {
constructor() {
this._moduleClass = {};
this._handler = {};
}
class(moduleClass) {
this._moduleClass = moduleClass;
return this;
}
handler(handler) {
@aloerina01
aloerina01 / SampleModule.js
Last active Mar 12, 2017
ES6 Proxy - ProxyModule
View SampleModule.js
class SampleModule {
constructor() {
this._a = 'private';
this.a = 'public';
}
}
const handler = {
construct(target, args) {
return new Proxy(Reflect.construct(target, args), handler);
@aloerina01
aloerina01 / EnumBuilder.js
Last active Mar 14, 2017
ES6 Proxy - EnumBuilder
View EnumBuilder.js
export default class {
constructor() {
this._obj;
}
object(obj) {
this._obj = obj;
return this;
}
keyValuePair(key, value) {
if (!this._obj) {
@aloerina01
aloerina01 / Index.vue
Created Mar 8, 2017
Vueの単一ファイルコンポーネントは実は分けられる
View Index.vue
<template src="./_index.html"></template>
<script>
// ...
</script>
@aloerina01
aloerina01 / package.json
Last active Feb 22, 2017
NODE_ENVを見て読み込むファイルを切り替える方法
View package.json
{
"scripts": {
"production": "NODE_ENV=production webpack",
"build": "NODE_ENV=development webpack"
}
}
You can’t perform that action at this time.