Skip to content

Instantly share code, notes, and snippets.

View tmtk75's full-sized avatar

Tomotaka Sakuma tmtk75

View GitHub Profile
//
// This provides a way to see exit status
//
package main
import (
"fmt"
"os/exec"
"syscall"
)
function test_05_turnUser_disable(params, context, done) {
$.ajax({
type: 'PUT',
url: params['baseURL'] + '/apps/' + context.getAppID()
+ '/users/' + params['userID'] + '/status',
headers: {
'x-kii-appid': context.getAppID(),
'x-kii-appkey':context.getAppKey(),
'authorization': 'bearer ' + params['token']
FROM centos
RUN yum install -y http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
RUN yum install -y golang
RUN yum install -y git
ENV GOPATH /.go
RUN go get -u github.com/armon/consul-kv
RUN go get -u github.com/hashicorp/envconsul
WORKDIR /.go/src/github.com/hashicorp/envconsul
RUN go build
CMD ["cp", "envconsul", "/target"]
package main
type A struct {
Name string
}
type B struct {
A
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
type HttpResponse http.Response
" Basic settings
set number
set nowrap
" Syntax highlighting
syntax enable
set nohlsearch
"set cursorline
" font thickness to be normal
package main
import "fmt"
type Human struct {
Age int
Name string
Walk func(place string)
}
#!/usr/bin/env node
require("node-jquery-xhr");
kii = require("./KiiSDK.js").create();
var appid = "xxxxxxxx",
appkey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
kii.Kii.initializeWithSite(appid, appkey, kii.KiiSite.US);
var username = "qyArFPHZu1",
password = "TcRlGqkzsX";
@tmtk75
tmtk75 / gist:8311840
Created January 8, 2014 04:29
svg to png with inkscape on windows
PATH=$PATH:/Program\ Files/Inkscape
size=${1:-960}
\ls *.svg | head -n1 | while read n; do
inkscape.exe "$n" \
--export-width=$size \
--export-height=$size \
--export-png="${n%.svg}_${size}px.png"
done
@tmtk75
tmtk75 / gist:8293645
Last active January 2, 2016 10:59
List all EC2 running instances filtered with security group id
aws ec2 describe-instances --filter "Name=group-id,Values=sg-d1235xxx" "Name=instance-state-name,Values=running" | jq ".[]|length"