Skip to content

Instantly share code, notes, and snippets.

@smoketh
smoketh / factorio_book_item_totals.py
Created August 1, 2023 11:54
Factorio book blueprint totaller
import zlib
import base64
import json
fstr = "" #your string without first byte
lstr = base64.b64decode(fstr)
mstr = zlib.decompress(lstr)
table= json.loads(mstr)
nItemLst={}
#%%
#imports
from string import ascii_uppercase
import numpy as np
from PIL import Image
import cv2
from numpy import asarray
import os
#%%
import bpy
from bpy.types import Operator
from bpy.props import EnumProperty
from mathutils import Color
bl_info = {
'name': 'Convert Vertex Color to Weights',
'author': 'Chebhou on StackExchange, refactor by aliasguru',
'version': (0, 1, 0),
'blender': (2, 7, 5),
// ==UserScript==
// @name EDSA Blueprint style
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://a.teall.info/edsa/*
// @icon https://www.google.com/s2/favicons?domain=teall.info
// @grant GM.getValue
// @grant GM.setValue
#%%
import sqlite3
import json
#https://github.com/EDDiscovery/EliteDangerousCore/blob/master/EliteDangerous/EliteDangerous/EstimatedValues.cs#L23
#def valScan
#public ScanEstimatedValues
#(DateTime utc, bool isstar , EDStar st, bool isplanet, EDPlanet pl,
# bool terraformable, double? massstar, double? massem)
using UnityEngine;
using System.Collections;
[System.Serializable]
public struct IntVector2{
public int x;
public int y;
public static IntVector2 zero = new IntVector2(0,0);
public IntVector2(int X, int Y)
@smoketh
smoketh / double_team.ino
Created May 24, 2015 16:24
Genesis+famicom controller hookup
/*
* Sega Controller Reader
* Author: Jon Thysell <thysell@gmail.com>
* Version: 1.1
* Date: 9/29/2014
*
* Reads buttons presses from Sega Genesis 3/6 button controllers
* and reports their state via the Serial connection. Handles hot
* swapping of controllers and auto-switches between 3 and 6 button
* polling patterns.
#include <Arduino.h>
const int data = 2;
const int latch = 3;
const int clock = 4;
const int TICK = 2;
int pVal;
int nVal;
from asyncio.windows_events import NULL
bl_info = {
"name" : "Align utils",
"description": "A module for hastly aligning one object to enough either with quick align or full align",
"author" : "Smoke Fumus <smokethehedgehog@gmail.com>",
"version": (0,1),
"blender": (2,74,0),
"location": "Spacebar > Align util",
"warning": "",
"wiki_url": "none yet",