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
#!/usr/bin/env ruby | |
%w{foo Chihiro bar z0rk}.each do |word| | |
case word | |
when *[/[A-Z]/, /[0-9]/] | |
puts w | |
end | |
end |
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
| Dry run | Update | Size | |
--------+---------+---------+-------- | |
DB | 1.263s | on srvr | on srvr | |
YAML | 0.685s | 12.984s | 2580k | |
Marshal | 0.183s | 1.314s | 1944k |
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
Class/Module Index | |
Ldb | |
Ldb::Context | |
Ldb::Context::Schema | |
Ldb::Dn | |
Ldb::Flags | |
Ldb::Flags::ChangeType | |
Ldb::Flags::Connect | |
Ldb::Flags::DebugLevel | |
Ldb::Flags::Mod |
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
class Numeric | |
def to_bytes | |
f = self | |
1.upto((Math.log2(self)/8).ceil).collect do | |
f, c = f.divmod 256; c | |
end.reverse | |
end | |
end | |
if __FILE__ == $PROGRAM_NAME and ARGV.length > 0 |
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
file { "/etc/foo.d": | |
source => [ | |
"puppet:///modules/foo/conf/${debian_version}", | |
"puppet:///modules/foo/conf/common", | |
], | |
recurse => true, | |
} |
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
(ns moob.sslbs | |
(:import (java.io InputStreamReader Reader) | |
(java.net URL | |
URLConnection) | |
(javax.net.ssl HostnameVerifier HttpsURLConnection | |
SSLContext SSLSession TrustManager | |
X509TrustManager) | |
(java.security cert.X509Certificate SecureRandom))) | |
(defn disable |
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
LINK_MATCHER = re.compile(r""" | |
^ | |
(?P<num> [0-9] +?) : | |
\ (?P<name> [^:] +?) : | |
\ <(?P<flags> [^>] +?)> # uppercase, comma-separated list of flags | |
\ (?P<extra> . *?) # space-separated pairs of "key value" | |
\ *\\\ * | |
\ *link/(?P<link> [^ ] +?) | |
\ (?P<addr> [0-9a-f:] +?) | |
\ brd\ (?P<brd> [0-9a-f:] +?) |
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 'nokogiri' | |
doc = Nokogiri::XML open 'oval-definitions-2010.xml' | |
doc.css('definition[class="vulnerability"]').collect do |v| | |
references = v.css('reference').collect {|v| v['ref_id']}.grep /^CVE/ | |
final_criteria = v.css('criterion[test_ref]').collect {|c| c['test_ref']} | |
next Hash[ | |
final_criteria.collect{|c| doc.css "*[id='#{c}']"}.collect do |t| | |
obj_ref_nodes = t.css('*[object_ref]') |
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
#ifndef g_info | |
#define g_info(...) g_log (G_LOG_DOMAIN,G_LOG_LEVEL_INFO, __VA_ARGS__) | |
#endif |
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
typedef struct sp_session sp_session; | |
typedef struct sp_track sp_track; | |
typedef struct sp_album sp_album; | |
typedef struct sp_artist sp_artist; | |
typedef struct sp_artistbrowse sp_artistbrowse; | |
typedef struct sp_albumbrowse sp_albumbrowse; | |
typedef struct sp_toplistbrowse sp_toplistbrowse; | |
typedef struct sp_search sp_search; | |
typedef struct sp_link sp_link; | |
typedef struct sp_image sp_image; |