Skip to content

Instantly share code, notes, and snippets.

View yuiseki's full-sized avatar
🍻
I want to drink

yuiseki yuiseki

🍻
I want to drink
View GitHub Profile
import json
from jsonschema import ValidationError, exceptions
from jsonschema.validators import Draft3Validator
from functools import wraps
from flask import _request_ctx_stack, request, jsonify
def _validate(schema, data):
reqv = Draft3Validator(schema)
@yuiseki
yuiseki / build.sh
Created February 25, 2015 09:02
XCodeでipaの出力がうまく行かない時に、最新っぽいarchivesからipaを無理やり生成するスクリプト
ipa_base="debug"
ipa_ext=".ipa"
profile="iOSTeam Provisioning Profile: *"
archives="/Users/$USER/Library/Developer/Xcode/Archives/"
newest_dir=`ls -lt $archives|head -n 2|tail -n 1|cut -f 13- -d " "`
echo $newest_dir
newest_ipa=`ls -lt $archives$newest_dir|head -n 2|tail -n 1|cut -f 13- -d " "`
@yuiseki
yuiseki / gist:45416
Created January 10, 2009 08:37 — forked from nagayama/gist:2108
(^o^)/owata
@yuiseki
yuiseki / gist:114866
Created May 20, 2009 15:17
rubyでArduinoのシリアルポートを叩く
require 'rubygems'
require 'serialport'
sp = SerialPort.new("COM6", 9600, 8, 1, SerialPort::NONE)
command = ["0D"]
sp.write(command.pack("H*"))
sp.read
sp.read
loop {
#define R 5
#define G 6
#define B 7
#define S 2
#define WAIT 500
int inByte = 0;
int inSwitch;
bool r, g, b, blink, off;
@yuiseki
yuiseki / gist:114868
Created May 20, 2009 15:18
Arduinoをシリアルデバイスにする。Analog0に光センサーを接続
int analogValue = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
analogValue = analogRead(0)/4;
Serial.println(analogValue, DEC);
delay(100);
}
require "rubygems"
gem "activeresource"
require "active_resource"
require "serialport"
class State < ActiveResource::Base
self.site = 'http://cyberia.yuiseki.net/'
end
#5秒おきにRailsに問い合わせて出力する
   _,,....,,_  _人人人人人人人人人人人人人人人_
-''":::::::::::::`''>  ゆっくりした結果がこれかよ!!! <
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
 |::::::;ノ´ ̄\:::::::::::\_,. -‐ァ     __   _____   ______
 |::::ノ   ヽ、ヽr-r'"´  (.__    ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、
_,.!イ_  _,.ヘーァ'二ハ二ヽ、へ,_7   'r ´          ヽ、ン、
::::::rー''7コ-‐'"´    ;  ', `ヽ/`7 ,'==─-      -─==', i
r-'ァ'"´/  /! ハ  ハ  !  iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i |
!イ´ ,' | /__,.!/ V 、!__ハ  ,' ,ゝ レリイi (ヒ_]     ヒ_ン ).| .|、i .||
`!  !/レi' (ヒ_]     ヒ_ン レ'i ノ   !Y!""  ,___,   "" 「 !ノ i |
@yuiseki
yuiseki / school.rb
Created November 26, 2009 19:12 — forked from oquno/school.rb
#!/usr/local/bin/ruby -Ks
# _*_ coding: utf-8 _*_
require 'rubygems'
require 'mechanize'
require 'time'
MAIL = 'mixi_login_mail_address'
PASS = 'mixi_login_pass'
DIRECTORY = 'log_directory_path'
require 'rubygems'
require 'sinatra'
require 'tokyotyrant'
include TokyoTyrant
helpers do
def get_recents()
rdb = RDBTBL::new
rdb.open('localhost', 1978)
qry = RDBQRY::new(rdb)