Skip to content

Instantly share code, notes, and snippets.

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
fatso83 / NOTES.md
Created Oct 9, 2021
Installing Vagrant on Apple Silicon Macs (M1, M1X, etc)
View NOTES.md

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
fatso83 / StepForm.tsx
Last active Aug 15, 2021
Pay bananas, get monkeys 🤯
View StepForm.tsx
/*
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
fatso83 / state.not.found.error.page.template.html
Created Mar 9, 2021
Velocity template for state.not.found.error.page.template in PingFederate
View state.not.found.error.page.template.html
<!-- This is just to get syntax highlighting:
https://support.pingidentity.com/s/question/0D51W00008BoxciSAB/how-to-customise-page-expired-handling
-->
<!-- So the middle part of the velocity template would look like this -->
<div class="ping-body-container">
<div class="ping-messages">
<div>
The page you are trying to access is no longer available.
</div>
</div>
View PascalCase and kebab-case
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
fatso83 / True Group Hacks.md
Last active Mar 30, 2021
Oslo Kommune Barnehager TrueGroups: merk alle beskjeder som lest
View True Group Hacks.md

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: https://github.com/fatso83/truegroupshacks

View .profile
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
export VISUAL='vim'
export EDITOR='vim'
export PYTHONSTARTUP="$HOME/.pystartup"
View gist:85a4934f6fe25ff34af389c4104ad14c
# based on https://medium.com/@henatyokotraveler/convert-json-file-with-line-break-to-csv-with-jq-command-577fe88c5bc1
# but cleaned non-copy-paste friendly ligatures and injected spaces
jq '.some.filter | @csv' | sed 's/\\\\/\\/g' | sed 's/\\\"/\"/g' | sed 's/^"//g' | sed 's/"$//g'
View teamcity-agent.service
[Unit]
Description=Teamcity agent full
[Service]
Type=simple
User=carlerik
Environment=JAVA_HOME=/home/carlerik/.sdkman/candidates/java/12.0.0-open
ExecStart=/home/carlerik/apps/teamCityBuildAgentFull/bin/agent.sh run
ExecStop=/home/carlerik/apps/teamCityBuildAgentFull/bin/agent.sh stop
View generate-build-info.js
#!/usr/bin/env node
/* eslint-disable no-console */
const appInfoFile = `${__dirname}/../src/appinfo.js`;
const async = require('async');
const cp = require('child_process');
const fs = require('fs');
const exec = cmd => cb => cp.exec(cmd, (err, stdout, _stderr) => cb(err, ('' || stdout).trim()));
View DetailedLogsOnFailureRule.java
package testutil.rules;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.AppenderBase;
import org.junit.rules.ExternalResource;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;