Skip to content

Instantly share code, notes, and snippets.

startGameButton.addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
game.setScreen(new GameScreen(game));
return true;
}
});
@RyanScottLewis
RyanScottLewis / output_1.rb
Last active December 16, 2015 18:39
Ripper S-EXP output
class Foo
def self.parse
new.parse
end
def parse
if true
if false
puts "omg" if true
@RyanScottLewis
RyanScottLewis / gfm_task_list.md
Created March 30, 2013 04:42
Testing Github Flavored Markdown task list
  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed
/*
NAME: TCPServer
SYNOPSIS: TCPServer [port]
DESCRIPTION: The program creates a TCP socket in the inet
listen for connections from TCPClients,
accept clients into private sockets, and
fork an echo process to ``serve'' the client.
If [port] is not specified, the program uses any available port.
object Character
object Statistics
attribute accessor character, type: Float, default: 1.0
object PrimaryStatistics < Statistics
attribute accessor strength , type: Float, default: 1.0
attribute accessor perception , type: Float, default: 1.0
attribute accessor endurance , type: Float, default: 1.0
attribute accessor charisma , type: Float, default: 1.0
@RyanScottLewis
RyanScottLewis / uuid.js.coffee
Created March 9, 2013 19:05
Not my code, just converted it into CoffeeScript with human variable names.
window.UUID =
generate: ->
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace /[xy]/g, (character) ->
random_number = Math.random()*16 | 0 # Random number between (and including) 0 and 15
value = if character == 'x' then random_number else (random_number&0x3|0x8)
value.toString(16)
@RyanScottLewis
RyanScottLewis / active_merchant_paypal_express_gateway_error.xml
Created March 1, 2013 13:01
ActiveMerchant::Billing::PaypalExpressGateway Error
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType">
</Security>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
class Parser
def errors
@errors ||= []
end
end
RESET
+++++ +++++ set cell 0 to 10 (the multiplier)
[ run brackets until cell 0 == 0
> +++++ +++ point to and set cell 1 to 8 * 10 = 80
> +++++ +++++ ++ point to and set cell 2 to 12 * 10 = 120
> +++++ ++++ point to and set cell 3 to 9 * 10 = 90
> +++++ +++++ + point to and set cell 4 to 11 * 10 = 110
<<<< - point to and cell 0 decrement 1
]
> ++ . point to cell 1 increment 2 and print
@RyanScottLewis
RyanScottLewis / gist:4231227
Created December 7, 2012 06:34
Hot Patch a Module
module HotPatch
def hot_patch
puts "Sizzlin hot... don't call super here =X"
end
end
class Object
def hot_patch
meta_class = (class << self; self; end)
meta_class.send(:include, HotPatch) unless meta_class.ancestors.include?(HotPatch)