Skip to content

Instantly share code, notes, and snippets.

View akyoto's full-sized avatar

Eduard Urbach akyoto

View GitHub Profile
@akyoto
akyoto / cpu-registers.txt
Last active October 16, 2019 07:56
cpu-registers.txt
Register sizes
--------------
================ rax (64 bits)
======== eax (32 bits)
==== ax (16 bits)
== ah (8 bits)
== al (8 bits)
Register purpose
----------------
@akyoto
akyoto / run.sh
Last active May 28, 2019 04:03
Run wasm locally in Go
GOOS=js GOARCH=wasm go run -exec="$(go env GOROOT)/misc/wasm/go_js_wasm_exec" .
@akyoto
akyoto / terminal-truecolor.sh
Created May 17, 2019 07:28
Terminal Truecolor (RGB 24-bit)
printf "\x1b[38;2;255;128;0mTRUECOLOR\x1b[0m\n"
@akyoto
akyoto / add-go-mod.sh
Created April 22, 2019 08:10
Add go.mod to existing project
export TAG=v0.1.0 go mod init && gb -v && go mod tidy && git add . && git commit -m "Added Go module definition" && git push && git tag $TAG && git push origin $TAG
@akyoto
akyoto / update-docker-images.sh
Created April 6, 2019 09:36
Update all docker images
docker images --format "{{.Repository}}:{{.Tag}}" | grep :latest | xargs -L1 docker pull
@akyoto
akyoto / task.md
Last active June 30, 2018 11:29
notify.moe | Task for new contributors | Make your own page and menu item in the sidebar!

Task for new contributors

This task assumes that you have installed notify.moe already, started the server with the run tool and have the code open in Visual Studio Code.

Step 1: Create a new page

Let's call it foobar. Create a new directory under pages, called foobar. Then create the following files inside it:

  • foobar.go (controller)
@akyoto
akyoto / Diff.ts
Last active June 5, 2018 00:19
Diff and MutationQueue 🍰🥞
import MutationQueue from "./MutationQueue"
// Diff provides diffing utilities to morph existing DOM elements
// into the target HTML string.
//
// Example:
// Diff.innerHTML(body, "<div>This is my new content</div>")
//
// Whatever contents will be in the body, they will be re-used and morphed
// into the new DOM defined by a simple HTML string. This is useful for
@akyoto
akyoto / optimize-ssd.md
Last active May 17, 2018 07:19
Optimize Linux for SSDs
  1. Activate noatime in /etc/fstab
  2. Set vm.swappiness from 60 to 1 in /etc/sysctl.conf
@akyoto
akyoto / http2-push-async-flows.md
Last active March 5, 2018 13:57
HTTP/2 Push async flows

Problem

See Start your pushes before you respond.

Indeed we can fix the problem by pushing before the HTML is sent, however that increases TTFB by a lot and creates a completely new set of performance problems. Therefore we're pushing resources after sending the HTML. When we do that, there are 2 possible async flows that can occur.

Flow under normal network conditions:

  1. Server sends HTML.
@akyoto
akyoto / time-pack.txt
Created October 22, 2017 12:12
notify.moe assets compile time
~/workspace/src/github.com/animenotifier/notify.moe λ time pack
❀ mixins/Input.pixy
❀ mixins/Character.pixy
❀ mixins/FuzzySearch.pixy
❀ mixins/Icon.pixy
❀ mixins/ForumTags.pixy
❀ mixins/Avatar.pixy
❀ mixins/AnimeGrid.pixy
❀ mixins/Japanese.pixy
❀ layout/layout.pixy