Skip to content

Instantly share code, notes, and snippets.

View masui's full-sized avatar

Toshiyuki Masui masui

View GitHub Profile
@masui
masui / gyazo.rb
Created December 28, 2015 13:23
gyazoコマンド
#!/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 June 9, 2013 04:53
画像を表示したり消したりを繰り返す
<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>
@masui
masui / test.c
Created April 8, 2013 02:35
report1
main(){
printf("hello");
}
@masui
masui / gist:5134566
Created March 11, 2013 14:20
memoコマンド ちょっとしたことをGyazzに登録するのに使う e.g. % memo 'ちょっとしたことを'
#!/usr/bin/ruby
require 'rubygems'
require 'gyazz'
title = ARGV[0]
if !title then
puts "% memo title"
exit
end
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
(function($){
$.fn.test = function(){
this.on('mousedown',mousedownFunc(this));
this.name = "NAMENAME";
}
function mousedownFunc(obj){
return function(e){
alert(obj.name);
};
}
(function($){
$.fn.test = function(){
this.on('mousedown',mousedown);
this.name = "NAMENAME";
}
var mousedown = function(e){
// ここで this.name の値を知るにはどうする?
}
})(jQuery);
require "hondana"
include Hondana
shelf = Shelf.new('増井')
shelf.books.each { |book|
puts book.isbn
puts book.title
}
require 'rubygems'
require 'active_record'
#
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:username => 'root',
:password => '',
:database => 'hondana',
:encoding => 'utf8'
@masui
masui / gyazofull.rb
Created October 30, 2015 14:31
gyazofull
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# 全画面Gyazoると同時にファイル情報/アプリ情報のメタデータをアップする
#
require 'net/http'
require 'json'
require 'digest/md5'