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
| Day job: | |
| Python programmer, data analyst, and DBA at Stetson University | |
| Favorite Python project: | |
| Django, because I'm a perfectionist that's always on a deadline | |
| Favorite Conference: | |
| TED, because being an inventor runs in the family | |
| Python Experience Level: |
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 ReportDesigner = Backbone.View.extend({ | |
| initialize: function(args) { | |
| this.workspace = args.workspace; | |
| // Create a unique ID for use as the CSS selector | |
| this.id = _.uniqueId("report_"); | |
| $(this.el).attr({ id: this.id }); | |
| this.add_button(); |
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
| select 'Last 30 Days', sum(measure1) | |
| from time t, fact f | |
| where f.timeid = t.timeid | |
| and | |
| f.date between applib.add_days(current_date, -30) and current_date | |
| UNION ALL | |
| select 'Current Month', sum(measure1) | |
| from time t, fact f | |
| where f.timeid = t.timeid | |
| and t.month = applib.extract_timestamp(current_timestamp, 'MONTH')+1 |
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
| console.log("Fetching docs..."); | |
| var j = 0; | |
| var docs = []; | |
| var ids = []; | |
| nano.list({ stale: "ok" }, function(err, data, headers){ | |
| console.log("Updating " + data.rows.length + " docs..."); | |
| for (var i = 0; i < data.rows.length; i++) { | |
| ids.push(data.rows[i].id); | |
| } | |
| }); |
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
| console.log("Fetching docs..."); | |
| var j = 0; | |
| var docs = []; | |
| var startdoc = '0'; | |
| function fetchdocs(){ | |
| nano.list({ stale: "ok", startkey:startdoc, limit:2000, include_docs:true}, function(err, data, headers){ | |
| console.log("Updating " + data.rows.length + " docs..."); | |
| for (var i = 0; i < data.rows.length; i++) { | |
| var doc = data.rows[i].doc; | |
| //console.log(doc); |
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').defaults({json: true}), | |
| transfuse = require('transfuse'), | |
| JSONStream = require('JSONStream'); | |
| function transform(couchdb, funcString, headers) { | |
| var down = request({url: couchdb + '/_all_docs?include_docs=true'}), | |
| up = request({url: couchdb + '/_bulk_docs', method: "POST", headers: headers}), | |
| tr = transfuse(['rows', /./, 'doc'], funcString, JSONStream.stringify("{\"docs\":[\n", "\n,\n", "\n]}\n")); | |
| down.pipe(tr) | |
| tr.pipe(up) |
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 baudio = require('baudio'); | |
| var b = baudio(); | |
| b.push((function () { | |
| // randomly evolving melody | |
| var freqs = [ | |
| 0, 0, 1600, 1600, | |
| 0, 0, 2000, 2000, | |
| 0, 1400, 0, 1400, |
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
| $new_array = array(); | |
| $ret_html = "<table><tr><th>DMA</th><th>Leads</th></tr>"; | |
| while ($row = mysql_fetch_array($result)) | |
| foreach ($row as $key => $value) { | |
| if (isset($new_array["$value"])) | |
| $new_array["$value"]++; | |
| else | |
| $new_array["$value"]++; |
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 requests # `pip install requests`; DO IT! | |
| import time | |
| import sys | |
| class ComfortSweet: | |
| LAST_ATTEMPT = 0 | |
| def main(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
| import requests # `pip install requests`; DO IT! | |
| import time | |
| import sys | |
| class ComfortSweet: | |
| LAST_ATTEMPT = 0 | |
| def main(self): |
OlderNewer