Recent submissions

Comment · 2 years ago
Yep, makes sense, thanks!
Comment · 2 years ago
Well, learned something today after reading a bit further in the thread:

    ruby -e 'x = "a\n25\n" ; if x =~ /^\d+$/ ; puts "yes" ; else ; puts "no" ; end'
    yes
Good to know.
Comment · 2 years ago
Unsure what you mean?

    $ ruby -e 'x = "25" ; if x =~ /^\d+$/ ; puts "yes" ; else ; puts "no" ; end'
    yes
    $ ruby -e 'x = "25\n" ; if x =~ /^\d+$/ ; puts "yes" ; else ; puts "no" ; end' 
    yes
    $ ruby -e 'x = "a25\n" ; if x =~ /^\d+$/ ; puts "yes" ; else ; puts "no" ; end'
    no
Also, you'd want to use something that parameterizes the query with '?' (I use the Sequel gem) instead of just stuffing it into a sql string.
Comment · 2 years ago
Dinky Toys!!! I had Eagles, ships from UFO, a Klingon ship...loved them!
Comment · 3 years ago
Wow, I did something like that for my senior project back in '94 using Inventor on an SGI workstation.
Comment · 3 years ago
If you still have IMAP access, thunderbird supports OAuth2 for connecting to O365 IMAP. tbsync for calendar access. Seems to work pretty well currently.
Comment · 4 years ago
I think that's the major problem with software engineering in general: when is software "done" ?
Comment · 4 years ago
Comment · 4 years ago
Would Nix benefit from something like the old CMU depot program?

http://www.cs.cmu.edu/afs/.cs.cmu.edu/help/content/unix_linu...

Consolidating everything you want into /usr/local (exclude packages you don't want). I used to use this at my old job before package managers were ubiquitous.

Comment · 4 years ago
Interesting - I may have hyperphantasia? Most of my thoughts are accompanied by images, and I can rotate and unfold things. It's so vivid I seem to have two types of synesthesia:

    https://en.wikipedia.org/wiki/Number_form
    https://www.discovermagazine.com/health/the-rare-humans-who-see-time-and-have-amazing-memories
Comment · 5 years ago
Nothing is "secure or not" - technologies/mitigations are secure against particular attacks. HTTPS is generally secure against passive network eavesdropping, but does nothing to stop local file inclusion in a web app.

Just because there are attacks or ways around a particular defense doesn't mean it's worthless, that's why we have defense in depth.

Comment · 6 years ago
This works too:

    % cat /tmp/sh
    var=variables
    x=$(
    cat <<EOT
    This string has 'single' and "double" quotes and can interpolate '$var'
    EOT
    )
    echo $x

    % bash /tmp/sh
    This string has 'single' and "double" quotes and can interpolate 'variables'
Comment · 6 years ago
I get a lot of mileage out of

    command | ruby -e 'ARGF.each { |line| #do stuff with line }'
Comment · 7 years ago
xclip : https://github.com/astrand/xclip

    (long pipeline that generates lots of output) | xclip
Or even just

    xclip < /some/file
Now paste where necessary.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton