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
if doctor puts "Hello Dr. #{name}" else puts "Hello #{name}" 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
string = "Hello " doctor ? string += "Dr. " : "" string += name |
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
"Hello #{'Dr. ' if doctor}#{name}" |
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
module Fruits | |
@fruits = ["Banana", "Apple", "Melon"] | |
def self::[](index) | |
return @fruits[index] | |
end | |
def self.list_fruits | |
@fruits.each { |name| print name; puts "\n" } | |
puts "Those fruits are inside!" |
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
_ = ( | |
255, | |
lambda | |
V ,B,c | |
:c and Y(V*V+B,B, c | |
-1)if(abs(V)<6)else | |
( 2+c-4*abs(V)**-0.4)/i | |
) ;v, x=1500,1000;C=range(v*x | |
);import struct;P=struct.pack;M,\ | |
j ='<QIIHHHH',open('M.bmp','wb').write |
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
ActionDispatch::Request.any_instance.stub(:remote_ip).and_return("192.168.0.1") |
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
xhr :post, PATH, DATA, "REMOTE_ADDR" => "192.168.0.1" |
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
# !/usr/bin/ruby | |
require 'uri' | |
require 'net/http' | |
require 'nokogiri' | |
URL = "http://forum.xda-developers.com/showthread.php?t=1778202" | |
text = Net::HTTP.get(URI.parse(URL)) | |
doc = Nokogiri::HTML(text) |
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
# Public: This class contains methods for deferred garbage collection which | |
# improves the time consumption of integration and unit tests. | |
class DeferredGarbageCollection | |
# Public: The time threshold used by the deferred garbage collection. It's | |
# either set as an environment variable or defaults to 5 seconds. | |
GC_THRESHOLD = (ENV['DEFER_GC'] || 5.0).to_f | |
# Public: The last time the GC has run. | |
@@last_gc_run = Time.now |
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 'bcrypt' | |
silence_warnings do | |
BCrypt::Engine::DEFAULT_COST = BCrypt::Engine::MIN_COST | |
end |
OlderNewer