This file contains 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 "active_support" | |
p SecureRandom.uuid |
This file contains 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/http' | |
def fetch(uri_str, limit = 10) | |
raise ArgumentError, 'too many HTTP redirects' if limit == 0 | |
response = Net::HTTP.get_response(URI(uri_str)) | |
case response | |
when Net::HTTPSuccess then | |
response.body()[/<span class="video\-length">\s*(\d+:\d+ min)\s*<\/span>/] | |
when Net::HTTPRedirection then | |
location = response['location'] |
This file contains 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
bool Demarc::has(Port p) const throw() { | |
Mutex::Lock _l(_ports_m); | |
return (_ports.count(p)); | |
} |
This file contains 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
#define true false //happy debugging motherfuckers :)))) |
NewerOlder