Skip to content

Instantly share code, notes, and snippets.

View mackee's full-sized avatar

mackee mackee

  • KAYAC Inc.
  • Japan
View GitHub Profile
package main
import (
"bytes"
"io"
"log"
"net/http"
)
var broadcastMessages = make(chan []byte)
@mackee
mackee / gist:3d135cee3894afa05682
Last active August 29, 2015 14:02
kuiperbelt broadcast test

1 connection

Running 30s test @ http://kuiperbelt:8080/broadcast
  8 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.72ms    3.60ms  41.18ms   73.30%
    Req/Sec     4.85k   734.00     6.69k    73.54%
  1143522 requests in 30.00s, 146.13MB read
Requests/sec:  38120.60
Transfer/sec:      4.87MB
package main
import (
"encoding/json"
"encoding/xml"
"io"
"log"
"os"
"strings"
)
package main
import (
"encoding/json"
"fmt"
"github.com/ziutek/mymysql/mysql"
_ "github.com/ziutek/mymysql/native"
"io"
"log"
"os"
@mackee
mackee / gist:c3c580d61da9ce847411
Created July 5, 2014 04:01
初めてのArduino ワークショップ#00

初めてのArduino

ワークショップ #00 2014-07-05


注意事項

  • 今回はガイアックス様の会議室を使ってやっています
  • 飲食は自由です
  • 寒い等あったら言ってください
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
}
char data;
int f = 0;
void loop() {
if (Serial.available() > 0) {
data = Serial.read();
package kuiperbelt
import (
"log"
"sync"
)
type BroadcastNotifier struct {
notifyChan chan bool
notifyingChan chan bool
my @input_numbers = (1, 2, 4, 8, 16, 32, 64);
my @result = map {
my @digits = split //,$_; # $_を文字列として1文字ずつに分解する => 桁ごとに分解
if ($digits[-1] == 4) { # 一番最期の桁(=1の位)の桁がもし4であれば
@digits; #すべての桁をリストとして返す
} else { #そうでなければ
(); # なにも返さない
}
} @input_numbers;
@mackee
mackee / app.psgi
Last active August 29, 2015 14:10
sampleapp
use strict;
use warnings;
use utf8;
use File::Spec;
use File::Basename;
use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5');
use lib File::Spec->catdir(dirname(__FILE__), 'lib');
use Amon2::Lite;
our $VERSION = '0.12';
@mackee
mackee / commands.go
Last active August 29, 2015 14:10
takashi command
package main
import (
"fmt"
"github.com/codegangsta/cli"
"log"
"net/http"
"os"
"time"
)