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
| #!/usr/bin/env ruby | |
| map = {} | |
| xpos = 0 | |
| ypos = 0 | |
| xpos_robo = 0 | |
| ypos_robo = 0 | |
| map[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
| #!/usr/bin/env ruby | |
| require 'ffi' | |
| module C | |
| extend FFI::Library | |
| ffi_lib 'c' | |
| attach_function 'sleep', [:int], :int | |
| end | |
| puts "kill -SIGINT #$$" |
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
| $ gunzip -c enwiki-latest-all-titles-in-ns0.gz|head | |
| page_title | |
| ! | |
| !! | |
| !!! | |
| !!!Fuck_You!!! | |
| !!!Fuck_You!!!_And_Then_Some | |
| !!!Fuck_You!!!_and_Then_Some |
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
| buf = File.read File.join rom_base_path, bin_filename # 55M file | |
| pos = 0 | |
| size = 4096 | |
| loop { | |
| chunk = buf.slice(pos, size) | |
| puts "#{Time.now.to_f}: read chunk size: #{chunk.length}" | |
| break if chunk.length != size | |
| pos += size | |
| } |
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
| #!/usr/bin/env ruby | |
| map = {} | |
| xpos = 0 | |
| ypos = 0 | |
| mech = { | |
| "turn on" => :turn_on, | |
| "turn off" => :turn_off, | |
| "toggle" => :toggle, |
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
| #!/usr/bin/env ruby | |
| puts 6 -5 | |
| puts 6 - | |
| 5 | |
| puts 6 | |
| -5 |
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
| [eam@nitre ~]$ cp /bin/sleep /tmp/sleep; /tmp/sleep 60& | |
| [1] 15023 | |
| [eam@nitre ~]$ ls -l /tmp/sleep | |
| -rwxr-xr-x 1 eam eam 27848 Nov 11 09:30 /tmp/sleep | |
| [eam@nitre ~]$ echo "hi" >> /tmp/sleep | |
| -bash: /tmp/sleep: Text file busy |
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
| puts [%w{ }.map(&:size).inject(:*) + 1].pack ?L |
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
| #!/usr/bin/env ruby | |
| pattern = ARGV.shift | |
| pids = %x{pgrep "#{pattern}"}.split.reject {|p| Integer(p); p.to_i == $$ or p.to_i == $?.pid } | |
| pidargs = (["-p"] * pids.size).zip(pids).flatten | |
| raise "no pids match" if pidargs.empty? | |
| exec "strace", *ARGV, *pidargs |
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
| #!/opt/local/bin/perl | |
| use warnings; | |
| use strict; | |
| use Term::InKey; | |
| use Tk::Table; | |
| my ($face, $memp, $x, $y, $clicked_x, $clicked_y, $done, $child, @src, @mem, @breaks); | |
| my %slashmap = ( | |
| 'right' => 'up', |