Skip to content

Instantly share code, notes, and snippets.

View hatone's full-sized avatar
🦋
Think deep, work hard.

Takako Ohshima hatone

🦋
Think deep, work hard.
View GitHub Profile
@hatone
hatone / recv_weight.ino
Created September 19, 2017 03:25
recv_weight.ino
#define RECV_PIN 5
#define TIMEOUT_US 30000
#define DETECT_INTERVAL_MS 10000
int recv_data(uint32_t *data) {
int count = 0;
while (true) {
unsigned long pulse = pulseIn(RECV_PIN, HIGH, TIMEOUT_US);
if (pulse == 0){
break;
@hatone
hatone / test.java
Created November 12, 2016 02:57
Word Count Engine
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class Main {
@hatone
hatone / gist:8fa109b00189ff213231
Last active December 6, 2015 04:23
brew cask
brew cask install google-chrome
brew cask install iterm2
brew cask install skype
brew cask install todoist
brew cask install sequel-pro
brew cask install sublime-text
brew cask install intellij-idea
brew cask install alfred
brew cask install 1password
brew cask install cinch
#include <Wire.h>
#define MPU6050_ACCEL_XOUT_H 0x3B // R
#define MPU6050_WHO_AM_I 0x75 // R
#define MPU6050_PWR_MGMT_1 0x6B // R/W
#define MPU6050_I2C_ADDRESS 0x68
typedef union accel_t_gyro_union{
struct{
uint8_t x_accel_h;
@hatone
hatone / gist:9187637
Last active August 29, 2015 13:56
あれに何かを書き込むための何か
var str0 = '{"id":0,"name":"GMT","difference":0}';
var str1 = '{"id":1,"name":"JST","difference":9}';
var str2 = '{"id":2,"name":"PST","difference":-8}';
timezones = new Array(JSON.parse(str1), JSON.parse(str2), JSON.parse(str0));
localStorage.setItem("currentTimezone",JSON.stringify(timezones[0]));
localStorage.setItem("myTimezone",JSON.stringify(timezones));
@hatone
hatone / BoundingBox.java
Created February 7, 2014 01:30
SRM607 DIV2 250
public class BoundingBox {
public int smallestArea(int[] X, int[] Y) {
return getl(X)*getl(Y);
}
private int getl(int[] N) {
int max = -100;
int min = 100;
「Fluentd & Treasure Data でこっそり始めるログ集計」
CROOZ 株式会社
池田 朋大( @mikeda )
FluentdとTreasureDataプラットフォームを使って、1インフラエンジニアが勢いでログ集計システムを作ってみたお話です
---
■発表の人
インフラエンジニア
fluentd 歴3ヶ月
@hatone
hatone / cyclone版
Created July 29, 2012 04:20
echo serverとか。
import cyclone.web
class MainHandler(cyclone.web.RequestHandler):
def get(self):
self.write("hello, world")
Application = lambda: cyclone.web.Application([(r"/", MainHandler)])
@hatone
hatone / gist:2816540
Created May 28, 2012 00:36
ajax.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
//write here
$(function() {
$("input#search").click( function() {
var searchId = $("input#input_id").val();
@hatone
hatone / Diamond.java
Created April 26, 2012 05:58
forループまわり
public class Diamond {
public static void main (String[] args) {
for (int j = 0; j < 8; j++) {
for (int i = 7; i-j>0; i-- ) {
System.out.print(" ");
}
for (int i = 1; i<j*2; i++){
System.out.print("*");