This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| How to add cmd-left-arrow and cmd-right-arrow (without shift) key bindings to the mac os x Terminal | |
| app if the Lion install removed this bindings from your system. | |
| 1) Open "System Preferences". | |
| 2) Go to "Keyboard". | |
| 3) Select the "Keyboard Shortcuts" tab. | |
| 4) Select "Application Shortcuts" from the list of items in the left. | |
| 5) Press "+" to add a new shurtcut. | |
| 6) As "Application" select "Terminal", as "Menu Title" use: "Select Next Tab". For the "Keyboard Shortcut" field just select the field and press cmd-right-arrow. | |
| 7) Repeat again from step 5, using "Select Previous Tab" as Menu Title and pressing cmd-left-arrow as keyboard shortcut. |
| #!/bin/bash | |
| # | |
| # Provides a function that allows you to choose a JDK. Just set the environment | |
| # variable JDKS_ROOT to the directory containing multiple versions of the JDK | |
| # and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned | |
| # up and set appropriately. | |
| _macosx() | |
| { | |
| if [ $(uname -s) = Darwin ]; then |
From the standpoint of OSSL (Ruby’s OpenSSL binding), 1.9.3 is a small release; bug fixes, performance improvements, official OpenSSL 1.0.0 support and a few API enhancements. We had a new digital time-stamp and ASN.1 Template(DSL) implementation presented by Martin Boßlet, but we could not merge those bleeding-edge new features into 1.9.3, since there's no Ruby developer who can review it. It was quite obvious for us to ask him to be a maintainer of OSSL, as an expert in crypto and network security.
Since then, he helped us to clean up lots of OSSL issues piled on our issue tracker, by fixing SEGV bugs, consulting with users, and tailoring the build system to fit OpenSSL versions/variants. Though he discreetly didn’t merge his new feature implementations into 1.9.3, it seems clear that you can utilize those at the next release.
OSSL is the best language binding implementation of OpenSSL in the way of offering most OpenSSL features through an easy API with some help from Ruby. Without Martin Boßlet's help,
| module MultiBlock | |
| class NoBlockError < StandardError; end | |
| class Catcher < BasicObject | |
| def initialize(&blk) | |
| @self = blk.binding.eval "self" | |
| @blocks = {} | |
| @mode = :catch | |
| instance_eval &blk |
| # See the bottom of the file for how this actually works. | |
| module ObjC | |
| def method_missing(method, *args) | |
| ObjCCall.new(self, [], []).send(method, *args) | |
| end | |
| end | |
| class ObjCCall | |
| def initialize(obj, selector, args) |
| class MagicString < String | |
| def +@ | |
| upcase | |
| end | |
| def -@ | |
| downcase | |
| end | |
| def ~ |
| Krypt Asn.1 decoding performance for Rubinius, JRuby and CRuby | |
| ****** Rubinius ****** | |
| [martin@localhost krypt]$ rbx -X19 -v | |
| rubinius 2.0.0dev (1.9.3 b976944f yyyy-mm-dd JI) [x86_64-unknown-linux-gnu] | |
| [martin@localhost krypt]$ rbx -X19 -Ilib -I../krypt-core/lib bm/bm_asn1.rb | |
| user system total real | |
| Krypt::Asn1.decode String(n=1000) 0.002000 0.000000 0.002000 ( 0.002414) | |
| OpenSSL::Asn1.decode String(n=1000) 0.254962 0.006999 0.261961 ( 0.508823) |
| sasha:rubinius brian$ irb | |
| ruby-1.9.3-p0 :001 > __ENCODING__ | |
| => #<Encoding:UTF-8> | |
| ruby-1.9.3-p0 :002 > s = "\u{61}" | |
| => "a" | |
| ruby-1.9.3-p0 :003 > s.encoding | |
| => #<Encoding:UTF-8> | |
| ruby-1.9.3-p0 :004 > re = Regexp.new s | |
| => /a/ | |
| ruby-1.9.3-p0 :005 > re.encoding |
| Dear soon-to-be-former user, | |
| We've got some fantastic news! Well, it's great news for us anyway. You, on | |
| the other hand, are fucked. | |
| We've just been acquired by: | |