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
#!/usr/bin/env ruby | |
# pidof for OSX. Basically a small modification of doitian's gist | |
target = ARGV[0] || "" | |
ids = [] | |
`/bin/ps -ax -o pid,comm`.split("\n").each do |line| | |
pid, command = line.chomp.split(' ', 2) | |
short_command = File.basename(command) | |
if target == command or target == short_command or | |
target =~ /^[-]?#{short_command}/ | |
ids << pid |
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
/_Inline |
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
/** Try to reproduce a problem in accessing hash concurrently */ | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <pthread.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> |
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
.PHONY: done all | |
# Example to test the ability of step/next to | |
# step into a recursive make or not. | |
$(info MAKEFLAGS = $(MAKEFLAGS)) | |
$(info MFLAGS = $(MFLAGS)) | |
all: | |
$(MAKE) done -f Makefile-step-next.mk |
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
sudo npm install -g websocket |
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
__docformat__ = 'restructuredtext' | |
__all__ ['api'] |
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
# How to use. | |
# $ irb | |
# >> load 'irb-hack-no-tf.rb' # Substitute file path. NOTE: 'load', not 'require' | |
# >> # work, work, work... look at CLASSES, METHODS and MODULES | |
require 'irb' | |
$IRBHACK_DEBUG = true | |
# irb-hack.rb without threadframe and trace modules. However since | |
# there is still a bug in the way Ruby handles c-call events (it calls the | |
# hook before pushing the the frame), this doesn't catch "define-method" |
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 'irb' | |
require 'trace' | |
include Trace | |
CLASSES = {} | |
METHODS = {} | |
MODULES = {} | |
CHECK_METHODS = %w(define_method method_added singleton_method_added CLASS) | |
def capture_hook(event, frame, arg=nil) |
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
========== :find_main_script =========== | |
Arguments: 1 required, 1 total | |
Locals: 2: i, loc | |
Stack size: 7 | |
Lines to IP: 19: 0..3, 20: 4..14, 21: 15..28, 22: 29..39, 23: 40..72, 24: 73..87, 26: 88..94, 28: 95..107, 22: 108..109 | |
0000: cast_for_single_block_arg | |
0001: set_local 0 | |
0003: pop | |
0004: push_local_depth 1, 0 |
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
============= :__script__ ============== | |
Arguments: 0 required, 0 total | |
Locals: 0 | |
Stack size: 5 | |
Lines to IP: 1: 0..9, 1073741823: 10..17, 1: 18..41, 1073741823: 42..47 | |
0000: push_exception_state | |
0001: set_stack_local 0 | |
0003: pop | |
0004: setup_unwind 13, 0 |
OlderNewer