Skip to content

Instantly share code, notes, and snippets.

View melMass's full-sized avatar
Focusing

Mel Massadian melMass

Focusing
View GitHub Profile
@SuddenDevelopment
SuddenDevelopment / gizmo_button.py
Created December 21, 2022 12:35
Display a 2d button gizmo in the 3dview window for an addon UI
from bpy.types import (
GizmoGroup
)
import bpy
bl_info = {
"name": "POC buttons",
"description": "POC 2D BUTTON script refactored from GP Animator Desk addon",
"author": "Anthony Aragues, P.Świda",
"version": (0, 0, 1),
"blender": (3, 4, 0),

Elon Musk's suspension reversals

The tables below show notable Twitter suspension reversals for each day since Elon Musk took over as owner and CEO.

All dates indicate when the suspension or reversal was detected, and the actual suspension or reversal may have been earlier. For most English-language accounts with large followings, this lag will generally not be longer than a few hours, but for accounts that have a small number of followers or that are outside the networks we are tracking, the difference can be larger, and in some cases an account on the list may have had its suspension reversed before 27 October 2022. These dates will get more precise as we refine the report.

Because of these limitations, this report should be considered a starting point for investigation, not a definitive list of suspension reversals.

@younesbelkada
younesbelkada / shard_weights.py
Last active October 9, 2023 22:17
A script to shard any model on the Hugging Face format
import torch
import os
import json
import argparse
parser = argparse.ArgumentParser(description='Sharding Hugging Face models')
parser.add_argument('--sharding_factor', default=4, type=int, help='Sharding factor - aka how many shards to create')
parser.add_argument('--source_model_path', default="t5-v1_1-xl", type=str, help='Relative path to the source model folder')
parser.add_argument('--sharded_model_path', default="t5-v1_1-xl-sharded", type=str, help='Relative path to the target sharded model folder')
args = parser.parse_args()
@steveruizok
steveruizok / README.md
Last active February 10, 2022 12:34
Add undo/redo JSON patches to mobx-utils deepObserve method.
@esnosy
esnosy / clean_modules.py
Last active January 6, 2022 12:13
Clean Blender addon modules
# Based on https://devtalk.blender.org/t/plugin-hot-reload-by-cleaning-sys-modules/20040
def cleanse_modules():
"""search for your plugin modules in blender python sys.modules and remove them"""
for module_name in list(sys.modules.keys()):
if module_name.startswith(__name__):
del sys.modules[module_name]
# example usage
# This is a sample Python script.
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import aiohttp
event_loop = None
import asyncio
from pprint import pprint
@sindresorhus
sindresorhus / esm-package.md
Last active April 26, 2024 03:53
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@sinkingsugar
sinkingsugar / halide.nim
Created July 2, 2019 05:52
Nim and Haldie
import nimline
import os
static:
let
halideDist = getenv("HALIDE_DIST")
assert halideDist != "" , "HALIDE_DIST environment variables not set!"
when defined windows:
@jedypod
jedypod / README.md
Last active February 29, 2024 20:33
Nuke ffmpeg Render

Nuke ffmpeg Render

Writeffmpeg is a python script and a node that allows you to render from Nuke directly into ffmpeg. Instead of a 2 step process where you render from Nuke to a temporary image sequence that you then transcode using ffmpeg, this solution writes to a single uint16 cache tiff file and this data gets piped into ffmpeg.

I've included a little screen recordingto help demo how it works.

Files

ffmpeg_render.py Writeffmpeg.nk

Dependencies