Skip to content

Instantly share code, notes, and snippets.

@StephanTLavavej
StephanTLavavej / videos.md
Last active May 22, 2024 02:46
C++ Videos by Stephan T. Lavavej
import { NodeRuntime } from "@effect/platform-node";
import { Schema } from "@effect/schema";
import { SqsLive, SqsService } from "@repo/shared/src/Sqs";
import { Chunk, Console, Effect, Option, Stream, pipe } from "effect";
import { logError, logInfo } from "effect/Effect";
import { Consumer } from "sqs-consumer";
function makeStream<T, U>({
queueName,
@wtbarnes
wtbarnes / push-to-someone-elses-pr.md
Created March 5, 2020 04:49
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

@realvjy
realvjy / ChoasLinesShader.metal
Last active May 22, 2024 02:43
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 22, 2024 02:42
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dpfoose
dpfoose / in_docker.py
Last active May 22, 2024 02:42
Get the path on a Docker host from a path in a Docker container if the path is in a bind-mounted volume
'''
Copyright (C) 2018 by Daniel Foose
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE
'''
import re
import docker
@GuillaumeDesforges
GuillaumeDesforges / Pairwise ranking for newbies.ipynb
Last active May 22, 2024 02:41
Pairwise ranking for beginners (CRASHES)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ScriptAutomate
ScriptAutomate / setup-macinbox-mojave.sh
Created August 19, 2021 00:26
Setup macinbox / MacOS Virtualbox VM via Vagrant on MacOS 10.14.x Mojave Host
# ==Prereq==
# Download from app store:
# https://apps.apple.com/us/app/macos-mojave/id1398502828?mt=12
# Output file:
# /Applications/Install\ macOS\ Mojave.app
# On a Mac host, install macinbox
# This is if using VirtualBox for virtualization
# https://github.com/bacongravy/macinbox
sudo gem install macinbox
import torch
import torch.nn as nn
import torch.nn.functional as F
def lengths_to_mask(lengths, max_len=None, dtype=None):
"""
Converts a "lengths" tensor to its binary mask representation.
Based on: https://discuss.pytorch.org/t/how-to-generate-variable-length-mask/23397
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active May 22, 2024 02:37
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9