Skip to content

Instantly share code, notes, and snippets.

View louis030195's full-sized avatar

Louis Beaumont louis030195

View GitHub Profile
@pixeldj
pixeldj / screenpipe-build-win.md
Created August 22, 2024 14:24
Building screenpipe for Windows

Building for Windows

Note

These are the steps I used to build screenpipe for Windows. I already had the CUDA Toolkit installed and the CUDA_PATH set to my CUDA v12.6 folder. Replace V:\projects and V:\packages with your own folders.

  • Install chocolatey
  • Install git
  • Install CUDA Toolkit (if using NVIDIA and building with cuda)
  • Install MS Visual Studio Build Tools (below are the components I have installed)
@surprisetalk
surprisetalk / hn-gpt-free.js
Created March 23, 2023 13:00
Userscript to hide any HackerNews story with "GPT" in its title.
// ==UserScript==
// @name HackerNews GPT-Free Feed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides any Hacker News story with "GPT" in its title.
// @author Taylor Troesh
// @include https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
@nythrox
nythrox / do.ts
Last active May 5, 2022 19:17
Typescript do notation (using generator functions)
// user: Either<string, { name: string, age: number }>
const user = doEither(function*() {
// name: string
const name = yield* Right("test")
// age: number
const age = Math.random() > 0.5 ? yield* Right(100) : yield* Left("oopsies")
return {
name,
age
}
@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 / visual-vxlan.md
Last active October 24, 2020 16:35
How VxLAN works

edit at

@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 / json_to_yaml.sh
Last active September 30, 2020 14:53
JSON to YAML, one liner bash
#!/bin/bash
python3 -m venv .my_super_env && # Yeah random name to avoid erasing local virtualenv
source .my_super_env/bin/activate &&
pip install -q pyyaml &&
python3 -c "import yaml, json, sys
sys.stdout.write(yaml.dump(json.load(sys.stdin)))" \
< $1 > $2 || true
# Remove the temporary venv in any case
rm -rf .my_super_env || true
@jcward
jcward / Readme.txt
Created April 14, 2017 15:08
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/[email protected], CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
@tamas-molnar
tamas-molnar / kubectl-shortcuts.sh
Last active June 19, 2024 14:10
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward