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
#!/bin/bash | |
# You should add this to your .profile file | |
md () { mkdir -p "$@" && cd "$@"; } |
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
#!/bin/bash | |
# Change to a directory given a full or partial name | |
# You don't have to wrap directory names in quotes either | |
chd() { | |
if [ -n "$@" ]; then | |
if [ -n "`ls "$@"* 2>/dev/null`" ]; then | |
cd "$@"* | |
else | |
echo "-bash: chd: "$@": No directory could be extrapolated from partial name" | |
fi |
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
bin/mspec spec/ruby/library/socket/tcpsocket/open_spec.rb | |
rubinius 1.2.4dev (1.8.7 90126691 yyyy-mm-dd JI) [x86_64-apple-darwin10.7.0] | |
....E. | |
1) | |
TCPSocket.open with a running server connects to a server when passed local_host and local_port arguments ERROR | |
Errno::EAFNOSUPPORT: Address family not supported by protocol family - bind(2) | |
Errno.handle at kernel/common/errno.rb:16 | |
TCPSocket#tcp_setup at lib/socket.rb:1085 | |
TCPSocket#initialize at lib/socket.rb:1013 |
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
kernel/loader.rb : line 279 | |
options.on "-i", "[EXT]", "Edit ARGV files in place, making backup with EXT" do |ext| | |
# in place edit mode | |
$-i = ext || true | |
end | |
kernel/common/argf.rb : line 476 | |
def advance! |
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 'thread' | |
class Foo | |
attr_accessor :bar | |
def baz | |
@bar ||= rand(10000000000) | |
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
require 'thread' | |
module ThreadSafe | |
def self.included(base) | |
base.extend(ThreadSafeClassMethods) | |
base.threadsafe_class_mutex = Mutex.new | |
end | |
module ThreadSafeClassMethods |
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
it "should pass along blocks if given" do | |
class Baz3 | |
def initialize(attributes = nil, &block) | |
yield if block_given? | |
end | |
end | |
class Qiz3 < Baz3 | |
include Eventable | |
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
require 'benchmark' | |
module SuperMutex | |
attr_reader :bar | |
def self.included(base) | |
base.extend(ThreadSafeClassMethods) | |
base.threadsafe_class_mutex = Mutex.new | |
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
require 'benchmark' | |
module SuperMutex | |
attr_reader :bar | |
def initialize | |
@mutex = Mutex.new | |
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
#include <stdio.h> | |
#include <mach/mach_init.h> | |
#include <mach/mach_port.h> | |
#include <mach/task_info.h> | |
#include <mach/thread_act.h> | |
#include <mach/vm_map.h> | |
#include <mach/task.h> | |
#include <sys/types.h> |
OlderNewer