Skip to content

Instantly share code, notes, and snippets.

@abul4fia
abul4fia / 00README.md
Last active April 30, 2024 11:44
Working with sections in manim

Working with sections in manim

Manim provides out of the box the possibility of marking parts of your scene as separate sections, by using self.next_section(). This will cause a separate video to be rendered for each section, and then all of them will be stitched together for the final result. The final result will be the same as if you hadn't used sections at all.

But the use of sections allows you to mark some of them with the parameter skip_animations=True, and in that case, that section will not be rendered. The code of the section will be run anyway (because it may be defining objects or variables needed in following sections), but for every self.play(), only the final frame will be computed (and not rendered). This ensures that, at the end of the section, all objects are at the same positions as if the animations were played, but skipping the actual rendering significantly reduces the time required to run the code.

In addition, the resulting video when skip_animations=True is used will be s

@simonster
simonster / attention_distance.py
Last active April 30, 2024 11:43
Mean attention distance
# Copyright 2022 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# Author: Maithra Raghu <maithra@google.com>
def compute_distance_matrix(patch_size, num_patches, length):
"""Helper function to compute distance matrix."""
distance_matrix = np.zeros((num_patches, num_patches))
@veekaybee
veekaybee / normcore-llm.md
Last active April 30, 2024 11:43
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
@gtasnail
gtasnail / pedResetFlags.lua
Created April 11, 2024 22:45
All known ped reset config flags | SetPedResetFlag SET_PED_RESET_FLAG |
PRF_DisablePlayerJumping = 46, -- Disable jumping
PRF_DisablePlayerVaulting = 47, -- Disable climbing / vaulting
PRF_AllowUpdateIfNoCollisionLoaded = 55, -- Don't freeze this ped for not having bounds loaded around it
PRF_DisableSecondaryAnimationTasks = 58, -- Disable upper body animtion tasks such as shove ped and open door anims
PRF_SearchForClosestDoor = 60, -- Will check for the closest door in proximity and store it off
PRF_SupressGunfireEvents = 62, -- Supresses AI generating fire events, so civilians wont be shocked or react, for use in a shooting range for example
PRF_InfiniteStamina = 63, -- Currently just for mounts, but could be expanded to anything with stamina
PRF_BlockWeaponReactionsUnlessDead = 64, -- Stops the ped from reacting to damage events (such as shots / fires, etc). The ped will still take damage while this flag is active. Note: this does not block explosion reactions.
PRF_ForcePlayerFiring = 65, -- Forces player to fire even if they aren't pressing fire
PRF_For
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 30, 2024 11:40 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@alfredlucero
alfredlucero / index.d.ts
Last active April 30, 2024 11:40
Cypress Tips/Tricks - Typing Task Plugin Functions
// Can import types from other files using TypeScript's typed imports functionality
type BlocksDto = import("../plugins/Suppressions/setup").BlocksDto;
// Or you can define the types here as well in this type definition file
type ApiHost = "https://staging.api.com" | "https://testing.api.com" | string;
declare namespace Cypress {
interface Cypress {
// ...environment variables
}
package main
import (
"log"
"time"
"github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/apis"
"github.com/pocketbase/pocketbase/core"
using System.Net.WebSockets;
using System.Text;
Uri uri = new("wss://yabu.me/");
using ClientWebSocket ws = new();
await ws.ConnectAsync(uri, default);
var req = "[\"REQ\", \"_\", {\"kinds\": [1], \"limit\": 10}]";
Console.WriteLine("< " + req);
@Hakkadaikon
Hakkadaikon / NostrSubscription.cs
Created April 29, 2024 15:22
NostrSubscriptionCSharp
class NostrSubscription
{
static void Main(string[] args)
{
string url = "wss://yabu.me";
using (var ws = new WebSocketSharp.WebSocket(url))
{
ws.OnOpen += (sender, e) =>
{