Skip to content

Instantly share code, notes, and snippets.

View antonve's full-sized avatar
💨
Building tadoku.app

Anton Van Eechaute antonve

💨
Building tadoku.app
View GitHub Profile
@antonve
antonve / spatial-data-in-go.md
Last active May 16, 2022 08:39
Working with spatial data in Go + PostGIS

Conclusion

In general I'd avoid using any kind of ORM library to work with spatial data in Golang. The query builders aren't made to support more complicated queries using spatial functions. This means you have to fall back to raw sql for certain parts of a query, which results in difficult to read and write code. I had to dive deep into the code of ent & sqlboiler to learn about undocumented behavior in order to write some of the queries in the experiments.

I'd say something like sqlc that generates the boilerplate code for you or raw sql with something like sqlx would be the way to go. There are fewer surprises and there's a lower learning curve when you need to get into a codebase.

Useful libraries

// ==UserScript==
// @name Enter time
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://p.secure.freee.co.jp/
// @icon https://www.google.com/s2/favicons?domain=freee.co.jp
// @grant none
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am antonve on github.
  • I am antonve (https://keybase.io/antonve) on keybase.
  • I have a public key ASDjG1BhXGByxZ75qDyjZjhdr3__vL_Z365Tdjx-QutqKgo

To claim this, I am signing this object:

@antonve
antonve / counter.php
Last active October 17, 2018 15:16
Quick & dirty Syosetsu reader
<?php
$count = 0;
$series = 'n9669bk';
$br = php_sapi_name() === 'cli' ? "\n" : "<br />";
$chapter_range = [
"from" => 10,
"until" => 12,
];
for ($i = $chapter_range["from"]; $i <= $chapter_range["until"]; $i++) {