Skip to content

Instantly share code, notes, and snippets.

@ali1234
ali1234 / infinite.py
Last active Nov 27, 2021
Blender Infinite Backups
View infinite.py
bl_info = {
"name": "Infinite Backups",
"author": "Alistair Buxton <a.j.buxton@gmail.com>",
"version": (1, 0),
"blender": (2, 80, 0),
"doc_url": "https://gist.github.com/ali1234/415c5ac863c5649c41a22fe061351a22",
"tracker_url": "https://gist.github.com/ali1234/415c5ac863c5649c41a22fe061351a22",
"category": "System",
}
View tray.scad
// [ 56.0, 4*62.0, 48.0, 0.6 ], // WHAM 5.04 outer side large
// [ 56.0, 2*62.0, 48.0, 0.6 ], // WHAM 5.04 outer side small
// [ 56.5, 63.5, 48.0, 0.6 ], // WHAM 5.04 inner
// [ 56.5, 62.5, 48.0, 0.6, [0.125, 0.5, 0.25, 0.125] ], // WHAM 5.04 outer
$fs = 0.1;
module fillet(r) {
@ali1234
ali1234 / SoundMgr.cpp
Created Mar 10, 2021
Wave sound playerback manager for 32Blit
View SoundMgr.cpp
// hpp
#pragma once
#include <cstdint>
#include "32blit.hpp"
enum Sound {
BlockSmash,
@ali1234
ali1234 / mpbridge.py
Created Feb 27, 2021
32blit multiplayer bridge (doesn't work)
View mpbridge.py
import click
import pyudev
import socket
import serial
import serial.threaded
class Worker(serial.threaded.Protocol):
def __init__(self, socket):
self.socket = socket
@ali1234
ali1234 / burn.cpp
Last active Jan 31, 2020
image retention test. don't run this.
View burn.cpp
// Tearing test
#include "32blit.hpp"
uint16_t width = 160;
uint16_t height = 120;
uint32_t prev_buttons = blit::buttons;
uint32_t updates = 0;
View update
// Update test
#include <unistd.h>
#include "32blit.hpp"
#include "../../../../../../usr/include/zconf.h"
uint16_t width = 160;
uint16_t height = 120;
uint32_t prev_buttons = blit::buttons;
View tearing.cpp
// Tearing test
#include "32blit.hpp"
uint16_t width = 160;
uint16_t height = 120;
uint32_t prev_buttons = blit::buttons;
void init(void) {
blit::set_screen_mode(blit::lores);
View keybase.md

Keybase proof

I hereby claim:

  • I am ali1234 on github.
  • I am ali1234 (https://keybase.io/ali1234) on keybase.
  • I have a public key whose fingerprint is ADFD E886 043E 00DA F5ED 052C 4B13 38E2 0316 1411

To claim this, I am signing this object:

@ali1234
ali1234 / blender-script.py
Created Oct 29, 2018
A Python script which runs itself inside Blender upon being run from the command line. Passes through command line arguments.
View blender-script.py
#!/usr/bin/env python3
import sys
try:
import bpy
except ImportError:
print('Running myself inside Blender')
import subprocess
exit(subprocess.call(['blender', '--background', '--python', __file__, '--'] + sys.argv))
@ali1234
ali1234 / notify-when-done
Created Oct 15, 2018
Bash script to time a long running command and display a notification when it finishes.
View notify-when-done
#!/bin/bash
SECONDS=0
"$@"
e=$?
if [ $? -eq 0 ]; then
RESULT="Succeeded"