Skip to content

Instantly share code, notes, and snippets.

@autch
autch / xak_solve.rb
Created January 31, 2012 17:08
Xakに出てくる聖域の一筆書きを解く
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
# Xakに出てくる聖域の一筆書きを解く
# 島と選べる経路の表
#
# 数字は聖域の4つの建物のかたまり(以下「島」)を左→右、上→下と番号付けしたもの。
# そのハッシュの中のキーはその島にある建物のアルファベット、* は紋章
# ハッシュの値は対応する飛び先の建物がある島の番号
# たとえば左上の島の A の建物に入ると、右下の島の A の建物に飛ぶ。これは以下のように表す。
@autch
autch / xak_solve.c
Created February 1, 2012 07:28
gist:1711627 を C で書いてみた
#include <stdio.h> // printf, snprintf
#include <string.h> // strcpy, strncat
struct group
{
struct path
{
char alpha;
int dest;
} path[4];
<!DOCTYPE html>
<html>
<head>
<title>食品の放射能データ検索もどき(実験)</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>
<script type="text/javascript">
@autch
autch / qrenc.jq.html
Created April 9, 2012 04:16
QR code generator, in a HTML file. Using Google Chart API
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">
function setChartImage() {
@autch
autch / 2nni.html
Created April 9, 2012 04:23
2NN (http://2nn.jp/) for iPhone/Android, requires jquery.cookie.js, put it beside this
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="jquery.cookie.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script type="text/javascript">
@autch
autch / get2post.php
Created April 11, 2012 04:18
Converts HTTP GET request to HTTP POST
<?php
$requests = $_GET;
$url = $requests['URL'];
unset($requests['URL']);
$ch = curl_init();
$options = array(
<!DOCTYPE html>
<html>
<head>
<title>食品の放射能データ検索もどき(実験)</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>
<script type="text/javascript">
@autch
autch / gist:2566290
Created May 1, 2012 08:26
mruby を某 SH4 なマイクロサーバ向けにクロスコンパイルするときのパッチ
diff --git a/Makefile b/Makefile
index ec29364..f091c1a 100644
--- a/Makefile
+++ b/Makefile
@@ -2,15 +2,15 @@
# basic build file for mruby
# compiler, linker (gcc)
-CC = gcc
-LL = gcc
@autch
autch / herzog_03.pmml
Created June 14, 2012 10:14
BACK TO SQUARE ONE from Herzog [SHARP X1] -- for P/ECE mucc
#Title Herzog [SHARP X1] - BACK TO SQUARE ONE
#Title2 (c) Tecnosoft, arr: Autch
!!bg @6 V125 ?o4c ; bass drum
!!sg @7 V127 ?o5c ; snare drum 2
!!tg @13 V120 ?o4c ; synth tom (hi)
!!ug @14 V120 ?o4c ; synth tom (mid)
!!vg @15 V120 ?o4c ; synth tom (low)
!!xg @10 V110 ?o5c
@autch
autch / gist:3326452
Created August 11, 2012 19:07
hoot のデータファイルについて、XML と比べてファイル名の不一致を見つけて、リネーム用スクリプトを吐く
#!/usr/bin/ruby
require 'rubygems'
require 'inifile'
require 'nokogiri'
require 'zipruby'
HOOT_INI = "hoot.ini"
ARCHIVES = []
GAMELIST = Hash.new{|h, k| h[k] = [] }