View qr.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'barby' | |
require 'barby/barcode' | |
require 'barby/barcode/qr_code' | |
require 'barby/outputter/png_outputter' | |
str = 'Hello QrCode!! Using Gem for Barby, Barby-pngOutputter and Chunky-PNG.' | |
b = Barby::QrCode.new(str, level: :q, size: 10) | |
File.open('qr.png', 'w') do |f| | |
f.write b.to_png |
View keep_img_ratio.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img { | |
max-width: 100%; | |
height: auto; | |
} |
View jsdoit.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { background-color: #DDDDDD; font: 30px sans-serif; } |
View pop_mailChecker.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/pop' | |
SERVER = 'pop.example.com' | |
ACCOUNT = 'example@example.com' | |
PADDWORD = 'password' | |
PORT = 995 | |
# use APOP authentication if $isapop == true | |
pop = Net::POP3.APOP($isapop).new(SERVER, PORT) |
View openMailKicker.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gmail' | |
APPLICATION = '/Applications/Google\ Chrome.app' | |
ACCOUNT = 'your_gmail_account@gmail.com' | |
PASSWORD = 'password' | |
MAIL_FROM = 'your_mobile_phone@exmple.com' | |
gmail = Gmail.connect ACCOUNT, PASSWORD |
View coloring.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="ja-JP"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
div#a { | |
color: #ABABAB; | |
} | |
div#b { |
View tw_timeline.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require '~/tw.rb' | |
puts 'Opening file stream...' | |
file = '' | |
path = '/path/to/text/tweet_dump.txt' | |
if File.exists? path | |
file = File.open(path, 'a+') | |
else | |
file = File.open(path, 'w') | |
end |
View textCrypt.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 暗号化準備 | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); | |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
$plainText = 'This is plain text.'; | |
// Crypt: | |
$cd = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $plainText, MCRYPT_MODE_ECB, $iv); |
View server.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrick' | |
include WEBrick | |
root = File.expand_path(File.dirname($0)) | |
server = WEBrick::HTTPServer.new :Port => 3000, :DocumentRoot => root | |
trap 'INT' do server.shutdown end | |
server.start |
OlderNewer