« first day (2014 days earlier)      last day (1241 days later) » 

5:03 AM
This involved cloning and compiling Node, with a ton of debugging printf statements way down in the C source :p
0
Q: How can I decrypt data encrypted by Node's deprecated createCipher, in Ruby?

meagarI have some legacy data, encrypted in Node, which I need to decrypt in Ruby. The problem is, the data was encrypted with a now deprecated method, createCipher. This method uses a password to perform encryption. It has been replaced by createCipheriv, which requires a 32 byte key and a 16 byte in...

It takes about 75 lines of C here... github.com/nodejs/node/blob/…
To effectively just get around to
  bytes = [ Digest::MD5.digest(password) ]
  bytes << Digest::MD5.digest(bytes.last + password)
  bytes << Digest::MD5.digest(bytes.last + password)
The most C coding I've done in at least a decade :)
 
 
7 hours later…
12:04 PM
Well, maybe I misunderstood super, but I found a case in which def foo; super; end != alias_method :original_foo, :foo; def foo; original_foo; end which feels wrong.
@meagar Heh, that sounds like "fun" :)
 
 
2 hours later…
user2384183
1:56 PM
@thesecretmaster oh yeah, that's a tricky one. i run into that every once in a while when i'm dealing with overriding methods included via modules/monkey-patching rather than via inheritance
 
Yeah, I'm monkey patching and that's how I saw it. But no harm in a quick alias_method, I guess
 
 
1 hour later…
3:26 PM
@Emmanu rake g migration CreateJoinTableModelAModelB ModelA ModelB
That'll create a migration with something like

create_join_table(:model_a, :model_b) do
  create_index # etc
end
It's pretty spoopy since it depends on the name of the migration, but yeah, that'll generate it for you
 
 
3 hours later…
6:42 PM
If anyone's ever trying to write logging for sinatra, it sticks some really handy keys in the env hash.
i.e. sinatra.route includes the actual pattern that was matched, sinatra.static_file includes the absolute filepath of each file that was served, etc.
 
@thesecretmaster That's good to know! I haven't done any Sinatra app logging yet... all I have now for my microservices is the nginx access log.
 
Also, maybe this is common knowledge and I just didn't know it, but I just learned that split takes a second argument which is the max number of pieces to split the string in.
 
I've used that second argument where you give it a -1, and I forget exactly what that does. I think it causes it to not suppress an empty last string, which I think it will otherwise do.
 
That's right, and positive numbers set split on the first (n-1) occurrences of the target string.
 
 
3 hours later…
9:27 PM
I'm bummed that for my project I had to switch to Python Django. The people in the SO Python chat are not as kind and helpful as those that are in here.
 
I'm surprised. I've had good experiences with those in that room, although I haven't visited in about four years.
 
@WayneConrad bummer. Yeah, I just asked a question about this one tutorial I've been following and was told this: "which makes you a terrible python programmer ;)"
which does not help me improve my skills nor understand why the author of the tutorial chose that method. Nor did the OP of the comment state any solution that was better than the one in the tutorial or give me a direction to go in.
Oh well.
 
I wouldn't give up on that channel over one thing. Give them a chance... the Python community as a whole is pretty good.
 
@WayneConrad Okay, will do. Thank you.
 

« first day (2014 days earlier)      last day (1241 days later) »