Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@tobynet
tobynet / novel-plot-ジャバ2.md
Last active August 29, 2015 14:09
「ジャバ2」「ジャバ3」のプロット

[ジャバ2], [ジャバ3] のプロット

「ジャバ n」シリーズの位置づけ

「[あなたとジャバ]」の外伝的位置づけ。

主人公は、二億円が欲しいがために様々なトラブルに巻き込まれる。

function doPost(request) {
var subject;
var calendarName = 'gas_review';
if (request) {
subject = request.parameters.text[0].replace(/done: */, '');
} else {
subject = 'test subject';
}
@esehara
esehara / sicp-173.markdown
Last active August 29, 2015 14:13
SICP財団(元ネタはSCP: http://ja.scp-wiki.net/scp-series)

SICP-173 - 副作用性機械理論

アイテム

SICP-173

オブジェクトクラス

Euclid

const double THRESHOLD = 64.0; // +2
// http://makers-with-myson.blog.so-net.ne.jp/2014-04-05
unsigned int on[] = {2552,2680,824,860,820, 860,824,1892,852,1868,824,1896,824,1892,828, 856,828, 856,848,53728,2552,2672,828,860,824, 856,824,1896,852,1864,824,1896,824,1896,852, 828,828, 856,828,53840,2560,2672,828,856,848, 836,824,1892,824,1892,828,1892,852,1868,852, 832,848, 832,828};
unsigned int off[] = {2552,2676,852,832,824,1896,848, 832,828, 856,828,1892,824, 856,852,1868,824,1892,852,53944,2556,2676,824,860,820,1896,828, 856,828, 852,848,1872,824, 856,828,1896,824,1892,824,53844,2552,2676,852,832,824,1896,848, 836,824, 856,828,1892,824, 860,820,1896,828,1888,848};
void setup() {
Serial.begin(115200);
pinMode(12, OUTPUT);
analogReference(INTERNAL);
@esehara
esehara / novel.rb
Last active August 29, 2015 14:14
実行可能小説
class String
def to_hash
{:as => self}
end
end
def method_missing(name, *args)
name.to_s + (args.join(""))
end
#! /usr/bin/ruby
# -*- coding: utf-8 -*-
# マルコフ連鎖をしてみるやつ
$KCODE = 'UTF8'
# Array::choiseを追加
class Array
def choise
self[rand(self.size)]
@fuba
fuba / exthtml.pl
Created December 26, 2008 09:14
exthtml.pl extracts contents specified by an xpath from web pages. Cookbook in Japanese: http://fuba.jottit.com/exthtml
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use Getopt::Long;
use URI;
use LWP::UserAgent;
use HTTP::Cookies::Guess;
sub capture_thumbnails {
my %opt = @_;
my $file = $opt{file} or die;
my $offset = $opt{offset} || 0;
my @stats = stat($file);
my $deflength = 60 * ($stats[7]/120000000);
my $un_reset = $opt{un_reset};
@toreriklinnerud
toreriklinnerud / autospork.rb
Created October 14, 2009 22:08
Start spork before autospec if not already running
#!/usr/bin/env ruby
`ps | grep /spork$ | grep -v grep`
if $?.success?
exec('autospec')
else
IO.popen('(spork&) 2>&1') do |messages|
puts(message = messages.gets) until message =~ /ready/
exec('autospec')
@eban
eban / ruby-1.8.7-p248-cygwin-1.7.1.patch
Created December 25, 2009 10:44
ruby-1.8.7-p248 cygwin 1.7.1 quick hack
--- eval.c.orig 2009-12-21 17:11:42.000000000 +0900
+++ eval.c 2009-12-24 19:18:21.671875000 +0900
@@ -210,3 +210,3 @@
# ifdef __CYGWIN__
-int _setjmp(), _longjmp();
+int _setjmp(); void _longjmp();
# endif
--- gc.c.orig 2009-12-24 17:28:08.000000000 +0900
+++ gc.c 2009-12-24 19:18:17.875000000 +0900
@@ -42,3 +42,3 @@