Skip to content

Instantly share code, notes, and snippets.

@sekky0905
sekky0905 / file0.txt
Created February 14, 2017 14:56
TypeScript + webpack + Karma + Mocha + Power Assertでテストを行う際の諸々の設定ファイル ref: http://qiita.com/Sekky0905/items/e54c7fc124c3f2b6d152
{
// パッケージの名前
"name": "パッケージ名",
// パッケージのバージョン
"version": "1.0.0",
// パッケージの説明
"description": "パッケージの説明文",
// 項目はパッケージの中で最初に呼ばれるモジュールのID
"main": "./dist/hoge.js",
// scriptコマンド
@sekky0905
sekky0905 / main.go
Created February 21, 2017 07:45
GAE/Go Datastore manipulation
package tictactoego
import (
"fmt"
"net/http"
"time"
"google.golang.org/appengine"
"google.golang.org/appengine/datastore"
"html/template"
"google.golang.org/appengine/taskqueue"
import "fmt"
type Language struct {
Name string
LangType string
}
// コンストラクタ
// 戻り値として返すのは、構造体のポイントであることに注意
func NewLanguage(name string, langType string) *Language {
@sekky0905
sekky0905 / file0.txt
Last active February 23, 2017 13:49
Go言語のTemplateパッケージを使い作成したHTMLテンプレートでCSS等の静的ファイルをリンクさせる時の注意 ref: http://qiita.com/Sekky0905/items/fca9d9118ef23bf24791
sample
|_resources <-以下に各種類別静的ファイル(今回はcssのみ)
| |_css
|_view
| |_index.html(テンプレート)
|_main.go
@sekky0905
sekky0905 / file0.go
Last active February 25, 2017 15:47
【Go言語】GAE/Goでuser APIを使ってユーザー認証 ref: http://qiita.com/Sekky0905/items/41068fc50184e20f9d6e
package main
import (
"net/http"
"google.golang.org/appengine"
"google.golang.org/appengine/user"
"html/template"
"fmt"
)
@sekky0905
sekky0905 / file0.txt
Last active March 4, 2017 13:22
Go言語とTypeScript(JavaScript)でライブラリなしでAjaxなコードをXMLHttpRequestオブジェクトを使って書いてみた ref: http://qiita.com/Sekky0905/items/07affe9e68744eba6c89
apprppt
|_source
| |_index.js
| |_index.ts
| |_package.json
| |_tsconfig.json
|_view
| |_index.html
|_main.go
@sekky0905
sekky0905 / file0.js
Last active July 14, 2017 02:27
TypeScript(JavaScript)でアロー関数で即時関数でFizzBuzz! ref: http://qiita.com/Sekky0905/items/e5523901205e7ccd20ef
(() => {
for (let i = 1; i < 101; i++) {
if (i % 15 === 0) {
console.log('Fizz Buzz!');
} else if (i % 3 === 0) {
console.log('Fizz!');
} else if (i % 5 === 0) {
console.log('Buzz!');
} else {
console.log(i);
@sekky0905
sekky0905 / file0.go
Last active February 26, 2017 11:48
Go言語でFizzBuzz!を書いてみた ref: http://qiita.com/Sekky0905/items/9a5a459e143303cd0a18
package main
import (
"fmt"
)
func main() {
i := 1
for i < 101 {
@sekky0905
sekky0905 / cookie.html
Last active March 20, 2017 03:59
Go言語でCookieを操作する(設定と取得) ref: http://qiita.com/Sekky0905/items/f4cad4cacf5872df001e
@sekky0905
sekky0905 / file0.txt
Last active May 25, 2018 14:58
GoのTemplateのPipelines(パイプライン)を理解しながら、テンプレート内で関数にスライスを引数で渡してみる ref: https://qiita.com/Sekky0905/items/fdbbad75d52e8336a6aa
a | b