Better HN
topnewbestaskshowjobs
Log inSign up

aboutruby

1,129 karma · joined Jan 9, 2019 (7y ago) · 472 submissions

Submissions

comment 7y ago · link · parent

So adding an extra space between every sentence all the time, just for vim's "deleting sentence" to work? (not even by default, and that's a very specific command). And the command breaks because there is a . in the sentence.

So changing a pretty much worldwide convention for a pretty specific edge-case on a rarely used command in vim.

Why not just update the command to detect the special cases like Mr. Mrs., seems like a much simpler solution.

comment 7y ago · link · parent

Ok, I edited a file in a meaningful way and tried to decipher the process (actually it become more of a normal workflow more than editing a file).

The thing is I switch all the time between vim and my terminal (it's complicated by let's say I mainly use one terminal tab for everything I'm currently writing) so using the home row I would have to switch all the time between home row and arrows when using the terminal (and other programs) (I guess I could add vim bindings to every single thing I use: web browser, terminal emulator, pry, irb, tmux, etc etc. but doesn't seem appealing to me).

The escape key isn't an issue either because I don't use the home row, so no need to remap that too.

I think this misconception comes from the manual pushing people to use the home row.

I don't claim I'm the fastest writer ever, but there are a lot of compromises I'm not willing to make (I could use vim tabs/windows, I could use Ctrl-D to switch files, I could use GVim, have the main files always open, etc.). I'm pretty sure everyone works differently and this workflow works very well for me.

What I don't like is this constant shaming of arrow vim users and people that keep saying it's only for beginners (and the manual pushing people to use the home row).

comment 7y ago · link · parent

Not sure if you are directing this comment at me, but I know most of these already. Didn't know about the older terminal emulator issues with arrow keys though.

comment 7y ago · link · parent

> ... But if you're like me, and your mind is constantly racing, you need to be fast to get your ideas out before they're gone/replaced.

I write extremely fast and use arrow keys (and all kinds of vim shortcuts).

> it's also the likely visual/mental cost of looking away from your screen to aid in positioning the hand

I never look at my keyboard when using vim.

comment 7y ago · link · parent

> Moving one line at a time

I either go down with arrows (I know it's controversial), beginning of file with :1, end of file with G, line number with :[line number] or search with /. I usually don't have large files so this works very well (and I almost exclusively go by line number on large files).

> Moving one character at a time

I use ^ for beginning of line, $ for end of line, e to move quickly in a line

> Searching for the word under the cursor

Nice, didn't know about */#, I just type what I'm searching, gonna use that.

> Deleting, then inserting

Insert mode is fine.

> Using the arrow keys

I use the arrow keys, and I don't care about all the arrow-key shamers out there.

> Moving in insert mode

I use insert mode only while editing (makes sense). I don't get the point of this paragraph.

> Moving to Escape

I'm fine with escape key.

> Moving to the start or end of the line, then inserting

I much prefer just going into insert mode.

> Entering insert mode, then opening a new line

I also use o quite often (as it just goes into insert mode).

> Entering insert mode to delete text

Yes, I delete with dd, de, etc. (. is also useful for that), deleting in insert mode is painful for more than one character.

> Repeating commands or searches

Didn't know about q: and q/, pretty useful, nice.

> Repeating substitutions

I use %s/for/far/g or %s/for/far/, or for a few lines, I select them (shift-v) (visual mode) then : (which auto-sets it to :'<,'>) then :'<,'>s/for/far/ for instance.

Anyway, been using vim for ~5 years with a pretty light .vimrc and one thing I would recommend is bogado/file-line plugin which lets you open a file at a line, e.g. vim app/models/user.rb:48

My vimrc if anyone is curious: https://gist.github.com/localhostdotdev/aa25d1c81f3f3b67ac35...

comment 7y ago · link · parent

menu and menu-item are Firefox-only https://caniuse.com/#search=contextmenu

comment 7y ago · link · parent

I wouldn't feel confortable putting my secrets in a remote server with a public IP (IPv6 might be a better idea as it's less guessable).

Also seems a bit over-engineered, I would just ssh into a server and do everything from there as a normal user.

comment 7y ago · link · parent

Here are two examples:

https://www.reddit.com/r/AppleWatch/comments/8nk4vr/apple_wa...

https://www.reddit.com/r/AppleWatch/comments/8pm0qr/my_apple...

comment 7y ago · link · parent

In Ruby, we have Hash#merge, e.g. { a: 1, b: 2 }.merge({ b: 3, c: 4 }) gives { a: 1, b: 3, c: 4 }, which is typically what you want, e.g. args.merge(reset: false) to have reset set to false in the args even if present.

comment 7y ago · link · parent

I saw a few posts on Reddit about how the Apple Watch basically saved people's life:

https://www.reddit.com/r/AppleWatch/comments/a40qm5/heading_...

https://www.reddit.com/r/AppleWatch/comments/9zrdq5/how_an_a...

I'm sure there is a lot more.

(Also all the people losing weight)

comment 7y ago · link · parent

archive.org is already used for sharing deleted tweets and deleted reddit posts/comments for instance.

132.

Black Hole (WebGL Shader)(codepen.io ↗)

4 points · by aboutruby · 7y ago · discuss

comment 7y ago · link · parent

You could also use Special:Export depending on your use case: https://en.wikipedia.org/wiki/Special:Export

comment 7y ago · link · parent

I thought it was the WaffleJS in SF.

comment 7y ago · link · parent

Cool project, but I don't see the link with the article apart from being related to Wikipedia. It might be better off as a Show HN.

comment 7y ago · link · parent

> At the same time, they distribute the music you love while making ever-smaller contributions to the artists, musicians and songwriters who create it — even going so far as to take these creators to court.

Kind of weird to see Apple attacking another company.

Also Spotify main claim seems to be about their podcast acquisitions and Apple didn't answer that:

> So we announce two podcast acquisitions we are super excited about, and all of a sudden Apple arbitrarily decides to prohibit use of its API to recommend podcasts to users

https://timetoplayfair.com/timeline/

comment 7y ago · link · parent

Only company I know of asking for "Dynamic Programming" is LinkedIn, is there any others?

comment 7y ago · link · parent

Not a big surprise as it's one of the harder things to test.

comment 7y ago · link · parent

And seems like they video chat with Google Classroom: https://www.reddit.com/r/teenagers/comments/acvwh9/we_should...

comment 7y ago · link · parent

I think it would still be considered a "Does Not Exist"-valid website if the generated questions would have some auto-formatter for the code. Main issue I see is extra spaces everywhere, often in a syntax breaking way (and missing spaces for formatting) (not that all SO questions have those).

comment 7y ago · link · parent

Source code of the visualizer: https://github.com/FooBarWidget/heap_dumper_visualizer

Best thing is this can be called directly from Ruby with FFI.

comment 7y ago · link · parent

On macOS:

    mdls FILENAME
`kMDItemWhereFroms` is what you are looking for. And for a list of all the URLs from the current directory:

    mdls * | grep kMDItemWhereFroms -A 1 | grep http | ruby -ne "puts \$_.strip[1..-2]"

comment 7y ago · link · parent

Reality is almost nobody wants to wear VR headsets, and that's going to take a while for VCs to admit that.

comment 7y ago · link · parent

I tried it in San Francisco and it was quite good. Pretty rare to find good espressos there.

comment 7y ago · link · parent

There is a proof linked from the Wikipedia article: https://www.davidhbailey.com/dhbpapers/digits.pdf

comment 7y ago · link · parent

I made a gist from the base64 patch for easier reading: https://gist.github.com/localhostdotdev/f07d7ba7ae6cac4ea1c8...

comment 7y ago · link · parent

I think Discord is slowing eating away all other form of online communication as it can be used for such a variety of situations and their API makes it very customizable.

The main issue I see is the culture. Discord's community has quite an opposite culture as Slack (free time vs work time) for instance. Being able to have multiple Discord handles could solve that.

comment 7y ago · link · parent

And Ruby does what I expect:

    > "\x65\x301".include?("\xe9")
    => false

comment 7y ago · link · parent

Hacker News might just have a "Major Internet Services" status board.
1
456
16