Skip to content

Instantly share code, notes, and snippets.

View xarses's full-sized avatar

Andrew Woodward xarses

  • San Francisco, Bay Area, CA
View GitHub Profile
local sides = require('sides')
local facing = {index = 1}
--[[
sides = {north=2,
east=5,
south=3,
west=4}
--]]
function facing.roll(self, dist)
function poi.new(self, address, location, cache, parent)
obj = {address=address,
location=location,
cache=cache or {},
parent=parent or self.parent
}
setmetatable(obj,self)
self.__index = self
return obj
end
ofRenderDistanceChunks:16
ofFogType:2
ofFogStart:0.8
ofMipmapType:0
ofLoadFar:true
ofPreloadedChunks:8
ofOcclusionFancy:false
ofSmoothFps:false
ofSmoothWorld:false
ofAoLevel:1.0
@xarses
xarses / turbine.lua
Created June 12, 2016 22:16
wind turbine excerpt
function getRotor(inv, source, dest)
-- X if we don't have a rotor, we don't care and just grab any
-- X if we aren't on the max tier we can upgrade if any are present
-- X if we aren't taking damage, then we should downgrade
-- X if we are on wood, and not taking damage, then we have no wind
-- if keep upgrading, and then the next cycle downgrades, we shoudn't upgrade
-- again for a bit
-- X we need to skip missing items to upgrade
-- we should update our status on the display
-- we need to keep track of the rotors health, even if we put it away
Copyright (c) 2016, Andrew Woodward (xarses)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@xarses
xarses / build_gt_ores_for_enviromine.py
Created August 20, 2016 08:44
gregtech6 enviromine config generator
preamble = 'gregtech:gt.meta.ore'
editions = ['small', 'broken', 'normal']
materials = ['basalt',
'bedrock',
'blackgranite',
'default',
'endstone',
'gravel',
'marble',
'netherrack',
@xarses
xarses / adjust-networks.py
Created October 3, 2016 15:46
Adjust networks in nailgun ignoring api (designed for 7.0, use at own risk)
from collections import defaultdict
from itertools import imap
from itertools import islice
from netaddr import IPAddress
from netaddr import IPNetwork
from netaddr import IPRange
import six
$ pip freeze
alabaster==0.7.9
alembic==0.8.10
ansible==2.2.1.0
appdirs==1.4.0
Babel==2.3.4
bindep==2.1.0
boto==2.45.0
cffi==1.9.1
cliff==2.4.0
$ rally task start test01.yaml
Running Rally version 0.8.2~dev61
--------------------------------------------------------------------------------
Preparing input task
--------------------------------------------------------------------------------
Input task is:
---
NovaServers.boot_and_delete_server:
@xarses
xarses / loops for days...
Created February 16, 2017 22:33
more fun with rally
{% set flavor_name = flavor_name or "m1.tiny" %}
{% set zones = zones or ['nova'] %}
{% set times = times or 1 %}
---
NovaServers.boot_and_delete_server:
{% for zone in zones %}
-
args:
flavor:
name: "{{flavor_name}}"