Skip to content

Instantly share code, notes, and snippets.

@justarandomgeek
justarandomgeek / fixnames.sh
Last active October 18, 2016 03:34
Fix Factorio Mod Folder Names
#!/bin/bash
for mod in *; do
if [ -d "$mod" ]; then
newmod=`cat $mod/info.json|jq -r '.name+"_"+.version'`
echo $mod $newmod
[ "$mod" != "$newmod" ] && mv "$mod" "$newmod"
fi
done
@justarandomgeek
justarandomgeek / gist:a9d1be69db95ad201aa2186d1a6f25fa
Last active July 13, 2016 03:00
Blueprints as circuit network signals
Signals to/from "digitizer" device placed next to blueprint printer running "edit-blueprint" recipe
Reading a print leaves it in the input inventory
in blueprint: Read print
out blueprint: =1 successfully read, loaded print for editing / =-1 no print loaded =-2 wrong recipe/no adjacent printer
Writing a print destroys the input print and creates a new print in the output based on the edits made
in deconstruction-planner: Write print (move input->output inventory)
out deconstruction-planner: =1 print written / =-1 output full =-2 other print fail
@justarandomgeek
justarandomgeek / burst-of-10.txt
Created July 13, 2016 15:08
Belt that reliably produces bursts of 10 items
H4sIAAAAAAAA/81Y63KbPBB9lQy/IYMwuPG0yotkvmFkWMeaColPEmk8Ht69EsYXzMXypWnzxwmrs7s+Z7W7JBdPTGSEPaV4C1xTTUHh7ZaTArAnxVKUQmrP
L4UyJsHx9hMH4XPib3Awe07q2m+PwmcpQalAS8KVxQRLYOdACwtrP6cSsuZhdB0+PsfHB7yqlkoT+3A42fA02RwymoMMMlEsKSdayC5oZuMYgJ8JrqVg6RLW
5IMKibctNDWWvDlv2FpRqXSq6DsnDG/1pjQhqIbC8ye/W+PeJM01Ds2vRUmkTQV7r54vKl1WN/osNya7iut0JUWRUm4c4RVhCuomIt9xZ/J+85D3H95KyI3i
jfiblOZ47mdUZhXV9g+r0NH0cmpCtXH45kUXfaBxH1Ftf1x1ifa6nFTAgzRaEaWdBcKPF0jLylWfZFwfdE6u/y4B+JS84xom4xqixWXXqCPtnslRbdve0Fdz
RZkGaZvS9eoZknEcLeLF/Fu0SHzKc/jc1a0L0XdUavzVHWTerdAfDhU6Rtq9/SNxbRIThfytw3YBOa2KAJgJLWkWlILBWZufG8KjI8KQkv0MKFcgTfEMjCE0
PEaYeKdKmxDZGgw7Ev6vzOegB5Nwa06PJdpWWMuwJL+CFVVrry3FJAzDk681OetmuxBDs/LijBzBOc/YEXImcVEv7kDt7/U+1P7jhye2pjYMcLJkkOZU2c+m
xx5sEkiergnPbTLaVJ7q2vdPdwcLkUPbni7WP5oYfrZxXtFGAvTcK9YhXr9iK3EZeoeCf8CYQ8ngjEHO8wudbysXvXVHltN1QePX7ZK44Z/TtqNDq+bLv7Rj
uqt4p0B9ff5OW3q9vS01vD6gL03s9fauXUlseN+c6Y8Lp9ndm4rzCTktOalYpaIE2bwaGrhr+29MR4qRG8XRS4fHs22CGPQHBKUUH/ZG9zfG6Ib36fh6Ehvc
7MpY8Y2Y+GQpKwhjASNF2Rd1NrQq33Avhzof6m0Ijmrudv7ap1lzbOIF
@justarandomgeek
justarandomgeek / gist:2c47b4aaee12f717227f867a4c030fae
Last active October 16, 2022 09:49
Factorio Command: Remove all trees in 5000 tile radius
/c
pos = game.player.position
area = {{pos.x - 5000, pos.y - 5000}, {pos.x + 5000, pos.y + 1.5}}
for _, entity in pairs(game.player.surface.find_entities_filtered{area = area, type = "tree"}) do
entity.die()
end
H4sIAAAAAAAA/5W94Y5rx3F2fSuBf9sfWFVd1bsR+FoCxRY+GFAkQ5aBBIbv/VWGnKNzZhhzrX8G8kxOr8VnN6upTe4///RvP/z0p+9++Lf/+OM//vKnn378
2x//8Y+//eX///G7H/74j1/+56/f//F3f/nl+//63e9//O6/fv3ff/vph+9+/sNfv/vx+x9+98/f/+XHP3//33+Mf/7z99//+MtffvnL9//7x/fgD9/97fuf
//DL33/++ftffvf7v/70t1//zz/9+Md//Pcf/xC38//17//n8T9+/WPyJ9v/Sfs/Kf8nYf/kaPqj4Y9mPxr9aPJLk1+a/NLklya/NPm+9F+M/oul/yL1X9zs
X4wmH00+mnw0+Wjy1uStyVuTtyZvTb40x9IcS3MszVH6FSxNXpq8NHlp8tTkqclTk6cmT00emjw0R2iO0Bx+29XXk34x7B9YaPu2bN/47Whhhxc7HoUFDksc
FiEsQ1qGtAxpX7a00GmhSzfVQpeFLgtdFnpZ6GWhl4VelqEtQ+s9xjK0feHaQo+FHgs9Fnos9FjobaG3hd767cRCX/YN9LJv0ZcdAi47Zlx2kDkW+ljoY6GP
hT4WOm56VrpZ7LhZ7rhZ8Lj58fu3TxP313/y9SeVnz5MfORZeql0iPS5TLhNOEX4OiY8JlwivI2NbWxsY2OMjTE2xtiYmwi3aXSbQrfp8zI2lrGxjI0yNsrY
KGMjTZ/T9DlNn8P0OdRmZ2wYGcoFz4rlCg2ibCFaHOLyCCE3hYUUGlJ4KOGhhIcS+0+Jy2KJki1R3hYeWnho4aGFhxEeRngY0d8t+rvNZSz6ewkPl/BwCQ9H
eDjCw1H7mdnQbmZHu32uMDo2bH9saHlsWOrYANMh0u/HBhZuE04Rfj82sPCYcInwNja2sbGNjTE2xtgYY+P92IDCbRrdptBt+ryMjWVsLGOjjI0yNsrYSNPn
NH1O0+cwfQ612RkbRoZywbNiuUKDKFuIFoe4PELITWEhhYYUHkp4KOGh
@justarandomgeek
justarandomgeek / ROMGen.blueprint.lua
Last active December 9, 2017 08:39
CPU kit blueprint book. Requires Foreman, Nixies Tubes, and Color Coding.
do local foo="bar"
--[[ The line above must start with "do local" to be recognized as a decompressed blueprint.
Adjust rombase to control the first memory address the rom is generated for.
Adjust addrsignal below to control memory address signal. Requires a compatible machine, and address signal cannot be stored.
data is array of parameter lists for constant combinators.
strings are converted to serialized frames and appended to data. No terminators are added.
pixeldata is converted and added after strings.
]]
gitH4sIAAAAAAAA/81X7W7bIBR9lcq/7clfaTdV7EWqCRFz06DZYAFuG1m8+7DTNKEhLna2dv3TJHDg3nPPudem4qYWFalvMOpZJbhCfc84hReUxYo9clKjXu9a
QBHT0EQxJ439DC+tBKUSLQlXrZA6WUOtI2PiV3A+Ad4Qpc+RJgaumWYwRHB5Y9wKZ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l6kLZvh7I9BER9Js2XgpgpiNpVyoB1HLleVSh+wJOHfTA
5GZkkvAjKlqsf03Xx6YktR+8bwPzKrwYGRSf7wTpO1Gc68Q71lLNyAh2lYRetCHRt2ua8UHCZ9kcG5J5Ls9KOv8SSW+OGSRDPf/8T3q+PcFoMWJ0QusnSD9e
NAO29/sDOE8TFF/AwgZdoyFo8tHV3SdUcwNldFW8i+Z2cdFALfNbkC6omuDjR0WzPr8EydBklvJTEz3ejhNhflwz5/kXjvn9Z56tQ++XHPKLHqHaMK0zzUw1
/g8ANBZT43uA+kvdom9+wrGWgK2dr3vBTtZ/psYi9UX2sTewp+5zkqP04GWI3q7KB2nFH212kQiXCQAA
H4sIAAAAAAAA/8VW227bMAz9lUCPgzxYbtOh6DQg31EMhiorrQBdDFkKGhj699GXLLFnJ01qdHlSIvKQPDykUtiVspypVU5rya2paF1LU4h3SnAlXw1TtPb7
UlAkvdAIG6bhXAguC+ESbvWLNMxbh2LEvWN2xpFxHnRQvUfEwnjppWiiziLj0lZgZA2t32mSfV/jPU1IxIV0gre/P2DI3Dur8hfxxnbSOlr3QDncFK03xNhK
V/l8mN1OOh+YOiTYXSavTgiDYoNbeWY8TeGoS+aajCj6hbANvgzXgpV7yCcYn2+d1bk0gEC3TFUitqFMVw9k+owI+k1rJwpgpiVpn8sCqOXS8SB9+wWcWuiB
yd3IJOJnlDVY/5quT01JbD64bwNz0r9p4SWf7wTpOpFd6sQRa6lmJATbUkAvmpDo2y3N+CDhs2yODck8lxclnX6JpDenDJKhnn/+Jz3fn2E0GzE6ofUzpJ8u
mgHb/f4AzuMExVewsEG3aAiafHL18AnV3EEZbRVH0dwvLhqoZX4L0gVV4134qGjWl5cgGZrMUn5uosfbcSLMj1vmPP3CMX/8zLN16P2SQ37VI1RpplSimC7H
/wGAxmxqfA9Qf6lb9M2POFQCsJV1VSfYyfov1JjFrsjjnnpMSYrikxM+OLPKn4Qp/gD1enQKlwkAAA==
program: statementlist;
statementlist: statementlist statement | statement;
statement: taglist statementop|statementop;
taglist: taglist tag | tag;
tag: label|site;
label: STRING ':';