Skip to content

Instantly share code, notes, and snippets.

View aycabta's full-sized avatar
💭
🏴‍☠️

aycabta aycabta

💭
🏴‍☠️
  • Space Pirates, LLC.
View GitHub Profile
class IO
def readline_nonblock(length)
eoferror = nil
begin
data = read_nonblock(length)
rescue Errno::EAGAIN, Errno::EWOULDBLOCK => e
rescue EOFError => e
eoferror = e
end
if not data.nil?
@aycabta
aycabta / Gemfile
Last active August 29, 2015 13:57
Embedded Niconico Player API "thumb_watch" to JSONP
source :rubygems
gem 'sinatra'
gem 'thin'
@aycabta
aycabta / fgh3tex.rb
Last active August 29, 2015 14:02
Transcribes FGH f_3(n) to TeX
def oh_great(n)
if n == 1
"2^n n"
else
prev = oh_great(n - 1)
"2^{#{prev}} {#{prev}}"
end
end
def output(n)
@aycabta
aycabta / MathJax.html
Last active August 29, 2015 14:02
Very Simple MathJax Page
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>simple MathJax</title>
<script type="text/x-mathjax-config;executed=true">
MathJax.Hub.Config({
tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
});
@aycabta
aycabta / README.md
Last active August 29, 2015 14:03
PulseAudio formula for Mavericks

PulseAudio formula for Mavericks

Usage

  • $ sudo cp pulseaudio.rb /usr/local/Library/Formula/pulseaudio.rb
  • $ brew install pulseaudio
@aycabta
aycabta / simhydra.bas
Last active August 29, 2015 14:05
Simple Hydra
dim A(∞)
B=9
for C=0 to 9
for D=0 to B
A(D)=D
next
for E=B to 0 step -1
B=B*B
for F=0 to E
if A(E-F)<A(E) or A(E)=0 then
dim A(∞)
B = 2
for D = 0 to B
A(D) = D
next
for E = B to 0 step -1
for F = 0 to E
if A(E-F) < A(E) or A(E) = 0 then
G=F
F=E
🁙
🁘
🁐
🁆
🀲
🁫
🂌
🂓
🁜
🀺
// ==UserScript==
// @name comico header drop off
// @namespace http://www.comico.jp/detail.nhn?titleNo=47
// @version 0.1.1
// @description hi
// @include /^https?://www.comico.jp/
// @copyright 2014+, You
// ==/UserScript==
(function() {
#!/usr/bin/env ruby
require 'optparse'
run_interval_milli_second = 1000
opt = OptionParser.new
opt.on('-i VAL') { |v| run_interval_milli_second = v.to_i }
opt.parse!(ARGV)