Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"github.com/The-Tensox/erutan/cfg"
erutan "github.com/The-Tensox/erutan/protobuf"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"io"
@louis030195
louis030195 / Dockerfile
Created April 30, 2020 15:25
Simulate Apache Kafka changes safely and cleanly before doing it in production
FROM debian:9
# Wget, ps, java
RUN apt-get update && apt-get install -y wget procps default-jdk
ENV KAFKA_VERSION=1.1.1
ENV KAFKA_DIRECTORY=kafka_2.12-${KAFKA_VERSION}
# Current version
RUN wget https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/${KAFKA_DIRECTORY}.tgz \
@louis030195
louis030195 / Makefile
Created May 1, 2020 13:50
Makefile to build Unity project for Linux (since Unity doesn't provides any documentation for Linux)
UNITY_PROJECT_PATH ?= $(HOME)/my/path/to/unity/project
NS ?= my_game_name
VERSION ?= 1.0.0
EDITOR_PATH ?= $(HOME)/my/path/to/unity/project
CUSTOM_BUILD_SCRIPT ?= MyNameSpace.MyClass.MyFunction
.PHONY: help build run
help:
@echo ''
@echo 'Usage: make [TARGET]'
@louis030195
louis030195 / diamond.go
Created May 7, 2020 20:28
Diamond square algorithm in Golang
package main
import (
"errors"
"math/rand"
)
// Copy pasta https://gist.github.com/awilki01/83b65ad852a0ab30192af07cda3d7c0b
// Originally was Java, then C# then Go ... have fun
////size of grid to generate, note this must be a
@louis030195
louis030195 / SpawnThingsAboveGround.cs
Last active June 3, 2020 07:15
Unity helper to spawn object above ground or try to spawn objects above ground in a random sphere while keeping a given distance
public static class Spatial
{
/// <summary>
/// Return position above ground relatively from the prefab size
/// Global position
/// </summary>
/// <param name="position"></param>
/// <param name="prefabHeight">Prefab height needed in order to place well on top of ground</param>
/// <param name="transform">Transform parent</param>
/// <param name="layerMask">Layers to ignore</param>
@louis030195
louis030195 / visual-vxlan.md
Last active October 24, 2020 16:35
How VxLAN works

edit at

@louis030195
louis030195 / Value.cs
Last active October 7, 2020 19:02
Automatic differentiation in 3 languages
using System;
using System.Collections.Generic;
using System.Linq;
public class Value
{
public double Data { get; set; }
public double Gradient { get; set; }
private Action _backward;
private readonly List<Value> _prev;
@louis030195
louis030195 / readwise.ipynb
Last active November 8, 2020 19:55
Readwise API usage
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@louis030195
louis030195 / quotestovector.ipynb
Last active November 8, 2020 17:23
Use deep learning to turn Readwise quotes into vectors and visualize the distances between each-other
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@louis030195
louis030195 / quotesnearestneighbour.ipynb
Last active August 28, 2024 22:28
Nearest neighbor search on Readwise quotes using FAISS and HuggingFace tools
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.