Skip to content

Instantly share code, notes, and snippets.

@kythyria
kythyria / mergebynormals.py
Created December 28, 2019 20:26
Blender merge by normals
bl_info = {
"name": "Merge by Normals",
"author": "Kyth \"Grey Heron\" Tieran",
"version": (0,1,0),
"blender": (2,80,0),
"category": "Mesh",
"location": "View3D Editmode > Vertex > Merge by Normals",
"description": "Merge vertices that have the same position and same custom split normals together"
}
@kythyria
kythyria / hostagecount.lua
Last active February 15, 2023 15:06
Nearly infinite jokers mod for Payday 2
function GroupAIStateBase:has_room_for_police_hostage()
local nr_hostages_allowed = 4
for u_key, u_data in pairs(self._player_criminals) do
if u_data.unit:base().is_local_player then
if managers.player:has_category_upgrade("player", "intimidate_enemies") then
nr_hostages_allowed = nr_hostages_allowed + 1
end
elseif u_data.unit:base():upgrade_value("player", "intimidate_enemies") then
nr_hostages_allowed = nr_hostages_allowed + 1
Falsehoods even programmers believe about filesystems
-----------------------------------------------------
I haven't collected evidence someone baked all of these misconceptions into a single program, but boy howdy
are some of them widespread.
1. Deleting and recreating a file is exactly the same as using `ftruncate` on it.
* Not on FAT, NTFS, or anything suitable as a Linux rootfs.
+ Mozilla Thunderbird at least used to assume this about its profile directory.
#!/bin/bash
# You need the 32-bit libs installed!
# Fedoranoids: glibc.i686 libstdc++.i686
# Debianoids: lib32gcc1
# Also need tmux python3
set -x
steam_user="anonymous"
set +x
steam_user="anonymous"
steam_pass=""
steam_workshopcollection=""
server_hostname="LinuxGSM"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
steamcmddir="${rootdir}/steamcmd"
serverfiles="${rootdir}/serverfiles"
@kythyria
kythyria / sculpter.py
Created January 22, 2017 17:39
Blender reader for SL sculpts
import bmesh
import bmesh.ops
import bpy
import bpy.ops
import itertools
def chunks(l, n):
return [l[i:i+n] for i in range(0, len(l), n)]
def sculpt_mesh_from_coords_wiki_64(data, name, sculpttype, mirror, invert):

Two input strings:

!test1 one_two three_four five
!test2 one\_two three\_four five

With the RTE off, these get sent as

"content": {
 "body": "!test1 one_two three_four five",
@kythyria
kythyria / fizzbuzz-insane.c
Created March 24, 2016 12:29
I decided to join the fun some other people were having with daft fizzbuzz solutions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#define ADDRESS_SPACE 65536
//16 registers, like ARM. r0-r3,r12 scratch, r4-r11 preserved, r13 call stack, r14 destination of BL, r15 PC
// Hole in a context.
@kythyria
kythyria / fedora21-pkg-mumble.patch
Created February 15, 2015 01:19
fedora21-pkg-mumble.patch
From 0e6a5cfe49959da3fa984b9f96bfc4c6660eb028 Mon Sep 17 00:00:00 2001
From: Kythyria Tieran <kythyria@berigora.net>
Date: Sun, 15 Feb 2015 01:10:06 +0000
Subject: [PATCH] Update to Mumble 1.2.8
This is against git://pkgs.fedoraproject.org/mumble.git revision 926d2952df868236260c10c452fa18ad73086f0c
---
...-Qt-AutoConnection-for-BonjourServiceReso.patch | 86 ----------------------
mumble.spec | 8 +-
@kythyria
kythyria / commands.md
Created January 19, 2015 09:13
Command discovery?

When prompted (or when it feels like) the server sends RPL_COMMANDUSAGE:

RPL_COMMANDUSAGE <command> <context> <parameter1> <parameter2> ...

command is the verb in question. context is a hint as to what UI element to attach the command to, or what arguments to deduce when the user enters the command as text.

channel     | Any channel