This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
var got []interface{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setupDragAndDrop() { | |
var containerElem = $(window); | |
var targetElem = $('#dnd-target'); | |
var mouseDownStream = Rx.Observable.fromEvent(targetElem, 'mousedown'); | |
var mouseUpStream = Rx.Observable.fromEvent(targetElem, 'mouseup'); | |
var targetStartPos = targetElem.position(); | |
// 終了条件を表すストリーム | |
var terminateDndStream = Rx.Observable.merge( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
type Lat float64 | |
type Lon float64 | |
func f(lat Lat, lon Lon) { | |
} | |
func main() { | |
var lat Lat = 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type Tree interface { | |
Count() int | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB.DocumentClient(); | |
var zlib = require('zlib'); | |
exports.handler = (event, context, callback) => { | |
var params = { | |
TableName: 'dynamodb_table_name', | |
Key: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fmt.Printf("%T\n", 123) // 整数リテラル | |
fmt.Printf("%T\n", 123.0) // 浮動小数リテラル | |
fmt.Printf("%T\n", "文字列") // 文字列リテラル | |
fmt.Printf("%T\n", 'ä') // ルーンリテラル |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* Usage: ./filljson.js valueType <template.json "path.to.target" <(some command) | |
* valueType: [string] string int float | |
*/ | |
var fs = require('fs'); | |
var valueType = process.argv[2] | |
var paths = process.argv[3].split('.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<i class="material-icons" style="vertical-align: bottom;"> | |
{{ .Get 0 }} | |
</i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TMPFILE=/tmp/js-metrics.js | |
REPORT_DIR=/tmp | |
cat - > ${TMPFILE} | |
plato -d ${REPORT_DIR} ${TMPFILE} > /dev/null | |
grep 'class="stat"' ${REPORT_DIR}/index.html | tail -n 1 | sed -e "s/<p class=\"stat\">//g" | sed -e "s/<\/p>//g" | sed -e "s/ //g" | tr -d '\n' |