Skip to content

Instantly share code, notes, and snippets.

View wolfgangmeyers's full-sized avatar

Wolfgang Meyers wolfgangmeyers

  • AiBrush
  • Washington State, USA
View GitHub Profile
@wolfgangmeyers
wolfgangmeyers / BUILD
Last active February 10, 2023 01:39
Eclipse setup script for bazel
java_binary(
name = "annotation_processors_ide",
create_executable = False,
runtime_deps = [
// annotation processor dependencies here
],
)
java_binary(
name = "project_deps",
@wolfgangmeyers
wolfgangmeyers / cachebuster.py
Created February 1, 2016 00:07
Simple python script to add a query string to all css / js files using a unix timestamp to force refresh of static assets.
#!/usr/bin/env python
import time
def cachebust_script_src(line):
src_i = line.find("src=")
begin_src = src_i + 5
end_src = line.find("\"", begin_src)
src_contents = line[begin_src:end_src]
parts = src_contents.split("?")
base_src = parts[0]
@wolfgangmeyers
wolfgangmeyers / gunicorn-killer.sh
Created October 14, 2015 22:51
how to kill a gunicorn
ps aux | grep gunicorn | awk '{print $2}' | xargs kill -9
def sex(partners):
for p in partners:
assert p is not Nun
@wolfgangmeyers
wolfgangmeyers / minetest.lua
Created April 2, 2015 03:36
test strip mine script
-- test strip mine script
os.loadAPI("path")
local DEFAULT_HEIGHT = 5
function isOverBedrock()
if turtle.detectDown() then
local itemName = turtle.inspectDown()
local i = string.find(itemName, ":")
itemName = string.sub(itemName, i + 1, string.len(itemName))
@wolfgangmeyers
wolfgangmeyers / client
Last active August 29, 2015 14:17
Computercraft script - client to control turtle
running = true
modem = peripheral.wrap("back")
modem.open(1)
while true do
io.write(">")
command = io.read()
modem.transmit(0, 1, command)
local event, modemSide, senderChannel,
@wolfgangmeyers
wolfgangmeyers / remote
Last active August 29, 2015 14:17
Computercraft turtle remote control script
-- remote listener
os.loadAPI("inventory")
os.loadAPI("path")
running = true
-- this should be configurable somehow
modem = peripheral.wrap("right")
modem.open(0)
while running do
local event, modemSide, senderChannel,
@wolfgangmeyers
wolfgangmeyers / inventory
Last active August 29, 2015 14:17
Computercraft script for managing turtle inventory
-- gets a list of all items in a turtle's inventory
function listItems()
local result = {}
for i=1,16 do
local item = turtle.getItemDetail(i)
if item then
local itemName = item["name"]
local itemCount = turtle.getItemCount(i)
result[i] = itemCount .. " " .. itemName
end
@wolfgangmeyers
wolfgangmeyers / path
Last active August 29, 2015 14:17
Computercraft turtle script for carving out paths
-- navigate through a path
function digDown()
while not turtle.down() do
turtle.digDown()
end
end
function digUp()
while not turtle.up() do
@wolfgangmeyers
wolfgangmeyers / download
Last active August 29, 2015 14:17
Download script for computercraft
# lua script to download files
args = {...}
url = args[1]
outfile = args[2]
resp, err = http.get(url)
f = io.open(outfile, "w")
f:write(resp.readAll())
f:close()
resp.close()