Skip to content

Instantly share code, notes, and snippets.

View indspenceable's full-sized avatar

Daniel Spencer indspenceable

View GitHub Profile
@indspenceable
indspenceable / Stage01.tiled2unity.xml
Created November 26, 2017 22:41
Stage01.tiled2unity.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--Tiled2Unity generated xml data-->
<!--Do not modify by hand-->
<!--Last exported: 11/26/2017 5:29:54 PM-->
<Tiled2Unity version="1.0.12.2">
<AssignMaterial mesh="Stage01_mesh_0001" material="Graveyard Birds tiles" />
<AssignMaterial mesh="Stage01_mesh_0002" material="Objects" />
<AssignMaterial mesh="Stage01_mesh_tile_0079" material="Objects" />
<Prefab name="Stage01" orientation="Orthogonal" staggerAxis="Y" staggerIndex="Odd" hexSideLength="0" numLayers="2" numTilesWide="32" numTilesHigh="20" tileWidth="16" tileHeight="16" exportScale="0.0625" mapWidthInPixels="512" mapHeightInPixels="320" backgroundColor="#808080">
<GameObject name="Tile Layer 1" x="0" y="0" z="0" layer="Pit">
@indspenceable
indspenceable / update_hil_script.py
Created October 11, 2016 21:19
how to update HIL results on algolia
# first: SCP the JSON file to to /home/ubuntu/srv/updated_hil.json on Turnkey Web
# then, source the virtualenv and run python from within the docker container
import json
from turnkey import db
from turnkey.models import *
from turnkey.utils.algolia_data_object import AlgoliaDataObject
from turnkey.integrations.algolia import connect_to_algolia
# Read the files, create a mapping fo original_url -> the updated payload
Hi,
I've been making a turn-based-tactics roguelike (think a cross between fire emblem and nethack), and I want to start getting some playtesters, which means I need to start putting in graphics. While programmer graphics are going to last me a little bit, I want to start figuring out a better story. Ideally, you reading this are a 2D artist, and are interested in working on this type of project!
Here's what I'm looking for:
* 1-3 mostly static tilesets. These will have tiles for a couple of different terrains, tileable similar to: http://vxresource.files.wordpress.com/2010/02/chibihikaru-tilea2.png
* Some special effects. These would just be small animations for particles or 1-offs for using abilities
* Character animations. Each unit in the game will need animations for getting into fights (a model for standing still, and somewhere between 1-3 animations for attacking...). This might be tricky, cause it needs to be done in a way that we can add modifiers to it (change the color of the characters hai
def findbase(x80,x20,xpeak1,ypeak1,xbase2):
"""Uses .8 and .2 parts of last peak decay to estimate tau and baseline for next peak"""
tau = (x80-x20)/(math.log(.25))
#this is just the rearranged y80=y20e^(-deltax/tau)
#seems to work from the command line but not within the function wtf
ybase2 = (ypeak1)*(math.exp((xpeak1-xbase2)/tau))
#uses tau we just found to estimate baseline of 2nd peak its with the line that starts with tau
return (tau, ybase2)
;~
./|\.
./ /| `\.
/ | | `\.
| | | `\.
| \| `\.
. `----|__________\.
\-----''----.....___
\ ""/
~^~^~^~^~^`~^~^`^~^~^`^~^~^
class Foo
def self.bar(method, val)
define_method(method){ val }
end
bar :baz, "Hello, world."
end
Foo.new.baz # => "Hello, world."
@indspenceable
indspenceable / classes.rb
Created October 15, 2011 20:54
has_many :through
class Player < ActiveRecord::Base
has_many :skill_sets
has_many :command_groups, :through => :skill_sets
has_many :command_names, :through => :command_groups
end
class SkillSet < ActiveRecord::Base
belongs_to :player
belongs_to :command_group
end
@indspenceable
indspenceable / gist:1274422
Created October 10, 2011 00:49
awesome metaclass shit
class ActiveRecord::Base
#facilitate using class details
def self.own_one(class_name)
assoc = "owned_#{class_name.underscore}"
has_one assoc, :class_name => class_name, :autosave => true
reflect_on_association(assoc).klass.column_names.reject do |column_name|
column_name=~(/(\A|_)id\z/) || %w(created_at updated_at).include?(column_name)
end.each do |column_name|
[:"#{column_name}?", :"#{column_name}_before_type_cast", :"#{column_name}=", :"_#{column_name}",
column_name, :"#{column_name}_changed?", :"#{column_name}_change", :"#{column_name}_will_change!",
@indspenceable
indspenceable / gist:810662
Created February 4, 2011 02:47
activerecord rake failure
(in /Users/dspencer/Documents/wt/1.9.2p136/rails/activerecord)
/Users/dspencer/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -w -I"lib:test:test/connections/native_mysql" "/Users/dspencer/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/cases/adapter_test.rb" "test/cases/adapters/mysql/active_schema_test.rb" "test/cases/adapters/mysql/connection_test.rb" "test/cases/adapters/mysql/reserved_word_test.rb" "test/cases/adapters/mysql/sp_test.rb" "test/cases/aggregations_test.rb" "test/cases/ar_schema_test.rb" "test/cases/associations/association_proxy_test.rb" "test/cases/associations/belongs_to_associations_test.rb" "test/cases/associations/callbacks_test.rb" "test/cases/associations/cascaded_eager_loading_test.rb" "test/cases/associations/eager_load_includes_full_sti_class_test.rb" "test/cases/associations/eager_load_nested_include_test.rb" "test/cases/associations/eager_singularization_test.rb" "test/cases/associations/eager_test.rb" "test/cases/associations/extension_test.rb" "test/
@indspenceable
indspenceable / active-support-memoization-prime-on-freeze.patch
Created January 11, 2011 00:16
active-support-memoization-prime-on-freeze.patch
diff --git a/activesupport/lib/active_support/memoizable.rb b/activesupport/lib/active_support/memoizable.rb
index 0a7bcd5..71af70c 100644
--- a/activesupport/lib/active_support/memoizable.rb
+++ b/activesupport/lib/active_support/memoizable.rb
@@ -17,7 +17,7 @@ module ActiveSupport
end
def freeze_with_memoizable
- memoize_all unless frozen?
+ prime_cache(*self.class.instance_variable_get(:"@prime_on_freeze").to_a || []) unless frozen?