Skip to content

Instantly share code, notes, and snippets.

View sota1235's full-sized avatar
🤟
software engineer

Sota Sugiura sota1235

🤟
software engineer
View GitHub Profile
@sota1235
sota1235 / simple-di-container.js
Last active June 24, 2017 16:14
Simple DI Container with flow
/**
* @flow
* @fileoverview Container for getting instance.
*/
type InstanceInfo = {
strict: boolean,
closuer: Function,
};
type RegistedInstance = {
@sota1235
sota1235 / main.php
Created December 24, 2016 06:27
PHP validater for ISO8061 and more.
<?php
echo 'test';
{
"id": 1235,
"name": "Sota Sugiura",
"age": 24,
"_links": {
"self": {
"href": "/user/sota1235"
},
"friendlist": {
"href": "/user/sota1235/friends"
@sota1235
sota1235 / hoge.js
Last active November 17, 2016 10:40
import proxyquire from 'proxyquire';
import Button from 'lib/button';
const Button = require('lib/button');
const MockButton = proxyquire('lib/button', {
'lib/functions/browser-dependencies': {
windowLocationHref: 'mock href',
},
}).default;
hoge
module.exports = (robot) ->
# hubot hogeコマンドに反応する
robot.respond /^hoge$/i, (msg) ->
msg.send 'hoge' # hubotに喋らせる
# 全発言の中から正規表現にマッチしたものに反応する
robot.hear /^(.+)$/, (msg) ->
msg.send 'fuga'
# 'hoge'というkey nameで'fuga'を保存
<?php
// validation for date format according with ISO8061
$date = '2016-09-30T12:00:00+900';
preg_match(
'/^\d{1,4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](Z|(\+|-)([01][0-9]|2[0-4]):?([0-5][0-9])?)$/'
$date
);
class Hoge {
constructor() {
this.text = 'text';
this.b = this.b.bind(this);
}
a() {
return new Promise(resolve => resolve(this.text));
}

emojiコミット

個人的にやってみる

:sparkles: - 新規追加

✏️ :pencil2: - ドキュメント修正

🐛 :bug: - バグ修正

package main
import (
"fmt"
)
func main() {
fmt.Println("hoge")
defer fmt.Println("moge")
sub()