last_response
.body
last_request
.path
.url
.session
.cookies
| #!/usr/bin/env ruby -w | |
| ## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
| ## Note you cannot do: opt.rb help command | |
| ## other options are commander, main, GLI, trollop... | |
| # run it as | |
| # ruby opt.rb --help | |
| # ruby opt.rb foo --help | |
| # ruby opt.rb foo -q | |
| # etc |
| ' Copyright (c) 2007, Tony Ivanov | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the | |
| documentation and/or other materials provided with the distribution. |
| # How to convert IPv4 addresses between integer <=> dot-decimal notation | |
| INTEGER = 1698212032 | |
| DOT_DECIMAL = '192.168.56.101' | |
| # [ 192, 168, 56, 101 ] | |
| DOT_DECIMAL_PARTS = DOT_DECIMAL.split('.').map(&:to_i) | |
| #################################### | |
| # integer to dot-decimal |
| # Simple, scrappy UDP DNS server in Ruby (with protocol annotations) | |
| # By Peter Cooper | |
| # | |
| # MIT license | |
| # | |
| # * Not advised to use in your production environment! ;-) | |
| # * Requires Ruby 1.9 | |
| # * Supports A and CNAME records | |
| # * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance | |
| # * All records get the same TTL |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| require 'openssl' | |
| def gen_key(name) | |
| key = OpenSSL::PKey::RSA.new 1048 | |
| file = File.new(name, "w") | |
| file.write(key) | |
| file.close | |
| end | |
| def get_key(name) |
| $:.unshift("E:\\Tools\\metasm") | |
| require 'metasm' | |
| require 'optparse' | |
| $ASMCODE = | |
| # Win32 PEB based API Resolver | |
| # Metasm seems to fail on jecxz so we compile using nasm and use the binary | |
| "\xe8\x56\x00\x00\x00\x53\x55\x56\x57\x8b\x6c\x24\x18\x8b\x45\x3c" + | |
| "\x8b\x54\x05\x78\x01\xea\x8b\x4a\x18\x8b\x5a\x20\x01\xeb\xe3\x32" + |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: