Skip to content

Instantly share code, notes, and snippets.

/* AWS S3 の使い方 */
public fun testAWS() {
val accessKey = myActivity?.getString(R.string.aws_access_key)
val secretKey = myActivity?.getString(R.string.aws_secret_key)
val bucketName = "doya"
val s3Client = AmazonS3Client( BasicAWSCredentials(accessKey, secretKey) )
s3Client.setRegion(Region.getRegion(Regions.AP_NORTHEAST_1))
val buckets = s3Client.listBuckets()
assertNotNull(buckets)
assertTrue( buckets!!.size > 0 )
package main
import (
"runtime"
"fmt"
"math/rand"
"time"
)
func main() {
@dictav
dictav / licenses_sample.md
Created October 28, 2014 02:35
Licenses sample

Notices and licenses

Notices

messagepack-java

License

Apache License, Version 2.0

Notice

@dictav
dictav / benchmark_buffer.go
Last active August 29, 2015 14:08
benchmark for writing to buffer
package buffer_benchmark
import (
"bufio"
"bytes"
"testing"
)
const hoge = "hogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehoge"
@dictav
dictav / Logger.swift
Created December 18, 2014 18:19
Logger for Swift
//
// Logger.swift
//
// The MIT License (MIT)
//
// Copyright (c) 2014 dictav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
private var controller: UIViewController?
func setController<T:UIViewController where T:UITableViewDataSource>(c: T) {
controller = c
}
// https://gist.github.com/norio-nomura/090e0085a61ca2693e93
// 面白かったので写経。call は除いてみた
import Foundation
typealias Band = [String:String]
var bands: [Band] = [
["name": "sunset rubdown", "country": "UK", "active": "false"],
["name": "women", "country": "Germany", "active": "false"],
["name": "a silver mt. zion", "country": "Spain", "active": "true"]
typealias TwoEquatables = (Equatable, Equatable)
func == (lhs: TwoEquatables, rhs: TwoEquatables) -> Bool {
let t1 = _reflect(lhs.0)
let t2 = _reflect(rhs.0)
let u1 = _reflect(lhs.1)
let u2 = _reflect(rhs.1)
return t1.valueType == t2.valueType && t1.summary == t2.summary
&& u1.valueType == u2.valueType && u1.summary == u2.summary
}
package main
func main() {
println("Hello, Medium!")
}
var fb = require('dictav-flatbuffers').flatbuffers
var builder = new fb.Builder(0)
// ...