Skip to content

Instantly share code, notes, and snippets.

@MagicJohnJang
MagicJohnJang / Prerequisites.md
Last active May 1, 2024 23:05
D3-Sankey on Angular component + Typescript

(It's not a file, do this before using)

  1. Have D3.js v4 implement in your project first.
  2. npm install --save d3-sankey

npm install --save @types/d3-sankey

@Achleshwar
Achleshwar / __init__.py
Created May 1, 2024 22:07
Modified __init__ file for Panopli Lifting Trainer
# Copyright (c) Meta Platforms, Inc. All Rights Reserved
import math
import os
import signal
import sys
import traceback
from pathlib import Path
from random import randint
import datetime
@Achleshwar
Achleshwar / train_panopli_tensorf.py
Created May 1, 2024 22:02
Modified trainer code for Panopli Lifting to support training with PyTorch Ligthning>2.0.0
# Copyright (c) Meta Platforms, Inc. All Rights Reserved
import math
import numpy as np
import scipy
import torch.multiprocessing
from pathlib import Path
import torch
import hydra
@PARC6502
PARC6502 / OpenSourceBaas.md
Last active May 1, 2024 23:03
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@qoomon
qoomon / conventional_commit_messages.md
Last active May 1, 2024 23:00
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@sagarkbhatt
sagarkbhatt / rest-controller-extend.php
Created May 11, 2017 09:16
Sample class that extends WP rest controller
<?php
/**
* Add rest api endpoint for category listing
*/
/**
* Class Category_List_Rest
*/
class Category_List_Rest extends WP_REST_Controller {
/**
@denji
denji / nginx-tuning.md
Last active May 1, 2024 22:58
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@vurtun
vurtun / _GJK.md
Last active May 1, 2024 22:49
3D Gilbert–Johnson–Keerthi (GJK) distance algorithm

Gilbert–Johnson–Keerthi (GJK) 3D distance algorithm

The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.

Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.