Skip to content

Instantly share code, notes, and snippets.

View probablycorey's full-sized avatar
👯‍♂️
Dancing with my twin

Corey Johnson probablycorey

👯‍♂️
Dancing with my twin
View GitHub Profile
oo
∆()!
/\
require "ListingViewController"
class{..., UI.TableViewController, protocols = {"UITableViewDelegate", "UITableViewDataSource"}}
function dealloc()
super()
end
-- DataSource
-------------
imageView = UI.ImageView:initWithFrame(CGRect(10, 10, width, height))
imageView:setImage(image)
imageView:setUserInteractionEnabled(true)
function imageView.touchesEnded_withEvent(self, touches, event)
puts("BY THE DEVIL")
end
-- usage: lua luac.lua [file.lua]* [-L [module.lua]*]
--
-- creates a precompiled chunk that preloads all modules listed after
-- -L and then runs all programs listed before -L.
--
-- assumptions:
-- file xxx.lua contains module xxx
-- '/' is the directory separator (could have used package.config)
-- int and size_t take 4 bytes (could have read sizes from header)
-- does not honor package.path
-- Note: Lua Proxy Userdata is what holds the reference to the obj-c object
function dummyCode(array) -- array is an instance of an obj-c NSArray Object
local thing = NSObject:alloc():init() -- Assume the Lua Proxy Userdata for 'thing' is
-- automatically put into the strong set
... -- Misc Lua code. Assume the Lua garbage collector will be run during this code. Since
-- 'thing' is not being retained by any other obj-c code (its retain count is 1) it is
-- removed from the strong set.
# Super simple markup
«header listen up»
«subhead I'm here to tell you guys something»
hello «bold corey is my name» and I would like to «red go to the store»
# Some sort of style sheet
header {
font-size 10
users = User.find(:all, :sort => "previous_worth", :order => "DESC")
users.each_with_index do |u, i|
u.rank = i
if u.previous_worth <= worth
break
end
end
xml = {tagName = {
attrs = {attr1 = "1", attr2 = "2"},
text = "text",
child1 = {...},
child2 = {...}}
-- attrs
xml.attrs.attr1
-- text
void word(p)
char *p;
{
printf("%s", p);
}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>http://www.xxx.com/getGroups</wsa:Action>
<wsa:MessageID>uuid:74440a1e-0f0a-4d83-aec4-a0e43b2ec469</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://www.xxx.com/webservices/users</wsa:To>
<wsse:Security soap:mustUnderstand="1">
<wsu:Timestamp wsu:Id="Timestamp-65949428-a63a-4a1a-b176-a550300bc0aa">