resp = $this->call(Endpoints::ABOUT_LANGUAGES->value)->get();
// We got a response from endpoint
if ($this->resp->ok) {
$this->languages = $this->resp->json();
$this->total_bytes = array_sum($this->languages);
}
}
// Return all languages as (string) language => (int) language_bytes
public function all(): array {
return $this->languages;
}
// Return percent of total for all languages
public function get_percent(string $lang, int $mode = PHP_ROUND_HALF_UP): int {
return round(($this->languages[$lang] / $this->total_bytes) * 100, 0, $mode);
}
// Return language bytes as percent of whole
public function get_percent_str(string $lang): string {
$percent = $this->get_percent($lang, PHP_ROUND_HALF_DOWN);
return ($percent > 1 ? $percent : "<1") . "%";
}
// Return languages bytes as a multiple-byte decimal unit
public function get_bytes_str(string $lang): string {
$bytes = $this->languages[$lang];
// Calculate factor for unit
$factor = floor((strlen($bytes) - 1) / 3);
// Divide by radix 10
$format = $bytes / pow(1000, $factor);
return round($format) . " " . BYTE_UNITS[$factor];
}
};
?>
Hi, I"m
Victor Westerlund
I​'m a full-stack web developer from Sweden.
I used to list the <programming/markup/command/whatever>-languages here that I use the most and order them by guesstimating how much I use each one. But then I thought it would be better to just show you instead using this chart that automatically pulls the total bytes for each language from my public mirrors and sources on Forgejo.
= $langs->get_percent_str($lang) ?>
= $lang ?>
= $langs->get_bytes_str($lang) ?>
= VV::embed("public/assets/media/icons/chevron.svg") ?>This site and all of its components are 100% free and open source software. The website is designed and built by me from the ground up using my web and API frameworks as the foundation. You will find no cookies or trackers here. The only information I have about you is your public IP-address and which resources on this site your browser requests. None of this data is used for any kind of analytics.
See detailed information about all servers/services on this domain
Coffee, of course.. and..
At times, I become a true, amateur, armchair detective for a variety of your typical-nerdy topics that I find interesting. And will spend a disproportionate to real-world-personal-use amount of time reading about that stuff too.
Another silent passion of mine that comes out every few years is building computers and fiddling with weird networking stuff.
And then of course I don't mind some occational gaming, and watching movies and TV-series.
Here are some projects I'm working on right now:
* Vegvisir: A web navigation framework for PHP.
* Reflect: A REST API framework for PHP developers.
There is more stuff on my works page and even more stuff on my Codeberg profile.
I have given up GitHub for their increasing number of injustices againts its users, last betrayal being GitHub's for-profit "Copilot" product which was illegaly trained on copylefted software on its platform.
I signed up and started using GitHub before I became aware of how opressive to to its users and deceptive their business model is. I wasn't aware of the situation.
While I am a bit skeptical to do this in case history repeats itself; [most of] my work is now on Codeberg instead. Unfortunately some things like old pull-requests, issues, and branch archives can not be migrated completely.
Let's work on something together or just have a chat? Write me a line!