Skip to content

Instantly share code, notes, and snippets.

View tmitz's full-sized avatar

tmitz tmitz

View GitHub Profile
@tmitz
tmitz / createStatementData.js
Created December 4, 2018 08:49
Refactoring
export default function createStatementData(invoice, plays) {
const result = {};
result.customer = invoice.customer;
result.performances = invoice.performances.map(enrichPerformance);
result.totalAmount = totalAmount(result);
result.totalVolumeCredits = totalVolumeCredits(result);
return result;
function enrichPerformance(aPerformance) {
const calculator = createPerformanceCaluculator(aPerformance, playFor(aPerformance));
Hello World!
@tmitz
tmitz / index.html
Created March 28, 2017 09:13
Image gallery // source http://jsbin.com/hiyajog
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Image gallery</title>
<style id="jsbin-css">
h1 {
font-family: helvetica, arial, sans-serif;
text-align: center;
@tmitz
tmitz / gocrawl.go
Created December 15, 2016 03:15
gocrawl sample
package main
import (
"fmt"
"net/http"
"regexp"
"time"
"github.com/PuerkitoBio/gocrawl"
"github.com/PuerkitoBio/goquery"
@tmitz
tmitz / PULL_REQUEST_TEMPLATE.md
Created September 16, 2016 05:03
Pull Request Template Sample

概要

  • 課題についての説明、何がどう解決されるのか
  • このPRでやりたいこと

レビュワーに見てほしいところ

  • 重点的にレビューして欲しいところをリストアップする
  • 複雑なロジックであれば補足説明も書く
@tmitz
tmitz / effectivego_webserver.go
Last active August 18, 2016 06:19
Effective GoのWebServerをhtml/templateで http://golang.jp/effective_go#web_server
package main
import (
"flag"
"html/template"
"log"
"net/http"
)
const (
@tmitz
tmitz / ios8yahoo.md
Created November 2, 2014 04:55
ios8yahoo

iOS8yahoo

XCode6

  • kazocの中の人
  • debug view hierlcey
  • IBライブレンダリング
  • 非同期API
  • XCTestExpection

ヤフオク

| Left align | Right align | Center align |
|:-----------|------------:|:------------:|
| This | This | This |
| column | column | column |
| will | will | will |
| be | be | be |
| left | right | center |
| aligned | aligned | aligned |
#!/usr/bin/env python2
# vim: set fileencoding=utf8
import re, sys, os, random, time, json, logging, argparse, requests, urllib
from mutagen.id3 import ID3,TRCK,TIT2,TALB,TPE1,APIC,TDRC,COMM,TPOS,USLT
from HTMLParser import HTMLParser
parser = HTMLParser()
s = u'\x1b[1;%dm%s\x1b[0m' # terminual color template
my $regex = qr/
\A
(
[a-z][a-z0-9+\-.]*:
(
\/\/
([a-z0-9\-._~%!$&'()*+,;=]+@)?
([a-z0-9\-._~%]+
|\[[a-f0-9:.]+\]
|\[v[a-f0-9][a-z0-9\-._~%!$&'()*+,;=:]+\])