Skip to content

Instantly share code, notes, and snippets.

@nerodono
nerodono / Comb.py
Last active April 24, 2024 16:34
Another thing that I did on my phone (omg this was fucking suffering)
from functools import reduce as foldl
import string
import pprint
import builtins
class ParseFail(Exception):
...
def group_fails(message, *fails):
return ParseFail(f"{message}: {fails!r}")
@ih2502mk
ih2502mk / list.md
Last active April 24, 2024 16:34
Quantopian Lectures Saved
go mod edit -module {NEW_MODULE_NAME}
-- rename all imported module
find . -type f -name '*.go' \
-exec sed -i -e 's,{OLD_MODULE},{NEW_MODULE},g' {} \;
@jboner
jboner / latency.txt
Last active April 24, 2024 16:33
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@3dln
3dln / CameraOrbit.cs
Last active April 24, 2024 16:32
A simple Unity C# script for orbital movement around a target gameobject
// A simple Unity C# script for orbital movement around a target gameobject
// Author: Ashkan Ashtiani
// Gist on Github: https://gist.github.com/3dln/c16d000b174f7ccf6df9a1cb0cef7f80
using System;
using UnityEngine;
namespace TDLN.CameraControllers
{
public class CameraOrbit : MonoBehaviour
brew update
brew install nvm
mkdir ~/.nvm
echo "export NVM_DIR=~/.nvm\nsource \$(brew --prefix nvm)/nvm.sh" >> .zshrc
source ~/.zshrc
@luizomf
luizomf / tutorial.txt
Created August 7, 2021 10:51
WSL2 e Docker no Windows 10.
### Tutorial oficial:
https://docs.microsoft.com/en-us/windows/wsl/install-win10
### Passo 1 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
### Passo 2 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
### Passo 3
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active April 24, 2024 16:27
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@kevinkirkup
kevinkirkup / AI_ML_Reference.md
Last active April 24, 2024 16:26
AI/ML Reference
@arshednabeel
arshednabeel / animate_flock.py
Created April 24, 2024 08:35
Animate collective movement of flocks from trajectories.
'''
A simple animation function to animate collective movement of flocks, given trajectory data.
(c) Arshed Nabeel, 2024
'''
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation