Skip to content

Instantly share code, notes, and snippets.

Avatar

Simone Carletti weppos

View GitHub Profile
@weppos
weppos / tlds.yml
Last active Oct 11, 2015
Whois fixtures
View tlds.yml
ae.org:
_server: whois.centralnic.com
_subdir: ae.org
status_available: u34jedzcq.ae.org
status_registered: kidzlink.ae.org
ar.com:
_server: whois.centralnic.com
_subdir: ar.com
status_available: u34jedzcq.ar.com
status_registered: hotel.ar.com
@weppos
weppos / whois.asp
Created Jun 7, 2012
RoboWhois + ASP example: get the WHOIS record for a domain.
View whois.asp
<%
' Requests the WHOIS record for the domain
' and returns a String containing the WHOIS response.
Function Whois(url)
Dim objXmlHttp
Set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.Open "GET", url, False, "YOUR_API_KEY", "X"
@weppos
weppos / robowhois.py
Created Jun 7, 2012
RoboWhois + Python example: get the WHOIS record for a domain.
View robowhois.py
import urllib2
class RoboWhois:
def __init__(self, api_key):
self.username = api_key
self.password = "X"
def whois(self, domain):
template = "http://api.robowhois.com/whois/%s"
@weppos
weppos / example.py
Created Jun 7, 2012
RoboWhois + Python example: get the WHOIS record for a domain.
View example.py
import urllib2
def whois(domain):
api_key = "YOUR_API_KEY"
template = "http://api.robowhois.com/whois/%s"
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, "http://api.robowhois.com/", api_key, "X")
handler = urllib2.HTTPBasicAuthHandler(passman)
opener = urllib2.build_opener(handler)
@weppos
weppos / whois-properties.asp
Created Apr 15, 2012
RoboWhois + ASP example: get the parsed WHOIS record for a domain.
View whois-properties.asp
<%
' Requests the parsed WHOIS record for the domain
' and returns a String containing the JSON-encoded parsed WHOIS properties.
Function WhoisProperties(url)
Dim objXmlHttp
Set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.Open "GET", url, False, "YOUR_API_KEY", "X"
@weppos
weppos / whois-properties.php
Created Apr 2, 2012
RoboWhois + PHP example: get the parsed WHOIS record for a domain.
View whois-properties.php
<?php
/* Requests the parsed WHOIS record for the domain
* and returns an Array containing the parsed WHOIS properties.
*
* @param string $domain The domain to lookup.
*
* @return array
*/
function whoisProperties($domain)
View gist:899734
(function($){
$.fn.ifdo = function(fn) {
if (this.length > 0) {
fn.call(this);
}
};
})(jQuery);
View gist:743416
$ cloc robodomain robowhois robofinance whois
1824 text files.
1695 unique files.
920 files ignored.
http://cloc.sourceforge.net v 1.51 T=2.0 s (433.5 files/s, 50222.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Ruby 747 12136 7589 41135
@weppos
weppos / ostruct.rb
Created Dec 7, 2010
History of the OpenStruct changes in Ruby 1.8.7
View ostruct.rb
#
# = ostruct.rb: OpenStruct implementation
#
# Author:: Yukihiro Matsumoto
# Documentation:: Gavin Sinclair
#
# OpenStruct allows the creation of data objects with arbitrary attributes.
# See OpenStruct for an example.
#
View gist:500156
namespace :deploy do
namespace :bundler do
task :symlink, :roles => :app, :except => { :no_release => true } do
shared_dir = File.join(shared_path, "bundle")
bundle_dir = File.join(release_path, "vendor/bundle")
run "rm -rf #{bundle_dir}"
run "mkdir -p #{shared_dir} && ln -s #{shared_dir} #{bundle_dir}"
end
You can’t perform that action at this time.