HNHacker News
TopNewBestAskShowJobs

rgrau

524 karma · joined June 11, 2012

- https://github.com/kidd/Me

- https://puntoblogspot.blogspot.com

submissionscomments
rgrau··on UP: A tool for writing Linux pipes with instant live preview
For fast iteration with pipes, using only basic unix tools, and arguably less risky to fat-fingering, I write it in a file, and use watch -n1. Easy to modify, temporarily comment parts of it, etc...

Also, I wrote this plog function (for pipe-log, or something):

    plog() {
      local msg=${1:-plog}
      tee >(sed -e "s/^/[$msg] /" | cat 1>&2 )
    } 
That allows me to see what's happening in the middle steps of the pipeline.

I ended up compiling a list of tricks like that in https://raimonster.com/scripting-field-guide/ , in case anyone is interested (and feedback is appreciated)

rgrau··on Vim-gh-line: Vim plugin to open the current line on GitHub
Yep, https://github.com/sshaw/git-link and it's available in melpa
rgrau··on Elegant Bash Conditionals
There is some special casing in the ifs conditions though.

Even if you `set -e`, the command in the test can fail and your script won't exit.

rgrau··on A Shell Language in Lisp
There's also closh (https://github.com/dundalek/closh) which also provides scripting capabilities appart from the pure interactive shell.

As a newcomer to clojure my question is: what would be the practical differences and deciding factors for doing what would be a ".sh" in babashka vs closh?

rgrau··on How are Docker images built? A look into overlay file-systems
Incognito mode works.

There's this userscript I created a few days ago that can open the incognito window for you in those cases: https://gist.github.com/kidd/d53ca34477c45ee927105fc03b41797... . Not rocket science, but I'm happy with it so far

rgrau··on Google outage – resolved
It's been ages (literally) since I felt so helplessly out of a conversation not being able to check a reference instantaneously.

Weird feeling...

rgrau··on Dev Fonts
Each one of the fonts default in the CSS to 'Comic Sans MS' :)
rgrau··on Time Loop Software (2013)
It reminds me of this playful talk on similar topics by Damian Conway using Raku: https://www.youtube.com/watch?v=ORjyXcLDd9M
rgrau··on The Linux Commands HandBook
zsh also has them.

Another neat way of wrapping code in pushd/popd is to use a subshell.

    (cd $dir
       do-stuff
    )
Oilshell ( https://www.oilshell.org/ ) has support for code blocks so you can:

    cd /tmp {
      do-stuff
    }
rgrau··on Emacs is special regarding UIs
I feel ya, my friend.

I also have read the org manual a few times, and it feels so big you can't hold a mental model for long enough to make sense while incorporating all its features. As you know, org mode has too many features to use them all at once (like emacs itself).

What (kinda) worked for me was, after knowing "I've read it all", to purposefully "downgrade" to a very very basic workflow. I thought then I would start adding features on a need basis, because I had the perimeter of what it can do.

But it turns out I haven't added anything else to the trivial workflow. There's a bit more info here ( https://puntoblogspot.blogspot.com/2018/12/3-basic-org-agend...), but essentially the trick was to use just one capture template for everything that just schedules the current task for today (so it appears in agendas until I mark it as done), and one single file, without different subtrees.

       ("t" "Todo" entry (file+headline "~/org/tasks.org" "Tasks")
    "* %^{title} \n  SCHEDULED:%t\n  %?\n %i\n  %a\nAdded: %U")
I feel safe because in that file, down means "later", so I still can rely on my basic common sense.
rgrau··on Bash Pitfalls
Cool thanks! I will link back and credit you :)
rgrau··on Bash Pitfalls
You've a lot of cool stuff in that repo! I hope you don't mind me 'stealing' some stuff for a kind of booklet I'm working on with several shell tips and tricks.

https://github.com/kidd/scripting-field-guide/

PS: Any comments/PRs are super welcome there too

rgrau··on The Architecture of Open Source Applications
I haven't found much about this topic and I agree there's a need for more info on that.

I remember finding this talk useful and general good advice: https://www.youtube.com/watch?v=wN4ZuGruiNw but would love to learn more about how others do it.

rgrau··on The Architecture of Open Source Applications
With a friend we started having those, and we've been thinking about streaming them, but they always end up being quite chaotic. It'd be very interesting to figure out how to make them fluid enough and yet easy to follow for more watchers.

We both do some pre reading of the topic, and "pair program" through it, changing some bits and running the code to see if the current mental model still holds. The person who drives has to be very verbose explaining what he's doing ("Let's go to this function definition, ok, we see this struct here, let's leave a mark for later and visit that struct"), because otherwise, the one watching is like "wtf, are we looking at now".

We're currently going over emacs' native compiler branch and it's been lots of fun so far. The conversational interaction of Lisps makes those explorations very lively.

I'd be interested in joining, of course :)

rgrau··on Creating a Common Lisp implementation, part 1 [video]
This is part of a series that keeps happening in the Online Lisp Meetings that are held (bi?)weekly since the last ELS.

Today there's one!

https://mailman.common-lisp.net/pipermail/online-lisp-meets/...

rgrau··on Please read the paper before you comment
I had something like "If you have read this far, please mention Bananas in title of your Message" in the middle of my linkedIn profile to know which recruiters would read through the whole profile.

Good times when I got 'bananas' in my mailbox.

rgrau··on REBOL Shell Interface
Wow, thanks so much for this answer.

I'm just going to add this link here to another explanation of yours I found around that expands on some of the unique aspects of Red: https://www.reddit.com/r/redlang/comments/aebxct/contrast_re... .

Thanks again

rgrau··on REBOL Shell Interface
Both REBOL and Red feel magical to me. How is this simplicity achievable? Where is the trick?

I never could dig too deep into those, and couldn't find much info on the net. Is there a set of seminal papers/articles on the principles which those are based off?

I imagine there's Logo on one side of it, but I'm not sure about the bootstrap story, the toolchain, etc... Meta-II? Smalltalk, Lisp?

I recently found this book https://subscription.packtpub.com/book/application_developme... which I'd like to read if it talks about that holistic approach. Any comments? other pointers?

rgrau··on How Did Vim Become So Popular?
Why is vim so addictive, and somehow it's difficult to explain to non vim fanatics? I think it's a reification of the process of walking through a text file and doing stuff to it. A concrete way to talk about processes onto text files. Some feel it is strictly superior to GUIs because you can get ahold of it. you can write it down, put it in a postcard, and you have a handle to it. You type it again and it works. there's no syntax or fuzziness or stuff that can go wrong (TM).

Next question: Can you ahold an algorithm in your head? in the same concrete way you hold 'yypVr-'?

I'm lately quite interested in Array Languages and I'm reading some snippets of Apl/J/K. And the feeling is the same. Everything else looks so wasteful and error prone like the point-and-click looks to vimmers.

Example: Shuffling a vector – breaking ⍵ down into ⍺ pieces from which another vector is built by merging. E.g. if is 'abcdefghij' and is 3, the pieces are 'abcd', 'efg', and 'hij', and the result is 'aehbficgjd':

⍵[⍋⍋(⍴⍵)⍴⍳⍺]

The ergonomics are pretty different from what we're used to, but there's definitely an emergent property there. It's not just "it's shorter to type".

PS: I'm an emacs user (evil)

rgrau··on Teaching my MIT classes with only free/libre software
A bit tangential to the main topic, but I can't wait for that book to be out. IIRC (I read it somewhere??) it's based on his 'Robust Systems' thoughts and experiments.

Total mystery here: https://mitpress.mit.edu/books/software-design-flexibility

You can dip your toe here: https://groups.csail.mit.edu/mac/users/gjs/6.945/readings/

rgrau··on ZSH Aliases
cheers!

happy hacking :)

rgrau··on ZSH Aliases
As others commented, this only acts when the first word in your commandline ends with '.git'.

    - "git", alone isn't going to be hooked.
    - you can do "cd .git".
    - even if you have 'autocd' option set, you can '.git' and it will do "cd .git".
I'm not saying it's even a good practice, but I find it kinda cool, when using this feature in a way it's probably not intended for, you start thinking in 'what might happen inside'.
rgrau··on ZSH Aliases
I also love them global aliases! To push them even further (like the xargs one), I have those aliases to allow me to do quick iterations in 'streaming' fashion:

    alias -g FORI='| while read i ; do '
    alias -g IROF='; done '
rgrau··on ZSH Aliases
suffix aliases do not even have to refer to a real existing file. They are an alias. That's what I use to clone git repos I copypaste:

  alias -s git="git clone"
rgrau··on Userscripts Are Fun and Are Still Very Much Relevant
Since 2012 I'm using a userscript I wrote to inject a button to each github code comment to open my editor at the file-and-line.

It feels strange this is not something more people want, but I haven't seen any other project that addresses the same, so I'm still kinda maintaining it:

https://github.com/kidd/org-protocol-github-lines/

rgrau··on Emacs: The most successful malleable system
Nicely written summary!

This paper was written by Richard Stallman in 1981 and delivered in the ACM Conference on Text Processing which touches on all of your points and a few more: https://www.gnu.org/software/emacs/emacs-paper.html

rgrau··on Some Notes on Christopher Alexander (2008)
Santa Fe Institute has a podcast on complex systems. There's a chapter on cities that might be interesting if you liked 'A City is not a Tree': https://complexity.simplecast.com/episodes/4 .
rgrau··on Show HN: Magit for VSCode (Alpha)
Die hard emacs user here (but looking sometimes into vscode). Which things you get from vscode that couldn't get in emacs? Are you definitely set?
rgrau··on How to Make a Memex
I attempted to bundle firefox history to memacs, and remember it used to work ok-ish, but of course, you have to be using the whole emacs,org-mode suite.

I can't guarantee how well it works nowadays cause I forgot to add the cron job last time I reinstalled my system. It seems there's always something you have to remember (and I forget).

- https://github.com/novoid/Memacs/blob/master/docs/memacs_fir...

rgrau··on Modern, functional Common Lisp: myths and best practices
One little thing I did for Allegro was to compile their docs into a dash docset so you can use emacs' dash-docs with it.

- https://github.com/kidd/AllegroLisp.docset

- https://github.com/dash-docs-el/

← PreviousPage 2 of 4Next →