A Homebrew formula for installing PulseAudio on OS X.
Tested on Lion, and at the moment requires the 10.7 SDK.
brew install https://raw.github.com/gist/1633642/pulseaudio.rb
| # A monkey-patch for ActionPack, which takes into account a POST's encoding. | |
| # Browsers may specify this using a hidden _charset_ field, or in the Content-Type. | |
| # Briefly tested on Rails 2.3.5 and Ruby 1.9.1p376. | |
| class ActionController::Request < Rack::Request | |
| # This is copied from Rack::Request. Rails overrides content_type, which the original relies on, | |
| # thus breaking it, unfortunately. Instead, this version uses @env['CONTENT_TYPE']. | |
| def media_type_params | |
| return {} if @env['CONTENT_TYPE'].nil? | |
| @env['CONTENT_TYPE'].split(/\s*[;,]\s*/)[1..-1]. |
| class Model | |
| # Method used in a class context. | |
| @has_many = (names) -> | |
| # Define the accessor method. | |
| @[names] = -> | |
| # Retrieve stuff from table 'names' | |
| class Account extends Model | |
| @has_many 'emails' |
| # Reverse apply. | |
| Object::apply = (func, args) -> func.apply this, args | |
| # Base model class. | |
| class Model | |
| has_many: (what) -> | |
| @[what] = -> | |
| how_many = @["number_of_#{what}"] | |
| console.log "I have #{how_many} shiney #{what}!" |
| {puts} = require 'sys' | |
| MyClass = prototype ~> | |
| @doSomething = -> 3 + 5 | |
| foobar = new MyClass() | |
| puts foobar.doSomething() | |
| AnotherClass = prototype inherits MyClass ~> | |
| constructor = -> @abc = 3 |
| (function () { | |
| var myModule = { | |
| "prop1" : "some value", | |
| "prop2" : "some other value" | |
| }; | |
| myModule.someMethod = function () { | |
| // Do stuff with props. | |
| }; |
| static int EIO_AfterDrawMap(eio_req *req) { | |
| HandleScope scope; | |
| drawmap_request *drawmap_req =(drawmap_request *)req->data; | |
| ev_unref(EV_DEFAULT_UC); | |
| drawmap_req->map->Unref(); | |
| Local<Value> argv[2]; | |
| if (drawmap_req->data != NULL) { | |
| Buffer * buffer = Buffer::New(drawmap_req->data, drawmap_req->size, FreeImageBuffer, NULL); |
A Homebrew formula for installing PulseAudio on OS X.
Tested on Lion, and at the moment requires the 10.7 SDK.
brew install https://raw.github.com/gist/1633642/pulseaudio.rb
| // console runnable test case adapted from: | |
| // https://github.com/stephank/node-arrays/blob/master/test/typed-array-copy.js | |
| function assertEq(desc, a, b) { console.log(desc + ": " + a + " == " + b + " ? " + (a == b)); } | |
| a = new Uint16Array(8); | |
| b = new Uint8Array(a.buffer, 0, 2); | |
| b[0] = 0x05; | |
| b[1] = 0x05; |
| { | |
| "target_defaults": { | |
| "product_dir": "products" | |
| } | |
| } |
Clients indicate support for the extension by requesting a capability server-time as per the [IRC Client Capabilities Extension][caps].
CAP REQ :server-time
After requesting the capability, clients MUST be able to parse an optional timestamp at the start of each message. The message pseudo-BNF, as defined in [RFC 1459, section 2.3.1][rfc1459] is extended to look as follows:
::= ['@' ] [':' ]