I hereby claim:
- I am weppos on github.
- I am weppos (https://keybase.io/weppos) on keybase.
- I have a public key whose fingerprint is C7F3 8EE9 2951 BB47 501A 63B1 420D A82A 9893 98DF
To claim this, I am signing this object:
public string WhoIs(string domainName, string myApiKey) | |
{ | |
string url = "http://api.robowhois.com/whois/" + domainName; | |
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); | |
request.Method = WebRequestMethods.Http.Get; | |
request.Credentials = new NetworkCredential(myApiKey, "X"); | |
try | |
{ | |
WebResponse response = request.GetResponse(); |
I hereby claim:
To claim this, I am signing this object:
# | |
# = Capistrano Passenger deploy tasks | |
# | |
# Provides tasks for deploying a Rails application with Passenger (aka mod_rails). | |
# | |
# Category:: Capistrano | |
# Package:: Passenger | |
# Author:: Simone Carletti <weppos@weppos.net> | |
# Copyright:: 2007-2008 The Authors | |
# License:: MIT License |
# | |
# = Capistrano FastCGI deploy tasks | |
# | |
# Provides tasks for deploying a Rails application with FastCGI. | |
# | |
# Category:: Capistrano | |
# Package:: FastCGI | |
# Author:: Simone Carletti <weppos@weppos.net> | |
# Copyright:: 2007-2008 The Authors | |
# License:: MIT License |
# | |
# = Rails Title Helper | |
# | |
# Provides helpers for managing page title. | |
# | |
# Category:: Rails | |
# Package:: Helpers | |
# Author:: Simone Carletti <weppos@weppos.net> | |
# Copyright:: 2007-2008 The Authors | |
# License:: MIT License |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{QUERY_STRING} !^id=([0-9]*)$ | |
RewriteRule .* - [env=send_x_robot:true] | |
Header set X-Robots-Tag "noindex" env=send_x_robot |
# | |
# = SuperStruct | |
# | |
# SuperStruct is an enhanced version of the Ruby Standard library <tt>Struct</tt>. | |
# | |
# Compared with the original version, it provides the following additional features: | |
# * ability to initialize an instance from Hash | |
# * ability to pass a block on creation | |
# | |
# You can read more at http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/ |
require 'ipaddr' | |
require 'benchmark' | |
class IPAddr | |
def self.valid_ipv4?(addr) | |
if /\A(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\Z/ =~ addr | |
return $~.captures.all? {|i| i.to_i < 256} | |
end | |
false | |
end |
require 'rubygems' | |
require 'benchmark' | |
require 'nokogiri' | |
TIMES = 50_000 | |
doc = Nokogiri::XML(File.new("test.xml")) | |
node = doc.at_xpath("./strategies") | |
Benchmark.bmbm do |x| |
module CacheKey | |
extend self | |
def expirable(range = :minute, time = ::Time.current) | |
key = case range | |
when :always | |
::Time.current | |
when :never | |
nil | |
when :second |