Skip to content

Instantly share code, notes, and snippets.

View slippycheeze's full-sized avatar

Daniel Pittman slippycheeze

View GitHub Profile
@slippycheeze
slippycheeze / obfuscate.rb
Created April 16, 2011 03:42
Obfuscated Ruby for producing Obfusctated Ruby.
c = "\n !\"#'()*+,./01234678;<=ABCDEGINOPRSTUVY[\\]_abcdefghijlmnopqrstuvxy{|}".split('')
i = <<'EOT' .gsub(/\n/, '').to_i(36)
cuwnbkpknpgvndxhiywcb8v7r6px9dgwojmf4inpx5a0irzlmxiaisomq7ir6zx1yhrkk42gltj7vy
nibeul3djwhv9hy0jcjptfh9vvwmnw3xyn4k32gjflrdbb3f1t1xt3w690js9ri5idnch6f9y1ym6r
a2e9okgnsrofg1ztnq9zdbtfh7qmhy22psuo3cdxv1aaq3bf7q0bv12nj8ld7tshysxekfz8jwmff7
k0okucxt2abkmapldjqb6m2vzo43r3g4j9zscr8svoi3ktv63jddl5dokfgl1rmi9sygylc8jor243
ywnovju7t8kvuf2bpy33zkp6w7k97lok9ymo8shfs9m83rq85snkiex96hjykqkf8noaeap18b2rvo
4vrmdy6a7pm28m5b7ye9e58i0xp89ckgx9xuth43ngwfgmoomp2v5dau2ep3hovpthhmklo47j7ds4
714qvy44hmzk24v95gycadjnqkvrbqqip3k7ap901q0eiuvouweg9mlsm4r6y78rpamf8rlqzltyw8
3uf9qqs9sz0au0hyjicqiu3m5xb40yydj6qfigauo1wlmdctonk3a3e9s5vyhrxqmmck89fsupxprp
@slippycheeze
slippycheeze / raidgroup
Created August 20, 2014 04:34
WeakAura: raid group changed
dye2iaGiuPUKOcnkOWPGIMLG4war7cOIHjfDmOuldi8mGQMguY1KQY2asFdvyCIQ6CcsUhq5FcsvhesPfcvvEiuvMOufxes1gLkXhLQQrkivoPOkRe0mbQ0nrf1oHk(PuPgQOslvq9ujnvu0vHu8vbP4SIkyUIkQ9I0FLkgS6WcSyOspwOAYO0LrSzu4ZcLrdv50cz1csPxlvsZgsUTuA3s8BadxkSCiEUOmDrUoQA7sv67IkY4rf58OswpuvvZhQQY(PPytzsRT0klTYszsRmakPAe(NqXbeyrRXbqbGqzsXbBAx6Rz(GIf25JvtqakhCacqbLYaK9bkfhWt7cOybI8bfuo4Oj4bF(GNdq5GYaK9bEAIwzJYAGkGlMeoLO1CmoTgNplb0YKWPeTYGVepfbuWatHU7EedVaK88YYReoiIfdm9eEKIJqs8ifNBUDsHvO7Ul0D3zaG4royo2H4y10zbe6U7U7okG4bO8sqljehjO01q8mECJHaW3WbZ7NKcheXggilrqYRWaaJimf6U7U7EedVe0sCWaZrtjkHtqlbdUBGkGlcc3y6j8ifHU7U7U7U7iKepsXzaG0gKWGBod0lH1taEmea(gEoYYDiEgpUXqa4BGP7U7U7U7Uq3D3D3jfwHU7oPWk0D3f6U7GeKEoLye6f6U7iKepsX5MBHKcRqHcfkuOqHcfkuOqHcfkuOqHcfkuOqHcfkuOqHcfkuOqHcfkuOqAnOehpaKCbIkjALz35sRX5ZsaTmjCkHMgSbjcTs6Lus0Aq8ueqjJYKwZsbijktALfOtgaFHLIF0AgaFHLwRa8f2CUhaa2a2CU)U7KlxXA5Qhe(2SAkigPd(4ZsaTn7aUaanahGyXO1ma(cBN44fukeu0kNdYseeAIMO1qlFwkIbx0k(qhhMOhMwtirXIrqOmP1exni0AC(SeqlTYYJeKIak0k2nPvsVKsIwXhEbjNZKSSGyeAL0lPKYO1Cbx0MdOhUd64We9W5Ht)DcnDhgC7jeV)WDJMC7eU7
@slippycheeze
slippycheeze / iterm2-send-zmodem.sh
Created June 2, 2020 17:03 — forked from dalei2019/iterm2-send-zmodem.sh
iterm2 send zmodem clone from matthew@mastracci.com
#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
else
@slippycheeze
slippycheeze / iterm2-recv-zmodem.sh
Created June 2, 2020 17:04 — forked from dalei2019/iterm2-recv-zmodem.sh
iterm2 recv zmodem clone from matthew@mastracci.com
#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
FILE=$(osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")")
else
// This is just an excerpt, of course...
namespace CrashLanding {
public class Ticker_MTcounter : Building {
public void DoSpawn(int tickAmt) {
Predicate<IntVec3> validator = (Predicate<IntVec3>) (x => {
foreach (IntVec3 c in GenAdj.OccupiedRect(x, Rot4.North, new IntVec2(3, 3))) {
if (!c.InBounds(this.Map) || c.Fogged(this.Map) || !c.Standable(this.Map) || c.Roofed(this.Map) && c.GetRoof(this.Map).isThickRoof)
return false;
foreach (Thing thing in c.GetThingList(this.Map)) {
if (thing.def.preventSkyfallersLandingOn)
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="XmlExtensions.PatchOperationSafeAddOrReplace" MayRequire="Kompadt.Warhammer.Dryad">
<xpath>Defs/MeditationFocusDef[defName="Natural"]</xpath>
<compare>Both</compare>
<value>
<requiredBackstoriesAny>
<li>
<categoryName>KTDryadGood</categoryName>
<slot>Childhood</slot>
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="XmlExtensions.Conditional">
<xpath>Defs/ThingDef[defName="VFEA_AncientChemfuelPoweredGenerator"]</xpath>
<caseTrue>
<Operation Class="XmlExtensions.PatchOperationSafeAdd">
<xpath>Defs/ThingDef[defName="VFEA_AncientChemfuelPoweredGenerator"]/comps/li/fuelFilter/thingDefs</xpath>
<compare>Both</compare>
<value>
<li MayRequire="Scruffy.Content.ONIAnimals">OxR_Coal</li>
// WTF, why there no kitchen?
[HarmonyPatch(typeof(RoomRoleWorker_Kitchen), "GetScore")]
internal static class RoomRoleWorker_Kitchen__HandleDesignationCategoryChanges {
public static IEnumerable<CodeInstruction> Transpiler(
IEnumerable<CodeInstruction> code,
ILGenerator generator,
MethodBase original
) {
string name = original.ShortDescription();
try {
protected static void OnAfterExecute(NMS.Script.ModFiles modfiles, CancellationToken cancel) {
// gather all the warnings and above from the log
var alerts = modfiles.ExecuteLog
.Where(item => item.Type == LogItemType.Warning || item.Type == LogItemType.Failure)
.ToList();
if (alerts.Any()) {
int warnings = alerts.Where(item => item.Type == LogItemType.Warning).Count();
int errors = alerts.Where(item => item.Type == LogItemType.Failure).Count();
var heading = new StringBuilder("—————< ");
if (warnings > 0) heading.AppendFormat("{0} WARNINGS", warnings);
@slippycheeze
slippycheeze / Freighter-containerh-sceneref.cs
Last active December 4, 2022 19:44
No Mans Sky Freighter HullA ContainerH bugfix - now the venator freighter won't replace an entire ship segment with a broken cargo bubble!
public class Freighter_Containerh_Sceneref: SCModClass {
protected override void Execute() {
Log.AddInformation("Trying to fix the freighter bug where destroying a cargo container changes the entire section...");
var scene = ExtractMbin<TkSceneNodeData>("MODELS/COMMON/SPACECRAFT/INDUSTRIAL/CARGO/CARGOLARGEA.SCENE.MBIN");
// 1. find the bit where the cargo container children are at; a LOCATOR above their MESH data, in this case.
var container = scene
.Children
.Flatten(node => node.Children)
.Where(node => {