Skip to content

Instantly share code, notes, and snippets.

View vestige's full-sized avatar

Makoto Yonezawa vestige

View GitHub Profile
@vestige
vestige / co2.ino
Created May 23, 2020 02:59 — forked from seki/co2.ino
M5Stack + MH-Z14 CO2 censor
#include <M5Stack.h>
#define NBIN 30
static int16_t s_ring[NBIN];
static int s_curr;
static int16_t s_bg;
static int s_delay = 20000;
static unsigned long s_tm;
void setup() {
@vestige
vestige / NumPlace.rb
Created December 11, 2019 08:54 — forked from Saku35/NumPlace.rb
ナンプレを解くプログラム
def readfile( fn )
fp = open( fn )
str = ""
fp.each_line.map { |ln|
ln.split(",").map { |n| n.to_i }
}
end
def solveNumPlace(problem, stack)
memory = {candidate: [], row: 0, col: 0, problem: []}
@vestige
vestige / kaigi.md
Last active November 19, 2017 12:14 — forked from tkojitu/kaigi.md

とちぎRuby会議07のレポート

書いた人

gdgdiler@toRuby

はじめに

  • 日時 :2017/08/26(土) 11:00 ~ 20:00
  • 会場 : 那須野が原ハーモニーホール
  • 主催 : とちぎRubyの会(toRuby)
@vestige
vestige / erblock.rb
Created January 7, 2013 14:38 — forked from seki/erblock.rb
require 'erb'
class MyERB < ERB
class CompilerWithBlock < ERB::Compiler
def add_put_cmd(out, content)
out.push("#{@put_cmd} #{content_dump(content)}")
end
BLOCK_EXPR = /\s+(do|\{)(\s*\|[^|]*\|)?\s*\Z/
def add_insert_cmd(out, content)
class Maze
def initialize(w,h,input)
@len_map = Hash.new
@len_map[[w-1,h-1]] = 1
make_fence(input)
end
def make_fence(input)
lr, tb = [], []
input.each_with_index do |e,i|
@vestige
vestige / timer.rb
Created November 5, 2011 15:39 — forked from Watson1978/timer.rb
MacRuby : Sample of NSTimer
# -*- coding: utf-8 -*-
framework "Cocoa"
class AppDelegate
def initialize
# NSTimer の初期化
@timer = NSTimer.scheduledTimerWithTimeInterval(1.0,
target:self,
selector:"output:",
userInfo:nil,