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 'socket' | |
| require 'rubygems' | |
| require 'collectd/pkt' | |
| class Stats | |
| def initialize name, instance, opts = {} | |
| @name, @instance = name, instance | |
| @sock = UDPSocket.new | |
| @sock.connect opts[:host] || '239.192.74.66', |
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
| ruby-prof | |
| ========= | |
| Thread ID: 2148364720 | |
| Total: 71.501190 | |
| %self total self wait child calls name | |
| 22.00 15.73 15.73 0.00 0.00 421 OpenSSL::SSL::SSLSocket#sysread | |
| 10.82 7.77 7.74 0.03 0.00 194 IO#sysread | |
| 4.92 3.52 3.52 0.00 0.00 21 OpenSSL::SSL::SSLSocket#connect |
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
| # NOTE 1: to use, you'll also need to place something like this in your precmd function: | |
| # findrvm $PWD | |
| # | |
| # NOTE 2: It won't restore your rvm setting when you leave the directory. the function | |
| # stops at the first .rvm it finds, so if you really want to always use a default ruby | |
| # unless you tell it otherwise, put a .rvm somewhere outside all your projects. | |
| # | |
| # NOTE 3: also, for this to work in zsh you need the latest rvm from git that exports | |
| # $rvm_ruby_string and $rvm_gem_set_name | |
| # |
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
| [mysqld] | |
| query_cache_size=1000000 | |
| innodb_file_per_table | |
| innodb_buffer_pool_size=83886080 | |
| innodb_flush_log_at_trx_commit=0 | |
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
| ruby-1.8.7-p174 > localhost = Socket.getaddrinfo("127.0.0.1", nil)[0][2] | |
| => "rightscale.local" | |
| ruby-1.8.7-p174 > addresses = Resolv.getaddresses(localhost) | |
| => [] | |
| ... | |
| ruby-1.8.7-p174 > Resolv.getaddresses('odin') | |
| => ["192.168.1.143"] | |
| ruby-1.8.7-p174 > Resolv.getaddresses('odin.local') |
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
| #import <Foundation/Foundation.h> | |
| int main (int argc, const char * argv[]) { | |
| NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
| // insert code here... | |
| NSLog(@"Hello, World!"); | |
| [pool drain]; | |
| return 0; | |
| } |
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
| #import <Foundation/Foundation.h> | |
| int main (int argc, const char * argv[]) { | |
| __block int i = 0; | |
| void (^tick)(void) = ^{ | |
| i++; | |
| NSLog(@"Tick: %d", i); | |
| }; |
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
| #include <CoreServices/CoreServices.h> | |
| static void mycallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, | |
| const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { | |
| int i; | |
| char **paths = eventPaths; | |
| for (i=0; i<numEvents; i++) { | |
| /* flags are unsigned long, IDs are uint64_t */ | |
| printf("Change %llu in %s, flags %lu\n", eventIds[i], paths[i], eventFlags[i]); |
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
| └─(1::01:01:%)── MAGLEV_OPTS="-d -MtraceLoad" maglev-gem install sinatra ──(Thu,Dec03)─┘ | |
| _____________________________________________________________________________ | |
| | Configuration Files | | |
| | | | |
| | System File: /Users/djensen/Source/Ruby/maglev/etc/system.conf | | |
| | | | |
| | Executable File: /Users/djensen/gem.conf | | |
| | Warning: File not found (errno=2,ENOENT, The file or directory specified cannot | |
| | be found) | | |
| | using defaults. | |
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
| ERL_LIBS=/Library/Erlang/lib | |
| if [ -d $HOME/Library/Erlang/lib ]; then | |
| ERL_LIBS=$HOME/Library/Erlang/lib:$ERL_LIBS | |
| fi | |
| export ERL_LIBS | |
| export CAPP_BUILD=$HOME/Library/JavaScript/Cappuccino | |
| export JAVA_HOME=$(/usr/libexec/java_home) |