frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Build or Buy. Grind or Automate

https://jeffersonheard.ghost.io/build-or-buy-grind-or-automate/
1•mooreds•1m ago•0 comments

I made a React Native Drag and Drop library that finally works!

1•entropyconquers•2m ago•0 comments

Principle of Indifference

https://en.wikipedia.org/wiki/Principle_of_indifference
1•liberian•3m ago•0 comments

Show HN: Sokuji – Real-time speech-to-speech translation for Meet, Teams, Zoom

https://chromewebstore.google.com/detail/sokuji-ai-powered-live-sp/ppmihnhelgfpjomhjhpecobloelicnak
1•jiangzhuo•4m ago•0 comments

AI Digests, Visualization or Chat with Any Repo in Seconds

https://gitscape.ai/
1•jmachete•6m ago•1 comments

Kotlin, Swift, Compared (2024)

https://crustlab.com/blog/kotlin-vs-swift/
1•colinprince•10m ago•0 comments

EU's new rules will shake up Android update policies

https://www.androidpolice.com/eu-new-rules-will-shake-up-android-update-policies/
1•speckx•10m ago•0 comments

Visual terminal – which combines various resource catalogs

https://www.patreon.com/Spheres_live
1•healthsphere•12m ago•0 comments

I Quit AWS

https://why-i-quit-aws.ca/
1•skatastropy•13m ago•0 comments

Live coded vector search engine w/ filtering (Colab notebook)

https://colab.research.google.com/drive/1H9BRpnORLTygEGemq5sH2BocUDqSThek
1•softwaredoug•16m ago•0 comments

Constellation, Meta Sign 20-Year Deal for Nuclear Energy in Illinois

https://www.constellationenergy.com/newsroom/2025/constellation-meta-sign-20-year-deal-for-clean-reliable-nuclear-energy-in-illinois.html
2•toomuchtodo•16m ago•2 comments

America's Gratuitous Fiscal Crisis

https://www.nytimes.com/2025/06/03/opinion/us-debt-trillions.html
1•roehmer•17m ago•0 comments

American Interest in EVs Plummets to Lowest Level Since 2019

https://gizmodo.com/american-interest-in-evs-plummets-to-lowest-level-since-2019-2000610247
3•rntn•17m ago•0 comments

Ask HN: Should every person or brand have their own AI agent?

2•tonymanh•19m ago•1 comments

Sosal: Revolutionary Social Programming Methodology

https://medium.com/@xbt573/sosal-revolutionary-social-programming-methodology-4ff635938cd9
1•mifydev•21m ago•0 comments

Built a tool that helps creators launch courses without the overwhelm

https://coursefusion.co.uk
1•rimamrib•21m ago•1 comments

An exploration the archeological roots of the BPFDoor Linux malware

https://haxrob.net/bpfdoor-past-and-present-part-1/
1•speckx•21m ago•1 comments

I vibe coded Gumloop in a weekend

https://composio.dev/blog/i-vibe-coded-gumloop-in-a-weekend/
2•lordfuckleroy•22m ago•0 comments

Your Manager Is Not Your Best Friend

https://blog.staysaasy.com/p/your-manager-is-not-your-best-friend
2•jger15•24m ago•1 comments

How to deploy a Dockerized Ruby on Rails application using Kamal [video]

https://www.youtube.com/watch?v=9nRY0p2br28
1•RubyMine•25m ago•0 comments

Show HN: I made a site to mass-produce UGC short videos – it was hard

https://viralbatch.com/
2•preetramsha•27m ago•0 comments

Scrambling Up the Supply Chain

https://blog.supermechanical.com/2025/05/13/scrambling-up-the-supply-chain/
2•jkestner•28m ago•0 comments

Show HN: I made an AI tool to reverse engineer why Shopify users don't convert

https://journwise.com
2•sonofniya•29m ago•0 comments

Promptwatch

https://promptwatch.com/
1•handfuloflight•31m ago•0 comments

A Small Mexican Town Became My Template for the Ideal Place to Live

https://fortelabs.com/blog/how-a-small-mexican-town-became-my-template-for-the-ideal-place-to-live/
1•smartmic•35m ago•0 comments

The AI Shift Is Real – But Senior Engineers Are Slow to Adapt

https://kanyilmaz.me/2025/05/30/code-evolution.html
1•thellimist•36m ago•0 comments

Sephera: Powerful Code Analyzer CLI

https://github.com/Reim-developer/Sephera
2•reimdev•37m ago•1 comments

'We Irish were never homogeneous. Always hybrids, always mongrels'

https://www.irishtimes.com/politics/2025/05/31/we-irish-were-never-homogeneous-always-hybrids-always-mongrels/
2•keepamovin•37m ago•1 comments

Soot World – spatial directory of images, videos, websites and moodboards

https://play.soot.com/sootworld
1•microflash•40m ago•0 comments

Everyone I know is worried about work

https://rojospinks.substack.com/p/everyone-i-know-is-worried-about
2•pavel_lishin•42m ago•0 comments
Open in hackernews

Show HN: Moon Phase Algorithms for C, Lua, Awk, JavaScript, etc.

https://github.com/oliverkwebb/moonphase
65•oliverkwebb•1d ago

Comments

ericpruitt•1d ago
I adapted the same moonphase logic for the status line program I use with dwm. Did you run into any discrepancies with using January 0 vs December 31st? Some of the translations of Walker's as noted in my comment at https://github.com/ericpruitt/emus/blob/ea059239845ee6d57614... seem to produce differing results.
oliverkwebb•1d ago
This discrepancy with time is explained in the book the algorithm is based on (Practical Astronomy with Your Calculator, which also does a good job explaining a ton of other ideas and models in astronomical calculation).

January 0th makes sense because a year starts on January 1st. You count days of the year from 1 instead of from 0. So if we are going by the day of the year, day 1 of the year should be Jan1, the consequence of this being that Jan0 exists and is Dec31 of the prev year.

I originally got into this because of my status bar on i3, hacking together C code from moontool into https://github.com/oliverkwebb/moontool about a year back.

rybosome•1d ago
Fun! From the repo[0]:

> Your function must be self-contained, such that someone could copy-paste it into their code and not get an error. It also must not effect the environment outside it if at all possible (no #define or mutating globals). It must be as "pure" and self-contained as the language will allow.

This is an interesting restriction, actually, with respect to style. The “natural” way I would program such an algorithm certainly doesn’t adhere to this requirement.

Producing functions that are still correct, idiomatic and legible while producing minimal changes to environment or state requires a non-beginners understanding of the runtime nature of the language.

[0]: https://github.com/oliverkwebb/moonphase?tab=readme-ov-file#...

danparsonson•1d ago
Could you elaborate on this? Maybe an example of what you mean?
oliverkwebb•1d ago
This is also interesting for speed, The algorithms ran by all the impls are identical, but sacrificing speed for cleanliness and adherence to spirit is done regularly.

Without having actually measured, the rust impl probably runs faster than the C impl, but that's not because rust is "faster" than C. That's because I used a closure with one call to floor() for modulus in rust, whilst in C I did 2 fmod()'s to get it because the alternative would've been to make the code unreadable or add a second function/macro (although thinking about it now, undef does exist...)

blululu•1d ago
This is really nice. My initial thought was "why just divide the time interval since the Unix Epoch by the synodic period of the moon". Turns out the moon's phase is a bit more complicated than that. https://en.wikipedia.org/wiki/Lunar_phase#Calculating_phase
madcaptenor•1d ago
That said, this is basically what the Hebrew calendar does (although of course they use a much earlier epoch)
o11c•1d ago
`pom(6)` from `bsdgames` might already be installed on your system to do this. Source comments indicate it was originally based on prior versions of the same book but updated to the Third Edition in 1998.

For "implement simple task in many languages" you should probably think of Rosetta Code, now at https://rosettacode.miraheze.org/wiki/Rosetta_Code

lifthrasiir•1d ago
This code consistently converts angles to the [0, 360) range, which is IMO overkill. A better approach is to normalize everything to [0, 2) range so that you can simply multiply or divide by pi to get the radians. If your math library has `sinpi` or `cospi` it will be even more accurate, as it no longer has to divide by 2pi to do the actual calculation.
librasteve•1d ago
made a PR for raku, hope it gets accepted

some cool things stood out:

  sub fixangle($a) { $a mod 360 }    # raku has built-in support for Euclidean modulo
  pi                                 # raku has pi
  
  # Solve equation of Kepler
  my $e = $M; 
  my $delta;

  repeat {                           # raku's repeat loop allows initialisation of delta to be folded in
    $delta = $e - $eccent * sin($e) - $M; 
    $e -= $delta / (1 - $eccent * cos($e));
  } while abs($delta) > 1e-6;
eddyg•1d ago
Thanks! (I'm a big fan of Raku; it doesn't get nearly the respect it deserves!)
oliverkwebb•23h ago
Thank you! I accepted it
librasteve•23h ago
yay - it has made it to raku module status https://raku.land/zef:librasteve/Moonphase
anthk•1d ago
AWK can be far more than a DSL.
kbr2000•22h ago
LCAL[0]: The Moon Phase Calendar Program

A PostScript program to visualize a calendar of moon phases (skip down to "LCAL PostScript Calendar Examples" for just that). Did some nice PS prints recently for the next 10 years, adapted to fit in a frame I had laying around.

[0] https://pcal.sourceforge.net/