This file contains hidden or 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 |
This file contains hidden or 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; | |
| } |
This file contains hidden or 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; } |
This file contains hidden or 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 = '[email protected]' | |
| PADDWORD = 'password' | |
| PORT = 995 | |
| # use APOP authentication if $isapop == true | |
| pop = Net::POP3.APOP($isapop).new(SERVER, PORT) |
This file contains hidden or 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 = '[email protected]' | |
| PASSWORD = 'password' | |
| MAIL_FROM = '[email protected]' | |
| gmail = Gmail.connect ACCOUNT, PASSWORD |
This file contains hidden or 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 { |
This file contains hidden or 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 |
This file contains hidden or 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); |
This file contains hidden or 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