Skip to content

Instantly share code, notes, and snippets.

View fmg-lydonchandra's full-sized avatar

Lydon Chandra fmg-lydonchandra

View GitHub Profile
@fmg-lydonchandra
fmg-lydonchandra / inspector.tsx
Last active September 9, 2022 02:36
babylon inspector show debugLayer
import "@babylonjs/inspector";
scene.debugLayer.show({
embedMode: true,
overlay: true
});
export const removeNullsFromList = <T>(list: (T | null)[]): T[] => {
return list.filter((i): i is Exclude<typeof i, null> => i !== null);
}
import { React, window } from "https://deno.land/x/[email protected]/mod.ts";
export type Cycle = {
id: string;
durations?: Record<string, number>;
};
const Box = <div></div>;
const DetailItem = <div></div>;
var store = getReduxStore();
var state1 = store.getState();
console.log(state1);
store.dispatch({
type: 'myType/myAction',
payload: { payloadField: true }
})
@fmg-lydonchandra
fmg-lydonchandra / install_openlens.sh
Created January 18, 2023 04:17 — forked from jslay88/install_openlens.sh
Build and Install OpenLens
#!/bin/bash
install_deps_windows() {
echo "Installing Build Dependencies (Windows)..."
choco install -y make visualstudio2019buildtools visualstudio2019-workload-vctools
}
install_deps_darwin() {
echo "Installing Build Dependencies (Darwin)..."
xcode-select --install
// Online C++ compiler to run C++ program online
#include <iostream>
#include <array>
int main() {
// Latitude Band IDs start from 'C' (i.e. omit 'A' & 'B')
const uint8_t LAT_BAND_ID_TO_MGRS_LETTER_ID_OFFSET = 2;
const char* const MGRS_LETTER = "ABCDEFGHJKLMNPQRSTUVWXYZ";
@fmg-lydonchandra
fmg-lydonchandra / protobuf-serialization.md
Created May 22, 2023 04:53 — forked from kchristidis/protobuf-serialization.md
Notes on protocol buffers and deterministic serialization (or lack thereof)

There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.

Protocol Buffers v3.0.0. release notes:

The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.

Maps documentation:

Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.

@fmg-lydonchandra
fmg-lydonchandra / Program.cs
Created January 20, 2024 19:20
Proxy GRPC
using System.Net;
using System.Threading.Tasks;
using Grpc.Net.Client;
using GrpcGreeterClient;
// var proxy = new WebProxy("http://127.0.0.1:8888");//charles
var proxy = new WebProxy("http://127.0.0.1:8866"); //fiddler
var httpClientHandler = new HttpClientHandler()
{
Proxy = proxy,