Skip to content

Instantly share code, notes, and snippets.

View fatso83's full-sized avatar
Two toddlers. Very little time for OSS after work hours. File a PR!

Carl-Erik Kopseng fatso83

Two toddlers. Very little time for OSS after work hours. File a PR!
View GitHub Profile
fatso83 /
Created November 20, 2023 05:01 — forked from htr3n/
Creating RAM disk in macOS


diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.


fatso83 / Code Sandbox
Last active June 3, 2023 08:57
Code Sandbox weirdness


Code Sandbox oddities observed while working on LogicRoom exercises does its best to give the impression of a locally running environment, but the abstraction is sometimes a bit leaky. Here's some weirdness (with possible fixes)

Delayed execution of console.log

The console.log statement is actually proxied via a server and executed at a later stage. That sometimes results in weird behaviours, as the value of some field on an object can be different when it is printed than when it was logged ... The fix is making something like this and using that instead:

fatso83 / jane-redirect-prevent.js
Last active August 26, 2022 21:07
This TamperMonkey script will allow you to download manuals from the Concord page without being redirected nilly-willy. Requires TamperMonkey extension in Chrome/Edge/Firefox
// ==UserScript==
// @name Prevent Jane redirect
// @namespace
// @version 0.1
// @description Out-trick the neanderthals responsible for redirecting the Concord customers to the Jane page with JS
// @author Carl-Erik Kopseng
// @match
// @icon
// @grant none
// @run-at document-start
fatso83 / fremtind.js
Last active April 18, 2022 04:47
Bompengeskript Fremtind
/* Used on */
(function() {
const priceCols = document.querySelectorAll('.MuiBox-root div div div:nth-child(3n+1) div:nth-child(1)');
let sum=0;
for(let n of priceCols) {
if( n?.nextSibling?.textContent === 'NOK') {
fatso83 / PublicPlanData.php
Created January 19, 2022 11:54
A fixture example for Symfony where a hardcoded connection is made between a local entity and the Stripe id.
class PublicPlanData extends AbstractFixture implements OrderedFixtureInterface
public function load(ObjectManager $manager)
$planUnlimitedFree = new PlanInfo();
$planUnlimitedFree->setName('FREE UNLIMITED PLAN')
->setDescription('Special plan for users that should never pay for using the service')
fatso83 /
Created October 9, 2021 07:31
Installing Vagrant on Apple Silicon Macs (M1, M1X, etc)

VirtualBox only supports the x86 platform, so the default installation instructions for Vagrant does not work on Apple silicon. Thankfully Vagrant has a VMWare Provider (more on providers here), and so if I can get VMWare running on my M1 MacBook, I should be able to run Vagrant as well!

These are my notes during figuring this out.

Get the VMWare Tech Preview released in September 2021!

We are in luck, as VMWare released this just a few weeks ago.

  • See [their blog entry][1]
fatso83 / StepForm.tsx
Last active August 15, 2021 15:44
Pay bananas, get monkeys 🤯
This is a typical example of a codebase I inherited 😭
I mean, where do I even start ...
- direct DOM manipulation
- toggling display: none instead of not rendering, ...
- unclear data paths and constant heavy lookups
Oh, are you surprised that this stinking pile of shit is full of bugs? Me neither.
#kilowott #ninestack
fatso83 /
Created March 9, 2021 19:35
Velocity template for in PingFederate
<!-- This is just to get syntax highlighting:
<!-- So the middle part of the velocity template would look like this -->
<div class="ping-body-container">
<div class="ping-messages">
The page you are trying to access is no longer available.
Rename kebab-case files to PascalCase and vice versa
- Check the `require()` calls for what to `npm install`
- If you need to modify something else than `*.js` files, just modify the `find` command somewhat
fatso83 / True Group
Last active March 30, 2021 11:57
Oslo Kommune Barnehager TrueGroups: merk alle beskjeder som lest

True Group Hacks

Hvor mange har ikke irritert seg grønn over at det er 317 uleste meldinger i TrueGroups når man logger inn, vel vitende om at man allerede har lest disse på epost? Det finnes jo dessverre ingen "Merk alle som lest" funksjonalitet, så da må man lage det sjøl :)

Dette skriptet finnes nå som eget prosjekt her: