Skip to content

Instantly share code, notes, and snippets.

View 178inaba's full-sized avatar
🤔
hello, world

Masahiro Furudate 178inaba

🤔
hello, world
View GitHub Profile
@178inaba
178inaba / RedisLoop.java
Last active August 28, 2015 06:40
use jedis 2.4.2 and playframework 2.4
JedisPool pool = new JedisPool(new JedisPoolConfig(), "localhost");
for (int i = 0; i < 50000; i++) {
Jedis redis = null;
try {
redis = pool.getResource();
redis.set("key-" + i, "value-" + i);
Logger.debug("get " + redis.get("key-" + i));
} finally {
if (redis != null) {
@178inaba
178inaba / github_repos.go
Created August 30, 2015 07:18
json of github repositories made with go
package main
import (
"encoding/json"
"fmt"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
@178inaba
178inaba / github_oauth2_client.go
Last active August 31, 2015 01:32
github oauth2 use http client, made with go.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os/exec"
@178inaba
178inaba / github_oauth2_package.go
Created August 31, 2015 02:07
github oauth2 use github package, made with go.
package main
import (
"encoding/json"
"fmt"
"log"
"os/exec"
"golang.org/x/oauth2"
@178inaba
178inaba / nginx.conf
Created August 31, 2015 04:11
nginx use try_files(/ -> /index.html, /baz -> /baz.html)
location / {
root /foo/bar;
index index.html index.htm;
try_files $uri $uri/ $uri.html =404;
}
@178inaba
178inaba / tmp_file.go
Created September 20, 2015 11:28
tmp file from go
package main
import (
"fmt"
"io/ioutil"
"os"
)
func main() {
fmt.Println(os.TempDir())
@178inaba
178inaba / nginx.conf
Created September 29, 2015 10:40
exclude some directory in basic authentication of nginx.
server {
location / {
satisfy any;
allow all;
}
}
@178inaba
178inaba / world_start.go
Last active October 22, 2015 08:48
0000-01-01 00:00:00 +0000 UTC from unix time
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println(time.Unix(-62167219200, 0))
}
@178inaba
178inaba / prog.go
Created October 30, 2015 06:15
progress bar ...
package main
import (
"fmt"
"time"
)
func main() {
prog := ""
@178inaba
178inaba / TableViewLoop.swift
Last active November 11, 2015 08:26
table view display update of the loop
//
// ViewController.swift
// SwiftCollatz
//
// Created by 178inaba on 2015/10/18.
// Copyright © 2015年 178inaba. All rights reserved.
//
import UIKit