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
| // Try loading these three urls | |
| // [1] http://localhost:8080/goog | |
| // [2] http://localhost:8080/google | |
| // [3] http://localhost:8080/goog | |
| // | |
| // The 1 & 2 will load when the google_emitter is called, 3 doesn't but gets called on | |
| // the next update | |
| var sys = require("sys"), | |
| url = require("url"), |
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
| // Bad Result | |
| // HTTP(PUT) http://pushkart.com/mobile_api/deals/71 | |
| {"image_url":"/system/avatars/81/thumb/man_hungry_100x100.jpg?1273866043","redeem_code":null,"title":"$3 off your next Delivery.com order!","message":"Hungry? Me too! At Delivery.com you can order online from your favorite restaurants! http://www.delivery.com/","id":71} | |
| // Good Result | |
| // HTTP(PUT) http://pushkart.com/mobile_api/deals/31 | |
| {"image_url":"/system/avatars/41/thumb/verb_cafe.png?1273805831","redeem_code":"Mention pushkart and your member name to the cashier","title":"10% off our awesome Iced Coffee","message":"Verb Cafe has the best Iced Coffee in town. cold brewed = better taste! http://foursquare.com/venue/3249","id":31} |
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
| -- GET /deals # get all the deals | |
| -- POST /deals/id # redeem a deal | |
| -- GET /user # get the user details | |
| -- POST /user/login # login | |
| -- POST /user/signup # login | |
| -- URL for each social network, will contain a redirect to the networks | |
| -- oAuth page. On success will redirect to success://pushkart.com on failure will | |
| -- redirect to failure://pushkart.com |
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 "controllers.Menu" | |
| waxClass{"AppDelegate", protocols = {"UIApplicationDelegate"}} | |
| function applicationDidFinishLaunching(self, application) | |
| math.randomseed(os.time() * os.clock()) -- Randomize Random! | |
| self.window = UIWindow:initWithFrame(UIScreen:mainScreen():bounds()) | |
| -- cocos2d will inherit these values |
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
| luaClass{"DB"} | |
| staticDBPath = "db/oscar.db" | |
| DBPath = NSDocumentDirectory .. "/oscar-v001.db" | |
| function load() | |
| if db then return end | |
| local fm = NS.FileManager:defaultManager() | |
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
| function applicationDidFinishLaunching(self, application) | |
| local frame = UIScreen:mainScreen():bounds() | |
| self.window = UIWindow:initWithFrame(frame) | |
| self.searchController = SearchController:init() | |
| self.window:addSubView(self.searchController:view()) | |
| self.window:makeKeyAndVisible() | |
| 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 'rubygems' | |
| require 'open-url' | |
| require 'plist' | |
| states = [] | |
| url = "http://somesite.com/states.html" # I forget which site I scrapped. | |
| html = open(url).read | |
| for state_data in html.scan(/<tr>(.*?)<\/tr>/im) |
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
| waxClass{"Store"} | |
| function milk() | |
| -- milk is added to Store, so you can call it with Store.milk() | |
| puts "milk called" | |
| end | |
| function eggs(self) | |
| -- eggs takes a self arg, but you could still call it as a class | |
| -- method Store:eggs(). Store would be passed in as self |
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
| <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"> |
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
| void word(p) | |
| char *p; | |
| { | |
| printf("%s", p); | |
| } |