Skip to content

Instantly share code, notes, and snippets.

View olso's full-sized avatar
Working from home

Martin Olsansky olso

Working from home
View GitHub Profile
olso / my-spotify.json
Last active July 5, 2023 08:51
sziget festival 2023 music artists (376) - created 04.07.2023
olso / LottieWebReact.tsx
Last active January 19, 2023 01:38
Lottie web example with react, styled components, hooks, typescript, ssr, without memory leaks (hopefully)
import * as React from "react";
import styled from "styled-components";
import lottie from "lottie-web";
import { up } from "styled-breakpoints";
import { isServer } from "client/consts/env";
const Container = styled.div`
width: 100vw;
height: 100vh;
olso / gist:78634c1f87f523fbcf5455c1b4e4fc52
Created June 24, 2020 11:12
Gitlab multiple runners on the same host and limit one job per runner, due to node module caching. Also separated runner per repo
concurrent = 4
check_interval = 0
session_timeout = 1800
name = "hoeapp"
url = ""
token = ""
docker run --rm \
-v `pwd`/src:/game \
--env GOOS=js --env GOARCH=wasm \
golang:1.12-rc \
/bin/bash -c "go build -o /game/game.wasm /game/main.go; cp /usr/local/go/misc/wasm/wasm_exec.js /game/wasm_exec.js"
<!DOCTYPE html>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script type="text/javascript" src="./wasm_exec.js"></script>
<script type="text/javascript">
async function run(fileUrl) {
try {
package main
import (
var (
// js.Value can be any JS object/type/constructor
window, doc, body, canvas, laserCtx, beep js.Value
func main() {
// declare renderer at compile time
var renderer js.Func
// looks like JS callback, right 😌
renderer = js.FuncOf(func(this js.Value, args []js.Value) interface{} {
// for the 60fps anims
window.Call("requestAnimationFrame", renderer)
func main() {
// creates empty channel
runGameForever := make(chan bool)
// attempt to receive from empty channel
// since noone ever sends anything on it, it's essentially a blocking forever operation
// we basically have a daeomon/service/background program
func updatePlayer(event js.Value) {
mouseX := event.Get("clientX").Float()
mouseY := event.Get("clientY").Float()
// basically threads/async/parallelism
// TODO difference with Web Workers
// TODO difference with Service Workers
go log("mouseEvent", "x", mouseX, "y", mouseY)
1. resend all rides to your email throught app (manual clicking but not so bad)
2. in gmail, go to settings and disable conversation mode view
3. select all emails from bold and right click to send as attachement
4. send this email to yourself
5. download all attachements
6. (optinal) revert settings in step 2.
download invoices using bash:
for f in * ; do
URL=`grep -roh "$f" -e 'https:\/\/\/[^"]*'`