Skip to content

Instantly share code, notes, and snippets.

@b1naryth1ef
Created June 17, 2011 02:51
Show Gist options
  • Save b1naryth1ef/1030766 to your computer and use it in GitHub Desktop.
Save b1naryth1ef/1030766 to your computer and use it in GitHub Desktop.
blogpost74_1
<gator>
[.load]
.webify
.servy
..cdnpak
.nettools
[/]
site = "http://mysite.com"
env(){
inheirt g.env[] #The brackets are for gator methods (inherited from 2.0)
for call in ._self:
g.do(call)
if call == "EXIT":
orif call == "999":
exit()
elif call == "serv*(*)"
server.calls(call)
}
main(){
env.init()
s = parent.server.callsides() We assume you already have a server up w/ servy().
s.status("000:OK")
}
server(){
inheirt parent.server()
}
cdn(file,user){
if path.exists(file):
x = file
webify.ready(x)
x :> user
elif not path.exists(file):
x = pull.www(site+"/"+file) #extra / just in case
x :> save.f(disk)
webify.ready(x) #Not really important but w/e
x :> user
}
end(){
s.empty
x.empty
gator.exit(0) #A safe clean exit!
}
end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment