Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
Learn How to Create Your Own Programming Language
createyourproglang.com
Recent
Simple Particle Engine for a shooter game
Snake / Nibbles clone in C and Ncurses
Please improve
Parsing of XML data has high CPU usage
Convert simple Javascript to jQuery plugin
Active Record getting unique records
List the files in a directory without the directory name or the extension
clean the code
ohs system, recruitment software, hr software, oh&s software, human resources software, ohs software
Array parsing in a block
Popular
Parsing of XML data has high CPU usage
Snake / Nibbles clone in C and Ncurses
Please improve
List the files in a directory without the directory name or the extension
Convert simple Javascript to jQuery plugin
Active Record getting unique records
Simple Particle Engine for a shooter game
Breadth first cartesian product iterator
php refactoring
first BST
Pastable version of
Silencing current output, but capture output from another process
<pre class='prettyprint' language='ruby'>def self.capture_system(*args) args = args.flatten.compact.collect { |arg| arg.to_s } return false if args.blank? rd, wr = IO.pipe pid = fork do rd.close $stdout.reopen wr $stderr.reopen wr yield if block_given? exec(*args) rescue nil exit! 1 # never gets here unless exec threw or failed end wr.close out = String.new out << rd.read until rd.eof? Process.wait raise unless $?.success? out end</pre> <a href="http://www.refactormycode.com/codes/1166-silencing-current-output-but-capture-output-from-another-process" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://www.refactormycode.com/images/small_logo.gif" style="border:0" /></a>