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
| [ | |
| { | |
| "id": 1, | |
| "name": "foo", | |
| "votes": 0 | |
| }, | |
| { | |
| "id": 2, | |
| "name": "bar", | |
| "votes": 0 |
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 event = function(req, res){ | |
| events.findBy('shortname', req.params.shortname, function(err, event) { | |
| if (event) { | |
| // remove sensitive data | |
| event.voteoptions.forEach(function(vo){ | |
| delete vo.numbers; | |
| }); | |
| res.render('event', { | |
| name: event.name, shortname: event.shortname, state: event.state, |
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 chart; | |
| // Attach a handler to the window load event. | |
| $(document).ready(function() { | |
| chart = new Highcharts.Chart({ | |
| chart: { | |
| renderTo: 'chart', | |
| type: 'bar' | |
| }, | |
| title: { |
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 Twilio = require('./twilio-js'); | |
| Twilio.AccountSid = "AC57534a35a8284eb49d22b122fb5be0e6"; | |
| Twilio.AuthToken = "bc80e083030a3c14638923c335c82854"; | |
| Twilio.UsageRecord.all(function(err, res) { | |
| res.usageRecords.forEach(function(record) { | |
| // have at it! | |
| }); | |
| }); |
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 request = require('request'), | |
| querystring = require('querystring'), | |
| Buffer = require('buffer').Buffer; | |
| var numbers = ['+12068666338']; | |
| var vote = process.argv[2]; | |
| var attack = function(i) { | |
| var dataHash = {Body: vote, From: vote + "-" + i, To: numbers[0]}, |
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
| // Twilio API: http://twilio.com/api | |
| // Twilio Node.js module: https://github.com/stevegraham/twilio-js | |
| var Twilio = require('twilio-js') | |
| , twilioNumber = "your SMS-enabled Twilio #"; | |
| require('./creds')(Twilio); | |
| // creds.js should look like: | |
| // |
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
| { | |
| "_id": "_design/event", | |
| "views": { | |
| "byShortname": { | |
| "map": "function (doc) { if (doc.shortname) { emit(doc.shortname, doc) } } " | |
| }, | |
| "byPhonenumber": { | |
| "map": "function (doc) { if (doc.phonenumber) { emit(doc.phonenumber, doc) } } " | |
| }, | |
| "all": { |
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
| { | |
| "name": "Demo Voting", | |
| "shortname": "demo", | |
| "voteoptions": [{ | |
| "id": 1, | |
| "name": "foo", | |
| "votes": 0, | |
| "numbers": [] | |
| }, | |
| { |
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
| Application = Thorax.Application.create() | |
| # convenience for debugging | |
| window.Application = Application | |
| # main view controller | |
| Application.ViewController.create | |
| parent: Application | |
| routes: | |
| '': 'index' |
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
| [06/22 20:39:58 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:58 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:58 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:58 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:58 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:58 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:59 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:59 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:59 PDT] ERROR: failed to save vote info to DB, retrying | |
| [06/22 20:39:59 PDT] ERROR: failed to save vote info to DB, retrying |