Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
fuxingloh / Bip32Patch.test.ts
Created April 5, 2021 06:25
Bip32Path TypeScript
import { BIP32Path } from '../../src/utils/bip32_path'
describe('fromPathArray()', function () {
it('should work with proper input', function () {
const bipPath = BIP32Path.fromPathArray([44 | 0x80000000, 1, 1, 0])
describe('toPathArray()', function () {
fuxingloh / intellij-markdown.css
Created December 11, 2020 06:15
Ultra simple white theme markdown for IntelliJ
body {
filter: invert(1);
background: #fff;
img {
filter: invert(1);
fuxingloh /
Created September 21, 2020 09:19
Setup Docker & Docker-Compose on AWS Lightsail Amaozn Linux 2
sudo yum install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
sudo curl -L$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
fuxingloh /
Created April 17, 2020 07:36
Selectively Patch Data with Jackson ObjectMapper in Spring Web & Spring Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Data {
@Column(length = 255, updatable = false, nullable = false, unique = true)
private String id;
fuxingloh /
Created January 21, 2020 06:47
Thread.sleep with checked InterruptedException wrapped in unchecked.
package dev.fuxing.utils;
import java.time.Duration;
* Created by: Fuxing
* Date: 20/8/18
* Time: 6:43 PM
public final class SleepUtils {
fuxingloh /
Created January 21, 2020 06:46
JsonUtils is basically a singleton ObjectMapper that wraps all JSON Error into {@code JsonException}. There are also a bunch of helper method for parsing collections.
package dev.fuxing.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.fasterxml.jackson.databind.type.MapType;
import dev.fuxing.err.JsonException;
fuxingloh /
Last active October 14, 2021 01:08
A list of minimal effort image storage, transformation and delivery.

Minimal effort image storage, transformation and delivery.


  • Storage: You upload to S3
  • Delivery + Transformation: CloudFront -> API Gateway -> Lambda (Node, Sharp/Thumbor) -> S3
  • CloudFormation: 1 click and fill up some fields.
  • Only predefined S3 Bucket, no dynamic bucket routing.
  • Transformation is encoded into Base64 that can be generated by anyone. You can add Signed URL but it's quite troublesome.
fuxingloh /
Last active February 2, 2020 10:10
An idea on procedural content generation for games with alteration/grieving/modification.


Basically the game No Man's Sky UPS was a world with infinite possibility. I was very excited about the release of such a game because it created new possibility in games and might even inspire some one to do it better. The game flopped on release but the concept was unique, I was excited of what's to come. Fast forward 3 years later, still very little innovation in such genre.

Two incident caught my attention recently, Minecraft 2b2t and Sky Citizen.

Minecraft 2b2t server is a good example of maintaining a world with infinite possibility. 4000 GB of data, and <100 players can be on it at a time.