💾 Archived View for hedy.tilde.cafe › tinylog.gmi captured on 2023-11-14 at 07:28:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

-=-=-=-=-=-=-

Last built: 2023-10-11 21:44:06

hedy's journal

this is my tinylog-rfc-format'ed feed for my journal.

the actual journal that I write on is here:

//hedy.flounder.online/journal/

this feed is auto generated by a script. so at one point in time it might not have the most up to date information, but it will probably be updated a few hours after.

If you want, you can force refresh the script so this can be rebuilt on demand:

gemini://hedy.tilde.cafe/gentinylog (note: WIP - perm issues)

sometimes I don't specify the time, instead I use a entry title or label. so my script sets the time as "12:00" if time doesn't exist and I have my entry title (if available) in "###" header.

author: @hedy

avatar: 📒

license: CC BY-SA

2023-10-11 21:40 +08:00

recursion

any recursive function can be reimplemented as an iterative function?

https://stackoverflow.com/questions/531668

I find the explanation of "tracking your own callstack like the compiler does" mesmerizing

2023-04-22 15:29 +08:00

hello world (again)

happy belated new year, 2023 can you believe it? oh look, it's already April!

I should *definitely* update my gemlog soon

2022-12-28 14:21 +08:00

Python operator precedence

()
			

	
+x, -x, ~x  (unary plus, unary minus, bitwise NOT)
			

			
+, -
			
<<, >> (bitwise shift)
			
&  (bitwise AND)
			
^  (bitwise XOR)
			
|  (bitwise OR)
			
==, !=, >, >=, <, <=, is, is not, in, not in
			
not
			
and
			
or

2022-12-23 15:35 +08:00

bash - trim leading zeros

$ echo $((10#02))
2

https://stackoverflow.com/questions/11123717/removing-leading-zeros-before-passing-a-shell-variable-to-another-command

2022-12-07 20:37 +08:00

- vim window splits reference

I keep forgetting!

no splits - current window as [o]nly window

ctrl w o

swap windos

ctrl w x

split opened buffers (horz)

ctrl w s

split opened buffers (vert)

ctrl w v

go to split

ctrl w h/j/k/l

open new file as split

:sp <file>

:vsp <file>

2022-12-07 20:40 +08:00

Advent of Code

I attempted python solutions daily, with most ones having golf solutions.

Some have shell, golang, and lua solutions too.

https://github.com/hedyhli/adventofcode

https://tildegit/hedy/aoc

https://sr.ht/hedy/adventofcode

Currently up to:

2022: day 7 (ongoing!)

2020: day 9

2021: day 2

2022-11-10 21:06 +08:00

My plant on astrobotany is still alive despite my idleness of 4+ months! Damn

2022-11-10 20:43 +08:00

Advent of Code revival, (n)vim macros

finishing up Advent of Code 2020

https://adventofcode.com/2020

https://sr.ht/~hedy/adventofcode/

https://github.com/hedyhli/adventofcode

Had to go through each puzzle page, copy its plain-text, paste it in a new file, then apply formatting manually.

There were a LOT of wrapping `code blocks` and **bold** around words. Had to make use of 5 macros (personal record!)

@a = i**<Esc>Eli**<Esc>  # bold word
@b = i`<Esc>Ei`<Esc>     # code word
@c = i**<Esc>2Wi**<Esc>  # 2 bold words
@d = i`<Esc>Eli`<Esc>    # code word that ends with a space
@i = i`<Right>`<Esc>     # single-char inline code

(Note I should probably write that code block in Vimscript syntax, can't remember at the moment...)

A lot of batch string parsing and validation in the first four days.

2022-09-18 08:13 +08:00

Vim debug logs

Noting down things that had saved me so I (hopefully) don't have to search up stuff every time

https://stackoverflow.com/questions/3025615/is-there-a-vim-runtime-log

2022-08-31 15:55 +08:00

Read this yesterday:

Dictatorships are good at concealing the problems they create while democracy is good at advertising its defects.

Daily dose of Vsauce wonder

[YouTube] "Is Earth Actually Flat?"

[YouTube] "Messages For The Future"

2022-05-13 18:36 +08:00

TIL - diff unsaved changes in vim

:w !diff % -

2022-05-08 18:06 +08:00

journal meta

My script that parses this journal page and dumps out the content in tinylog format had hardcoded the year to 2021. Can't believe I'd only found out about this 5 months into 2022, anyways it's fixed now.

The CGI scripts that is supposed to run that ^ on demand and deploy any changes to my tinylog.gmi feed doesn't work still because CGI is run by a single user in gemserv. I'll think about how I can (safely) fix that soon.

2022-05-07 15:00 +08:00

spartan:// on lagrange

Lagrange v1.13 supports spartan!

2022-05-07 12:34 +08:00

TIL - indexing substring and list elements in python

I always thought there were two list methods to find the index of an element in python - find and index. find would raise an IndexError when the item isn't found in the list, whereas index would return -1 in that same case.

Nope, that's completely wrong.

First, there's only .index for lists:

>>> ['a', 'b', 'c'].index('a')
0

And it raises a ValueError if the item isn't found:

>>> ['a', 'b', 'c'].index(404)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 404 is not in list

Method signature:

index(self, value, start=0, stop=9223372036854775807, /)
    Return first index of value.

    Raises ValueError if the value is not present.

Second, the "find vs. index" is for strings, not lists - both find and index methods exist for strings:

>>> 'abc'.index('a')
0
>>> 'abc'.find('a')
0

So what are the differences? Turns out my previous understanding of how find/index handles non-existent items had been mixed up. When attempting to index a substring that isn't actually in the string, index raises a ValueError, and find returns -1:

>>> 'abc'.index('z')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: substring not found
>>> 'abc'.find('z')
-1

(Note that you can use either to search for "substrings" - i.e: `'abc'.index('bc')`)

Method signatures:

index(...)
    S.index(sub[, start[, end]]) -> int

    Return the lowest index in S where substring sub is found,
    such that sub is contained within S[start:end].  Optional
    arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.
find(...)
    S.find(sub[, start[, end]]) -> int

    Return the lowest index in S where substring sub is found,
    such that sub is contained within S[start:end].  Optional
    arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

Just for fun, I also went ahead and tested out the performance of the two methods

$ python3 -m timeit "'abcdefghijklmnopqrstuvwxyz'.index('p')"
2000000 loops, best of 5: 131 nsec per loop
$ python3 -m timeit "'abcdefghijklmnopqrstuvwxyz'.find('p')"
2000000 loops, best of 5: 103 nsec per loop

For cases where the item isn't found:

$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "try: s.index('Z')" \
      "except: pass"
1000000 loops, best of 5: 310 nsec per loop
$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "try: s.find('Z')" \
      "except: pass"
2000000 loops, best of 5: 110 nsec per loop
python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if s.find('Z') == -1: pass"
2000000 loops, best of 5: 119 nsec per loop

Seems like .find() clearly wins on speed.

Here's an example of searching for the index of a substring in a string, then doing something with it:

$ python3 -m timeit -s "s = 'abcdefghijklmnopqrstuvwxyz'" \           
      "if 'z' in s:" \
      "    index = s.find('z')" \
      "    print('do stuff with', index)" \
      "else:" \
      "    print('not found')"  |tail -n1
500000 loops, best of 5: 700 nsec per loop
$ python3 -m timeit -s "s = 'abcdefghijklmnopqrstuvwxyz'" \
      "if index := s.find('z') != -1:" \
      "    print('do stuff with', index)" \
      "else:" \
      "    print('not found')"  | tail -n1
500000 loops, best of 5: 686 nsec per loop

Interesting! The second method does seem more idiomatic and "clean", but can .find() truly beat python's native operator?

$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if 'Z' not in s: pass"
10000000 loops, best of 5: 31 nsec per loop
$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if 'xyz' not in s: pass"
5000000 loops, best of 5: 40.3 nsec per loop
$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if 'xyZ' not in s: pass"
5000000 loops, best of 5: 39.6 nsec per loop
$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if s.find('Z') == -1: pass"
2000000 loops, best of 5: 119 nsec per loop
$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if s.find('xyz') == -1: pass"
2000000 loops, best of 5: 137 nsec per loop
$ python3 -m timeit -s "s='abcdefghijklmnopqrstuvwxyz'" \
      "if s.find('xyZ') == -1: pass"
2000000 loops, best of 5: 140 nsec per loop

Nope :) It does cost a method call.

---

Python version used: 3.8.12

Further exploration:

gemini://hedy.tilde.cafe/help/py?list.index

gemini://hedy.tilde.cafe/help/py?str.index

gemini://hedy.tilde.cafe/help/py?str.find

https://docs.python.org/3/tutorial/datastructures.html

https://docs.python.org/3/library/stdtypes.html#str.index

https://docs.python.org/3/library/stdtypes.html#str.find

https://docs.python.org/3/library/timeit.html

2022-01-02 21:34 +08:00

hello!

I took quite a long (forced, unavoidable) break to focus on my studies. Thankfully I've updated by tinylog-gen script so it can merge my 2021 and 2022 files now. Speaking of which, happy new year :)

I generally don't care about it though -- I mean it's just another revolution around the sun plus about 3/4th of a day, right? Also more or less beginning from a rather arbitrary point in the orbit anyway.

It's amazing coming back to my inbox reading mailing list archives to read what I'd missed. By the way, I'm surprised I still remember all my shortcuts and keybinds I've set up in nvim, tmux etc.

Most likely for another day to start working on my projects again, sadly. Bye!

2021-09-29 09:12 +08:00

bombadillo

bombadillo is the best terminal gemini (and gopher, finger, maybe telnet?) client IMO. It has many things amfora/astronaut/av98 doesn't have, just that I wish it could have custom colors.

2021-09-25 21:49 +08:00

vim-magit is amazing, but when commit triggers gpg's passphrase prompt it seems very very unresponsive. really weird and annoying. lucky I could go to another repo, enter the commit + enter passphrase without magit successfully so that in magit I can just commit and it won't prompt the passphrase.

2021-09-25 08:24 +08:00

gitea

I *just* discovered that gitea is actually written in go (wow).

And I thought codeberg was gitea's official/public instance? Apparently there's also gitea.com which has around as many (maybe less) users/repos on there.

I also found a command line tool for gitea

tea

Doesn't feel as polished and pretty as github cli 😛

But still, how did I not know these before? damn I always thought it was written in ruby

2021-09-23 17:34 +08:00

jc - cli jsonify tool (also python library)

github.com/kellyjonbrazil/jc

pipe the output of a (supported) command into it and it will give you a json output which can be easily used in scripts like with jq.

I haven't seen any alternatives for this before, as in apart from using shell utils like cut, sed, head/tail, awk, etc.

On a brief look it seems that it supports around 70 commands

Examples:

$ ls -l /usr/bin | jc --ls -p -r
[
  {
    "filename": "apropos",
    "link_to": "whatis",
    "flags": "lrwxrwxrwx.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "6",
    "date": "Aug 15 10:53"
  },
  {
    "filename": "arch",
    "flags": "-rwxr-xr-x.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "33080",
    "date": "Aug 19 23:25"
  },
  ...
]
$ w | jc --w -p
[
  {
    "user": "root",
    "tty": "tty1",
    "from": null,
    "login_at": "07:49",
    "idle": "1:15m",
    "jcpu": "0.00s",
    "pcpu": "0.00s",
    "what": "-bash"
  },
  ...
]

holy smokes! gotta change my `online` script now 😱

online (rtc-scripts)

2021-09-20 13:53 +08:00

binomial theorem

"The Discovery That Transformed Pi" on YouTube

sooo cool!

I can't wait to program this out with code and build cool stuff with pascal triangle, pi graphed out and things like that

2021-09-19 14:58 +08:00

started reading a lot of novels this week, completely forgot how i enjoyed them... haven't read novels properly for like a year a more

2021-09-09 08:57 +08:00

fish

Re: @hexdsl Wed 08 Sep 2021 21:47 BST

Fish seems like a terrible shell

how so? I agree that it isn't posix compliant and can't directly type in shell scripts, but I really can't survive without fish. The auto suggestions and auto complete is really smart and colorful. It even tells me if a command is not found before I hit enter. Those things can probably be achieved with plugins from oh my zsh/bash but requires less (or no) set up. I also think that the completion, configuration and environment variables are easier.

The default bash AFAIK only lists out the possible completions when you hit tab twice, but in fish you hit tab once and it lists out the possible completions AND allows you to tab through to select one. Fish's built-in commands (and 3rd party ones if they support it) also allows you to see the description of each completions which is an amazing way of learning a tool without having to dig through the docs.

For example, when I type `git a` and hit tab, it lists 3 entries of command completion and shows you what the command does next to each of them:

~ $ git a<tab>                                                                                                            
add                          (Add file contents to the index)  archive  (Create an archive of files from a named tree)         
apply  (Apply a patch on a git index file and a working tree)

Just to add to Solene's post, you don't need to type ctrl e to confirm a suggestion, the right arrow key would work and is easier to type IMO.

2021-09-01 19:48 +08:00

paralympics was pretty cool!

2021-09-01 20:44 +08:00

2021 is such a nice number, 2022 looks kinda ugly for some reason ;-;

2021-08-21 20:18 +08:00

Refactored much of my dotfiles this week, especially my nvim configuration. There were so much untouched configuration that didn't actually work and I didn't even know xD

github.com/hedyhli/dotfiles (also on sr.ht)

I've started to focus a bit on maintainability and ease of settings up new machines, I wrote some setup scripts and I plan to organize them all and have a `dot` script that can run them on request (instead of having to type out the full path every time). I also plan to make the setup scripts be able to be run more than once, that is even after setting up the first time I can still run them again and again to keep stuff in sync. I've recently used my dotfiles to set up two linux desktops and it was relatively easy to get everything working.

Back to nvim, I've switched to a lua autopairs plugin so that I can get more customization and control in its behaviour (real reason was to fix some really annoying behaviour, see commit log for more info). I'll probably replace lightline (vim) with galaxyline (lua based) next week.

Still trying to get <CR> automatically hide the popup menu :/ and I need to optimize the startup speed a bit more. Once I've done that I'll be able to resume working on my projects :D

2021-08-05 16:21 +08:00

site

Finally took the time to work on my website:

https://hedy.tilde.cafe (also on gemini)

still using hugo as the SSG, kiln didn't have as much features that I need from hugo, and bashblog just isn't good enough, feels simple but really not organised and stuff.

Re-wrote CSS based on a few inspirations:

https://simplecss.org

https://seirdy.one

https://smol.pub

I intend it to be not too barebones, and definetly not brutalist design, should look somewhat modern, but should have some accessibility features and simplicity to it. I've set the margin-left for blockquotes to 0 to make it look better in small screens, and kept the nav bar and footer simple. I've checked that it looks ok in reader mode and terminal browsers.

Many people who have minimalist-styled css websites have font-family be brwser default, but (not sure if it's just me) but if browser default is used all the apostrophes take such a huge space and makes it look very awkward. So I've set the font-family to a sans-serif stack (with sans-serif as the last fallback).

I've also gotten syntax highlighting to work in code blocks with different theme for light mode and dark mode. I'm not sure if screen readers will have a good time parsing code blocks and making sure they're formatted right, but I keep on improve it as I write more posts.

Special thanks to seirdy's post on website best practices

gemini://seirdy.one/2020/11/23/website-best-practices.gmi

The post is a bit opinionated but I've tried to keep with those best-practices where I can tolerate. The css source is minified and dumped into <style> tags, so no extra requests via <link>. No favicon at the moment, since I'm still figuring out what favicon I should use. No fancy animations or over-the-top colors. My link-hover styles might be a bit extra, but it looks really good when the underline is gone and highlight is up on mouse over.

There is absolutely no javascript or scripting, it's fully static, except maybe a few CGI scripts that I rarely use?

I've also mirrored all of my gemlog posts on hedy.smol.pub to hedy.tilde.cafe.

I'll write new gemlog posts from ~cafe now :D If you've subscribed to my smol.pub gemlog, I'd love it if you could change the feed url to:

gemini://hedy.tilde.cafe/feed.xml

Thanks!!

I'll probably move my tinylog/journal to there as well, in the future.

Still figuring out what I should do with my flounder site when I'm mostly done with my site (apart from content, content, content). The fact that I can just make a simple edit online is the one thing that keeps me using flounder, but it has plenty of limitations: css, gopher, more file types, CGI, ssh/rsync deploy, etc.

I also plan to have it on tor but doing that would be after I've done everything I've said above.

In regards to comments, I'll probably go with the "email to public mailing list route" plus webmentions. webmentions is one of the things that I'll definetly want to have. For gemini comments, I may setup the CGI gemini likes/comments systems in the future, but I don't really feel like that's the best solution...

If you have any feedback or suggestions, I'm happy to hear about it! Just trying to find the best middleground between absolute brutalist/minimalist and simplistic-but-modern aesthetics here.

2021-07-19 11:28 +08:00

git tagging script

made a bash script to bump versions with git tag yesterday. It's working well and suits my needs:

shltag - source code in my dotfiles repo on git.sr.ht (also on tildegit and gh)

shltag = shortlog + tag

puts git shortlog output into signed annotated tag.

I know this exists but I think it does a bit too much, lol.

semver by drew devault - git.sr.ht

I've also finally finished adding config file support as well as per user directory serving to spsrv. (not going to put a link here, because I feel like I'm self plugging to much. Go to sr.ht/~hedy or tildegit.org/hedy to find the source code). It's not very stable yet I think, so I haven't documented the stuff in the readme yet.

2021-07-14 11:51 +08:00

Decided to start over :D

It's nice that I can still "harvest" my plant even though it's dead, lol. Not sure if that's a bug.

2021-07-14 11:48 +08:00

I just realized my plant on astrobotany had died :O

It's pity that I might not ever be able to have another levitating plant again. Wondering whether I should keep it like that for posterity or I should start over.

2021-07-12 12:10 +08:00

tinylog feed

finished simple script in python that converts my journal format to tinylog format. the script isn't commented well so oof, bad luck to the future me :/

it has a single loop that goes over each line of this file and scraps the dates and content, I also have a header.gmi, so I have this:

python3 genfeed.py | cat header.gmi - > tinylog.gmi

I then I simply upload the tinylog.gmi to flounder, that's it! really simple

just to be a little bit lazy, I made a bash script wrapper that downloads my journal, my current tinylog.gmi, and checks if changes before uploading to flounder.

I think about doing something simple but for antenna in the future:

/journal/antenna.gmi

2021-07-11 18:09 +08:00

it keeps raining ugh

2021-07-11 17:52 +08:00

spartan

working on a spartan client and server, written in go

discovered spartan in february or march this year, can't remember (wrote in entry in this journal, you can flip back :D) and I've wanted to make a CLI/TUI client since then but I was busy with other things. I even registered #spartan on irc.tilde.chat but no one came (of course, since no one talked about it) then I just left the channel and forgot all about it. It wasn't until this wee or last week when I noticed #spartan channel was registered again (by g1n) so I decided to join, and oh! 6 people, huh that's interesting. I guess that's might be because it was mentioned a few times in #gemini (when discussing mercury).

anyway, now that I have a tiny little bit more free time than before (and have started learning go since), I've decided to make some spartan software. It really really easy to get the to work after forking some gemini software, lots of things to change, but still. note that they both probably has bugs, but they work fine when I was testing it, so feel free to use them but don't be surprised when coming across incomplete features and bugs :)

here are the source code, both in golang. (all my repos are hosted on https://sr.ht/~hedy too)

sparte - CLI client (like curl/wget/gemget but much, much simpler as of now)

spsrv - (static files) server

I'm also planning to make a server framework, a TUI client, and I'm also adding spartan support to gelim (my interactive gemini client).

2021-07-07 19:33 +08:00

learning lua and planning to use lua for some configs for neovim.

also looking to replace CoC.nvim with nvim's LSP support.

coc.nvim - this used to be my best friend, I still like it though, but hoping that replacing it with lua would make things simpler :P

seirdy's dotfiles - .config/nvim/ - reading his config for reference

nytpu's dotfiles - .config/nvim/ - also reading this - for fun, learning, and reference

I'm also wondering how I should go about having vim and neovim share a same config. Maybe I'll have a my neovim's general.vim smaller, and have vim `source` that or something. Not sure about what I should do about my plugins though.

tildegit.org/hedy/dotfiles (also hosted on sr.ht)

2021-07-03 11:17 +08:00

feel so bad rn...

theres this super hard math test with all multiple choice questions and the last two questions worth the most marks, but I thought marks are deduct for wrong answers (makes sense, since it's multiple choice), so I left the last two questions blank (can't do them anyway, though I finished all the other questions), and YET... after submitting I realised marks aren't actually deducted for wrong answers and me be like, tf-

well anyway that's fine, the test is finally behind me and like yeah who cares, I mean at least I got all the other questions done soo

2021-07-02 21:54 +08:00

ubuntu desktop on raspberry pi runs pretty smooth

not much lag and all

was able to get x11 forward working with git for windows (and vcxsrv)

2021-07-01 11:59 +08:00

1st of July, very nice.

one month closer to 2022

2021-06-30 18:23 +08:00

antenna is pretty cool

2021-06-29 16:15 +08:00

this is quite interesting:

https://jsisweird.com/

a quiz with a bunch of questions asking what would be the output of some "wtf" things in javascript. (such as how `NaN === NaN` is false)

despite it being a bit... controversial? as in like people say these are just a small part of the language and it's define this way, I think it's fun to have a look at the answers and try not to run into these situations when writing JS. I mean, almost (?) all programming languages have weird bits, such as the weirdness in python listed in this repo:

https://github.com/satwikkansal/wtfpython

2021-06-27 15:24 +08:00

found some cool software by simon ser:

simple web IRC client

IRC bouncer (pounce exists, I know)

simple CLI side-by-side diff viewer (diff-so-fancy exists, I know)

2021-06-27 15:19 +08:00

wsl 2 is quite unstable... it broke my network driver and stuff (may not be due to wsl only but it could be).

since I refuse join windows insider program I have to use an X server to run linux GUI programs with wsl. used vcxsrv, installation and launch super smooth, worked on first try, everything good but my network and stuff broken so I had to completely uninstall wsl 2. (I actually ended up completely resetting my laptop. in conclusion, windows meh, mac os ok, linux good :P

I think I'd rather run a linux VM in windows than wsl. idk really, I mean I could even just work on my raspberry pi or something

2021-06-27 11:45 +08:00

this is quite interesting:

https://git.sr.ht/~sircmpwn/dotfiles/tree/master/item/bin/language-picker

asks you some questions then tells you which languages (out of C, Go, Python, Lisp) would best suit you. Bit opinionated but cool still

2021-06-26 12:00 +08:00

removed as much data (posts, videos, interactions) as possible from my old facebook account and youtube channel, feeling good.

I'm still keeping my youtube account though, because there's some good content in there but I don't watch them much

2021-06-23 12:00 +08:00

this seems interesting

https://wiki.debian.org/Teams/Apt/Spec/AptSign

rich and textual

A Python TUI framework with rich is actually a thing! (wip, but STILL).

people liked rich and they talked about how they want it to be like a full TUI framework... and yep, now it's a thing. looks beautiful, and I'm sure when it becomes stable it will have much better docs then things like urwid

github.com/willmcgugan/textual - TUI for rich

github.com/willmcgugan/rich

I'm actually quite excited for this, though I haven't looked into the details and APIs yet. I'd love to make a TUI gemini client with textual that looks (almost) as nice as amfora :D

not sure if it's because Will's terminal is better, but stuff made with rich/textual looks nicer than amfora screenshots

2021-06-18 12:00 +08:00

quite nice indeed

found it from alex's journal

https://github.com/tomnomnom/gron

Why shouldn't I just use jq?
jq is awesome, and a lot more powerful than gron, but with that power comes complexity. gron aims to make it easier to use the tools you already know, like grep and sed.
gron's primary purpose is to make it easy to find the path to a value in a deeply nested JSON blob when you don't already know the structure; much of jq's power is unlocked only once you know that structure.

whenever I want to use jq I always just happen to forget how to query with it, so everytime I have to dig into the man page... I have like a list of tools/concepts to learn "in the future if I have time" and jq is one of them

2021-06-17 12:01 +08:00

ugh I keep thinking whether I should switch to kiln instead. but atm as far as I know it doesn't support fetching a file from assets/ (say, style.css) minify it, then get the content so it can be dumped in the <style></style>. I guess I still just use hugo then. It looks heavy (heavier than kiln for sure) but it feels fast and light for some reason.

2021-06-17 09:34 +08:00

tinylogs are fun

2021-06-11 12:00 +08:00

I like wind. according to my brain (very reliable source indeed), wind is caused by the same process that form mountains and cause earthquakes/tsunamis/etc. (lol that was random and unsurprising but i'm pretty sure true)

2021-06-09 12:00 +08:00

some hugo themes are actually really nice and simple, and some of which has no tracking, no js, or no heavy css involved. here's some of my favs:

smol

console

archie

2021-06-06 12:00 +08:00

wsl 2 is pretty interesting. I like that it is now able to be installed without having to join windows insiders. tried out both ubuntu 20 and alpine on there, will be finishing some configs and setup tomorrow

2021-05-31 12:00 +08:00

last day of may already? nice.

haven't been online as much for this month... so yeah

I saw the news of freenode, it's pretty surprising since for the last few months when I was active on IRC I didn't like to spent much time on freenode, maybe it's because of its popularity (I tend to like to hang out in places that don't have as much users), but idk

libera.chat is pretty cool

2021-05-05 12:00 +08:00

accessing my flounder capsule from Documents (by Readdle) iPad app

pretty cool huh

recently trying out the various different apple pencil note apps again (did it a year ago), writing this with Apple Pencil scribble feature. It's not very good with symbols ←

2021-05-01 12:00 +08:00

gosh can't believe it's may already :o

I love how a third of 2021 is finished (4/12=1/3)

2021-04-30 12:00 +08:00

replaced old readline package for gelim with this:

http://github.com/lmorg/readline

it's quite good, much better than what I was previously using. also discovered murex shell from there, feels a bit like fish, but i don't like murex's syntax, and it isn't as widely supported or known compared to fish

also added colors!!! easier than I thought. this package i'm using feels much much better than colorama from the python realm:

http://github.com/fatih/color

honestly go packages are all really cool

2021-04-29 12:00 +08:00

added pager to my gemini client, it basically just calls `less` with -FSEX and if it fails, it will just print the content normally

https://sr.ht/~hedy/gelim

2021-04-18 12:00 +08:00

dotfiles (again)

yesterday I thought, wouldn't it be the absolute perfect solution to track my dotfiles with hardlinks? (that is, you hardlink the dotfiles into a git repo and track them from there)

so today I did a bit of research and found that there are many people who have tried this method, and there are caveats:

https://codingkilledthecat.wordpress.com/2012/08/08/git-dotfiles-and-hardlinks/

^that article suggests you to just track your ~ with git, which I have mentioned with other dotfiles managers on Apr 6th (below), it said that the problem with doing the hardlinks way is that "Git never modifies files in the working tree – instead, it unlinks them and then recreates them from scratch. This inherently breaks any hardlinks that might have been present". which AFAI can tell, you can't use git commands to modify files from your repo and wish that those changes will reflect in your ~ (?)

so then I thought, what if, instead of having files in your dotfiles git repo be hardlinks /of/ your dotfiles at ~, why not have the dotfiles at your ~ be hardlinks /to/ files in your git repo?

in that case, though I haven't tried it yet, will probably be similar to the symlink solution which when you want to `vim .gitconfig` for example, it opens `~/dotfiles/.gitconfig` and breaks the syntax highlighting. But now with symlink replaced with hardlinks, you are probably still editing your `~/.gitconfig` and since `~/dotfiles/.gitconfig` points to the same contents you can track the changes as needed. sounds too good to be true, kinda?

so why am I trying out these different, almost crazy, methods when I said I was going to stick to yadm? well, so here is what I still need which yadm doesn't provide (AFAIK):

for some machines, only track some files and directories and remove the others.

for example:

anyways, the problem I described above can probably be solved with chezmoi, but like what I've written on 6th, there are downside(s) with it and I don't like it. I'd rather stick with yadm for now, and try out the hardlink strategy. In any case, once I've figured out an almost-perfect solution that (hopefully) solves all my problems I'll write a gemlog post about it. It may be that there is no such solution that can do so but we'll see.

journal

new journal heading layout. # for each month, ## for each day, and ### for each event

also made the stuff reverse-chronological order

2021-04-14 12:00 +08:00

found several cool more things on gemini:

paste.gemigrep.com - paste and archive text and gemini urls

gmisub - I normally just use Spacewalk or gemreader for feeds in gemini, but this is cool too

Amazing post on SCGI in gemini

discovery.geminiprotocol.com - more cool stuff on gemini

review.treeblue.space - similar to above

2021-04-07 12:00 +08:00

gelim - my new wip line mode Gemini client in go (sr.ht)

2021-04-06 12:00 +08:00

dotfiles

(will write a detailed gemlog post for this)

here's my general dotfile setup/manager timeline:

1. nothing

2. symlink + plain git

3. yadm

4. copy-paste files to repo (with scripts to make it easier)

5. yadm

6. homedir git (with * in .gitignore, and track with `git add -f`)

7. chezmoi

8. yadm

the last 3 from the above are my top 3 preferred options, here are the pros and cons for each:

〈 ~ git 〉

Drew's blog post on this setup

I’ve tried a few solutions over the years, but I settled on a very simple system several years ago which has served me very well in the time since: my $HOME is a git repository

pros:

cons:

〈 yadm 〉

https://yadm.io

basically, your $HOME is a git repository, but wrapped. nothing is tracked until you `add` it, so I think of it as the above method but with more features.

pros:

cons:

〈 chezmoi 〉

https://chezmoi.io

it copies your dotfiles to a separate dir and you can optionally setup git in that dir.

pros:

cons:

read more about this ("complaint"?) and their reasons for it

also see:

full comparison table between various dotfile managers (chezmoi docs)

2021-04-05 12:00 +08:00

lagrange

seen it across the geminispace as well as mentioned in IRC many times, but I didn't give it a go since it was desktop-based... but today I saw some people on #gemini tilde.chat IRC mentioning Lagrange for iOS, immediately I went to skyjake.fi's gemlog and joined the testflight. the only iPad gemini client I've used so far was Elaho, which has similar UI/UX to firefox, it feels smooth and comfortable to use, despite have it lack some features such as subscriptions, importing certs (AFAIK), and sharing identities across different capsules. (I mentioned Elaho when I first tried it out in the 2021-04-01 entry above). here are my first impressions

https://sr.ht/~sircmpwn/gemreader

public instance of gemreader ^ (needs cert)

2021-04-04 12:00 +08:00

golang

started getting into go in january, but at the time I only did some stuff on the Go Tour, and since then I hadn't touched go at all... Today looking at some gemini clients and other software, sometimes urged me to learn go (like, immediately). started looking at simple Gemini server/clients source code and I decided to fork solderpunk's "≈100 lines bare-bones but usable client in Go"[*], refactor it, implement some features like more commands, less(1)-like output, etc, basically a simpler, dumber version of AV-98 in Go. This is also to basically help me learn go with "learning by doing", really excited for this. Will probably start tomorrow

2021-04-03 12:00 +08:00

spartan

wow! did mozz just add support for spartan:// to his HTTP-gemini portal? dang this is amazing, no need to use my terminal with `| less` anymore :P

Gemini Proxy (also spartan now)

read the specs[*] for spartan a bit more carefully today... the way it specifies how inputs are requested is quite interesting. AND guess what... there's inline inputs! (AFAIK) spartan uses text/gemini for its document format, and adds a new input syntax "=:" to replace gemini's 10 INPUT status code. here's an example .gmi served over spartan:// with input:

# normal heading



here goes an input
=: /input-handler friendly text for the input

more normal text

try out here

spartan://mozz.us on proxy

there's a guestbook and also an "echo service" where anything you input will be echoed back to you

problem is, atm, the server.py file[*] doesn't handle inputs (at least not from looking at the code and trying it out), and I would really love to see how spartan://mozz.us do the echo and the guestbook thing, but I don't think it's open sourced

gemini://spartan.mozz.us/spartan_server.py

anyways I think this feels more like a gemlog post, will link to it here when I'm done writing it

2021-04-02 12:00 +08:00

organizing knowledge

Knowledge and resources are really scattered. I was looking into gemini, gopher, irc bots, etc to be specific. One day, when I have the money, time, and energy, I will buy a domain, get a host and sit down and organized all of these things into a single public wiki/notebook...

spartan

I saw mozz's post[*] on his shiny new protocol a few days ago, but only decided to have a look today. looking at the client/server .py files I was like "wow! this seems really lightweight", also, this was the perfect opportunity to install a curl-like program for gemini:// so I decided to use makeworld's gemget[*] and downloaded the two scripts for spartan://.

mozz's post on spartan://

gemget - CLI downloaded for gemini (like curl/wget) - by makeworld (github)

My first stop on the spartanspace is spartan://mozz.us, I also had a play with its cool input "system", then immediately went on to trying out the server. So far everything feels just like gemini, except that this protocol is newer, lighter, and I guess easier to implement. Can't wait to get more into it and create my own server/clients for it!

2021-04-01 12:00 +08:00

super cool gemini

registered on Astrobotany[*] a week ago, and been only using it with amfora[*] on tilde.cafe[*], but today I tried out a gemini from the iPad - Elaho! (will link to it once I find its github repo, forgot atm).

Astrobotany - community garden over gemini://

amfora client on github

tilde.cafe, a "newly" launched, debian tilde

so far browsing the geminispace from Elaho is a super cool and relaxing experience, it seems to be based off firebox. But from what I can see, Elaho doesn't allow you to import certificates, so I created one, logged into Astrobotany and added my current certificate to my account.

all this "gemini apps" and auth with client certs and so cool! can't wait to make my own game or app over gemini

gopher

A week or two ago I started taking a serious look at gopher, reading through every single post on gopher.zone

gopher.zone - Gopher guides - "Highway to the gopher zone"

2021-03-30 12:00 +08:00

flounder

Today I decided to go back, and put my journal and gemlog there until I find a good host for all my online stuff... The one thing that still impresses me is the ability to set custom domains for my flounder site! AFAIK not a single one of any other Gemini hosting providers allow you to do that :/

//flounder.online

Another amazing thing is that I can directly edit from the web! (Although if Editting via Gemini inputs are supported that would be cool) Editting from the web means that I can update my journal/gemlog from any device, which is ideal especially for my journal

/journal/

When I came back, I noticed that WebDAV was replaced with SFTP access! Gosh that's amazing, which means I can script automated updates (if I need any) and 'deploy' to my flounder site immediately :D

medusae.space

The first time I heard about it was from my mastodon timeline, but didn't give it a serious look until today! I was surprised that so many of the things in there look so familiar to me... Like most of the times I'm like "oh, it's this guy", and "oh I know you!"

2021-01-14 12:00 +08:00

first ever gemlog! it's just a hello world (published on flounder)

happy new year

I decided to hate discord