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
/* Created by "go tool cgo" - DO NOT EDIT. */ | |
/* package github.com/bnagy/cshared */ | |
/* Start of preamble from import "C" comments. */ | |
/* End of preamble from import "C" comments. */ |
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
# Abstract access to internal files in docx format. Right now this uses system | |
# zip and tempfiles because the available ruby zip libraries don't seem to be | |
# able to produce files that Word will read. | |
# | |
# Author: Ben Nagy | |
# Copyright: Copyright (c) Ben Nagy, 2006-2013. | |
# License: The MIT License | |
# (See http://www.opensource.org/licenses/mit-license.php for details.) | |
require 'tempfile' |
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 'openssl' | |
require 'socket' | |
# client.rb - minimal SSL client | |
# require 'openssl' | |
# require 'socket' | |
# include OpenSSL::SSL | |
# HOST = '::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
require 'openssl' | |
require 'socket' | |
# client.rb - minimal SSL client | |
# require 'openssl' | |
# require 'socket' | |
# include OpenSSL::SSL | |
# HOST = '::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
package main | |
import ( | |
"bytes" | |
"container/list" | |
"debug/macho" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
cs "github.com/bnagy/gapstone" |
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
class ArcFile | |
include Enumerable | |
def initialize( input_stream ) | |
@handle=input_stream | |
end | |
def each | |
return self.to_enum unless block_given? |
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
ARGF.each_line {|line| | |
begin | |
warn "Starting work on #{line.chomp}" | |
# expect a line like this: | |
# s3://commoncrawl-crawl-002/2010/09/24/9/1285380159663_9.arc.gz | |
proto,unused,bucket_name,*rest=line.chomp.split File::SEPARATOR | |
raise ArgumentError, "#{__FILE__}: Unknown S3 Protocol #{proto}" unless proto=~/^s3/ | |
object_name=File.join rest | |
size=Integer( s3.buckets[bucket_name].objects[object_name].content_length ) | |
warn "Reading from #{bucket_name.inspect}, #{object_name.inspect}, size #{size}" |
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
NTSTATUS_ERRORS = { | |
'STATUS_SUCCESS' => "0x00000000", | |
'STATUS_SEVERITY_SUCCESS' => "0x00000000", | |
'STATUS_SEVERITY_INFORMATIONAL' => "0x00000001", | |
'STATUS_SEVERITY_WARNING' => "0x00000002", | |
'STATUS_SEVERITY_ERROR' => "0x00000003", | |
'STATUS_WAIT_0' => "0x00000000", | |
'STATUS_WAIT_1' => "0x00000001", | |
'STATUS_WAIT_2' => "0x00000002", | |
'STATUS_WAIT_3' => "0x00000003", |
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
class Player | |
def initialize(name, health=100) | |
@name = name.capitalize | |
@health = health | |
end | |
def say_hello | |
puts "I'm #{@name} with a health of #{@health}." | |
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
# This is mainly so that the rest of the code will appear consistent with | |
# Windows documentation, and allows me to quickly prototype new APIs by copying | |
# directly from MSDN. | |
# | |
# Author: Ben Nagy | |
# Copyright: Copyright (c) Ben Nagy, 2006-2012. | |
# License: The MIT License | |
# (See http://www.opensource.org/licenses/mit-license.php for details.) | |
require 'ffi' |