Live data from Hacker News

Ask HN: Have you created programs for only your personal use?

news.ycombinator.com

231–240 of 671 posts

Re: Ask HN: Have you created programs for only your personal use?

#231

Yes. And it’s a strange one. I made a program to gender swap any text you put into it and then got a book deal to rewrite and illustrate Fairy Tales. It’s been published around the world. https://genderswappedfairytales.com The idea is to shine a light on the original versions but it also creates a lot of never-written-before characters. A lot of brave princesses and lady-beasts, but also men desperately wanting chil…

The Inclusive Coding Bot (a stupid Github bot that went around Github making pull requests replacing "he" with "they") guy should've talked to you...

https://news.ycombinator.com/item?id=30877930

Re: Ask HN: Have you created programs for only your personal use?

#232
Yes. Scratching your own itch is one of the funnest parts of scripting.

I made simple script that converts DB ids output per line that you'd get from a query into a comma separated line with a one line bash script.

e.g. converts:

1

2

3

to:

1, 2, 3

Since I do a lot of querying it is very helpful. To achieve the same thing in Excel is a fucking nightmare.

The cool part is when I feed it like 50000 lines of input how relatively quick it does it.

alias onelinify="paste -d, -s -"

example usage (on macos): cat db-ids.txt | onelinify | pbcopy

Re: Ask HN: Have you created programs for only your personal use?

#234
Every so often I want to derive a fraction from a decimal value, such as 0.571 => 4/7. The key point is I want good approximations, not exact values. That is, I rather get 4/7 than 571/1000. I had found a tool at one point that did it, but it stopped working, so I made my own.

https://voces.github.io/dec2fract/

Re: Ask HN: Have you created programs for only your personal use?

#235
post #60

I created a program that outputs one of my kid's name if the day of year is even, the other kid's name if it's odd. I use it to determine who's turn it is to take a shower first. They'll argue with me and each other all day long but for some reason they will not argue with the computer.

Install a second shower-head and make them shower together. Parallel processing is your friend here.

Imagine how messy async showering would be?

Re: Ask HN: Have you created programs for only your personal use?

#236
post #160

Hundreds! Doesn't everyone? Most of them are just bash scripts, many of which have now reached a complexity so high that I wish I'd started writing them in a different language but it's too late now. The majority of the rest are Python. Off the top of my head, the most used ones are: * A replacement front-end for "tar" and various compressors * A script to synchronize my music library to a compressed version for play…

> A secure-but-readable password generator I love pronounceable passwords, but there's research indicating that such generators typically produce lower than expected entropy. Do you mind sharing what algorithm you use?

Not OP, but I prefer memorable passwords, thus, correct-battery-horse-staple style passwords in bash: (Install cracklib, or any dict file)

  #!/bin/bash
  pickaword() {
        WORDFREQFILE=/usr/share/dict/cracklib-small;
        WORDLENGTH=$1;
        awk -v wordlength="$WORDLENGTH" 'length($1) == wordlength {print $1}' "$WORDFREQFILE"|shuf|head -n 1;

    }
  [[ ! -z $1 ]] && numWords=$1 || numWords=4
  separator="-"
  count=0
  currentWord=""
  while [[ $count -lt $numWords ]]; do 
    [[ $count != 0 ]] && echo -n $separator
    num=$((3 + RANDOM % 10))
    word=$(pickaword $num)
    echo -n "$word"
    count=$(($count + 1));
  done
  echo ""
Edit: code formatting is hard. Source is: https://gitea.slowb.ro/ticoombs/dotfiles/src/branch/main/bin...

Re: Ask HN: Have you created programs for only your personal use?

#237
post #60

I created a program that outputs one of my kid's name if the day of year is even, the other kid's name if it's odd. I use it to determine who's turn it is to take a shower first. They'll argue with me and each other all day long but for some reason they will not argue with the computer.

has it been more than a year? How does Jimmy feel about going first on Dec 31 (day 365) and Jan 1 (day 1)?

I guess it could be change to count whether if the number of days since Jan 1, 1970 up to today has been odd or even...

Re: Ask HN: Have you created programs for only your personal use?

#239

Yes. Scratching your own itch is one of the funnest parts of scripting. I made simple script that converts DB ids output per line that you'd get from a query into a comma separated line with a one line bash script. e.g. converts: 1 2 3 to: 1, 2, 3 Since I do a lot of querying it is very helpful. To achieve the same thing in Excel is a fucking nightmare. The cool part is when I feed it like 50000 lines of input how re…

On MySql I used group_concat function to do the same thing.

Re: Ask HN: Have you created programs for only your personal use?

#240
For dev-types and general tinker-problemsolver types, that's assumed.

I can't count how many things I've made, most of which I abandoned after I stopped needing them. Sometimes I just make a one line shell script that uses a command line util, and other cases I'll write a bigger "script" (higher level programming language" which often still leverages command line tools.

Post reply on HN