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
| observations = $().sleepyMongo({sleepyUrl: WallCology.mongooseURL + "/observations/") | |
| observations.find({}, function(data) { | |
| // do stuff | |
| }) |
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 'rest_client' | |
| require 'uri' | |
| require 'account' | |
| # this is basically a monkey patch of Rollcall's Account class... | |
| # it's one of those things you would never see in Java, because you can't really | |
| # modify a class during runtime | |
| Account.class_eval do | |
| # here we tell the Account class to execute different methods before |
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
| // authenticate with rollcall | |
| String rollcallUrl = Play.configuration.getProperty("sail.rollcall.url"); | |
| WSRequest req = WS.url(rollcallUrl+"/login.json"); | |
| req.setParameter("session[login]", username); | |
| req.setParameter("session[password]", password); | |
| WS.HttpResponse res = req.post(); | |
| JsonElement json = res.getJson(); | |
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
| Strophe.AutoConnector = { | |
| events: { | |
| initialized: function() { | |
| Sail.loadCSS(Sail.modules.defaultPath + 'Strophe.AutoConnector.css') | |
| // | |
| $(Sail.Strophe).bind({ | |
| connect_error: Strophe.AutoConnector.connectFailure, | |
| connect_connfail: Strophe.AutoConnector.connectFailure, | |
| connect_authfail: Strophe.AutoConnector.connectFailure, |
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
| ---------- Server-wide settings ---------- | |
| -- Settings in this section apply to the whole server and are the default settings | |
| -- for any virtual hosts | |
| -- This is a (by default, empty) list of accounts that are admins | |
| -- for the server. Note that you must create the accounts separately | |
| -- (see http://prosody.im/doc/creating_accounts for info) | |
| -- Example: admins = { "user1@example.com", "user2@example.net" } | |
| admins = { } |
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
| event :do_magic_stuff? do | |
| f = File.open('myfile.txt','r') | |
| f.each_line do |line| | |
| msg = Blather::Stanza::Message.new | |
| msg.to = "somerooom@conference.aardvark.encorelab.org" | |
| msg.type = :groupchat | |
| msg.body = line | |
| client.write(msg) |
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
| jQuery(veos).bind('gmaps.ready', function() { | |
| /* dependent code goes here */ | |
| }); |
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
| var r = new veos.model.Reports(); // creates the "reports" collection proxy object | |
| r.on('reset', function(collection) { | |
| navigator.geolocation.getCurrentPosition(function(currentLocation) { | |
| var collectionFilter = function(installation) { | |
| return isCloseBy(installation, currentLocation); | |
| } | |
| var filteredReports = _.filter(collection, collectionFilter); | |
| createGrid(filteredReports); |
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
| var photo = new veos.model.Photo(); | |
| // called when photo.upload() succeeds | |
| function photoUploaded() { | |
| console.log("Photo ID is: " + photo.id); | |
| } | |
| // called when photo.captureFromCamera() succeeds | |
| function imageCaptured () { | |
| // upload the captured image to the server |
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
| [1, 2, 3] | |
| {1: 'a', 2: 'b', 3: 'c'} | |
| [ | |
| {eq: 1, foo: "asdfasdf"}, | |
| {eq: 2, foo: "asdfasdfsdfasdf"} | |
| ] | |