Skip to content

Instantly share code, notes, and snippets.

Avatar

Toshiyuki Masui masui

View GitHub Profile
View slide.md

Web時代のユーザインタフェース研究

@masui
masui / swap()
Created Jan 29, 2014
一時変数を使わず変数の内容を交換する
View swap()
#define swap(a,b) (a = a ^ b; b = a ^ b; a = a ^ b;)
@masui
masui / gist:8268798
Created Jan 5, 2014
予定表アクセスするCGIスクリプト
View gist:8268798
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'cgi'
cgi = CGI.new('html3')
time = Time.now
year = time.year
month = time.month
url = "http://Gyazz.com/masui/予定表 #{year}-#{month}"
View 時計の針
def int(x)
x.to_i
end
def frac(x)
x.to_f - int(x)
end
def ts(x)
"#{x.to_i}時#{frac(x)*60.0}分"
@masui
masui / gyazo.rb
Created Dec 28, 2015
gyazoコマンド
View gyazo.rb
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
#
require 'shellwords'
if ARGV.length == 0
STDERR.puts "% gyazo query"
STDERR.puts "% gyazo -f uploadfile1 uploadfile2"
exit
end
@masui
masui / gist:5737708
Created Jun 9, 2013
画像を表示したり消したりを繰り返す
View gist:5737708
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>title</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<img id="img" src="http://gyazo.com/892d6b42a6a6db62ec368f90f0952984.png">
<script>
View test.c
main(){
printf("hello");
}
@masui
masui / gist:5134566
Created Mar 11, 2013
memoコマンド ちょっとしたことをGyazzに登録するのに使う e.g. % memo 'ちょっとしたことを'
View gist:5134566
#!/usr/bin/ruby
require 'rubygems'
require 'gyazz'
title = ARGV[0]
if !title then
puts "% memo title"
exit
end
View 3memo2sqlite.rb
require 'rubygems'
require 'logger'
require 'active_record'
# ActiveRecord::Base.logger = Logger.new(STDERR)
# ActiveRecord::Base.colorize_logging = false
if File.exist?("3memo.sqlite3") then
File.delete("3memo.sqlite3")
end
View test.js
(function($){
$.fn.test = function(){
this.on('mousedown',mousedownFunc(this));
this.name = "NAMENAME";
}
function mousedownFunc(obj){
return function(e){
alert(obj.name);
};
}
You can’t perform that action at this time.