This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xml = {tagName = { | |
| attrs = {attr1 = "1", attr2 = "2"}, | |
| text = "text", | |
| child1 = {...}, | |
| child2 = {...}} | |
| -- attrs | |
| xml.attrs.attr1 | |
| -- text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "ListingViewController" | |
| class{..., UI.TableViewController, protocols = {"UITableViewDelegate", "UITableViewDataSource"}} | |
| function dealloc() | |
| super() | |
| end | |
| -- DataSource | |
| ------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| oo | |
| β()! | |
| /\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class("SimpleTableViewController", "UITableViewController") | |
| function tableView_numberOfSectionsInTableView(tableView, section) | |
| return 1 | |
| end | |
| function tableView_numberOfRowsInSection(tableView, section) | |
| return 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| #import "Detective.h" | |
| @interface TwitterStatus : Detective | |
| } | |
| @property (nonatomic, retain) NSNumber *twitterID | |
| @property (nonatomic, retain) NSString *text | |
| @end |