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
| ## | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # Version 2, December 2004 | |
| # | |
| # Everyone is permitted to copy and distribute verbatim or modified | |
| # copies of this license document, and changing it is allowed as long | |
| # as the name is changed. | |
| # | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
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
| ## | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # Version 2, December 2004 | |
| # | |
| # Everyone is permitted to copy and distribute verbatim or modified | |
| # copies of this license document, and changing it is allowed as long | |
| # as the name is changed. | |
| # | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
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
| class Query | |
| def initialize(&block) | |
| instance_eval(&block) | |
| end | |
| def select(select); @select = select; end | |
| def from (from ); @from = from ; end | |
| def where(op, where) | |
| (@where ||= []) << [ op, where] |
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
| #include <windows.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #define CENTER 0 | |
| int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow) { | |
| HWND hwnd; | |
| char *title; | |
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
| INTERFACE = ARGV[0] || 'wlan0' | |
| class Float; def to_mb; self / 1048576; end; end | |
| initial = (ARGV[1] || 0 ).to_f | |
| available = (ARGV[2] || 100).to_f | |
| delay = (ARGV[3] || 5 ).to_f | |
| left = 0 | |
| initial = File.read('.band') if !ARGV[1] && File.exists?('.band') |
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
| abort 'mkv needed' if ARGV.empty? | |
| input = ARGV[0] | |
| folder = File.dirname input | |
| target = folder + '\\' + (ARGV[1] || (File.basename(input) + '.ass')) | |
| system "mkvextract tracks \"#{input}\" 2:\"#{target}\"" |
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 'benchmark' | |
| time = Benchmark.realtime do | |
| puts [].tap { |ary| | |
| 1000.times { |i| | |
| ary << i | |
| } | |
| }.length | |
| end | |
| puts "Time elapsed #{time*1000} milliseconds" |
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
| class String | |
| def contained_in?(ary) | |
| ary.each { |elm| | |
| return true if self.include? elm | |
| } | |
| false | |
| end | |
| end | |
| puts 'ciao marco'.contained_in? [ 'ciao', 'we' ] |
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 'money' | |
| jpy = [ # http://www.amiami.com/top/cart/wishlist?wish_scode=FIGURE-001918 | |
| { :name => 'Makise Kurisu', :price => 6280, :buy => false }, # Steins;Gate | |
| { :name => 'Shiki Ryougi', :price => 4480, :buy => false }, # Kara no Kyoukai | |
| { :name => 'BakeCoin', :price => 750, :buy => true }, # Monogatari | |
| { :name => 'BakeMousePad', :price => 470, :buy => true }, # Monogatari | |
| { :name => 'BakeCoin', :price => 750, :buy => true }, # Monogatari | |
| { :name => 'Rin Shibuya', :price => 7020, :buy => false }, # iDOLM@STER | |
| { :name => 'Riko Sunomie', :price => 5500, :buy => false }, # KissXSis |
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 'money' | |
| require 'json' | |
| require 'open-uri' | |
| if ARGV.length == 3 | |
| from = ARGV[0] | |
| to = ARGV[1] | |
| money = ARGV[2].to_f | |
| else | |
| from = 'JPY' |