This file contains 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
# useful if k is a very large list, and you don't want to do it all in one request | |
# note that consistency will not be guaranteed here (i.e. list can change during iteration) | |
def scan_list(k, range=1000, &block) | |
i = 0 | |
result = [] | |
while l = HLR.lrange(k, i, i+range) | |
break if l.size == 0 | |
if block_given? | |
yield l | |
else |
This file contains 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
# List users by average and maximum session length. | |
SELECT person, max(client.runtime_ms), avg(client.runtime_ms) | |
FROM item_occurrence | |
GROUP BY 1 | |
ORDER BY 2 DESC | |
# List active date ranges for each deploy. | |
SELECT client.javascript.code_version, min(timestamp), max(timestamp) | |
FROM item_occurrence | |
GROUP BY 1 |
This file contains 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
begin | |
CREATE (:`Movie`:`UNIQUE IMPORT LABEL` {`released`:1999, `tagline`:"Welcome to the Real World", `title`:"The Matrix"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1964, `name`:"Keanu Reeves"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1967, `name`:"Carrie-Anne Moss"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1961, `name`:"Laurence Fishburne"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1960, `name`:"Hugo Weaving"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1967, `name`:"Andy Wachowski"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1965, `name`:"Lana Wachowski"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1952, `name`:"Joel Silver"}); | |
CREATE (:`Person`:`UNIQUE IMPORT LABEL` {`born`:1978, `name`:"Emil Eifrem"}); |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"> | |
<graph id="G" edgedefault="directed"> | |
<node id="n0" labels=":Movie"><data key="labels">:Movie</data><data key="tagline">Welcome to the Real World</data><data key="title">The Matrix</data><data key="released">1999</data></node> | |
<node id="n1" labels=":Person"><data key="labels">:Person</data><data key="name">Keanu Reeves</data><data key="born">1964</data></node> | |
<node id="n2" labels=":Person"><data key="labels">:Person</data><data key="name">Carrie-Anne Moss</data><data key="born">1967</data></node> | |
<node id="n3" labels=":Person"><data key="labels">:Person</data><data key="name">Laurence Fishburne</data><data key="born">1961</data></node> | |
<node id="n4" labels=":Person"><data key="labels">:Person</data><data key="name">Hugo Weaving</data><data key="born"> |
This file contains 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
VAGRANT_LOG=debug vagrant ssh | |
INFO global: Vagrant version: 1.3.5 | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/box/plugin.rb | |
INFO manager: Registered plugin: box command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/destroy/plugin.rb | |
INFO manager: Registered plugin: destroy command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/halt/plugin.rb | |
INFO manager: Registered plugin: halt command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/help/plugin.rb | |
INFO manager: Registered plugin: help command |
This file contains 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
Ext.grid.GridPanel.prototype.getFeatures = function() { | |
return this.view.featuresMC; | |
}; | |
Ext.grid.GridPanel.prototype.getFilters = function() { | |
var features = this.getFeatures(); | |
if (features && features.items) { | |
for (var i = 0; i < features.items.length; i++) { | |
if (features.items[i].ftype === 'filters') { | |
return features.items[i]; |
This file contains 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 constructor_getter = (function() { | |
var parser = function(ns, instance) { | |
for (var key in ns) { | |
try { | |
if (instance instanceof ns[key]) { | |
return key; | |
} | |
} catch (err) {} | |
} | |
}; |
This file contains 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 ./before_src/sinon-1.4.2 | |
#= require application | |
#= require backbone_base | |
#= require buckets_dashboard | |
#= require racking | |
#= require service_order | |
#= require dashboard | |
#= require matters | |
#= require_tree ./ |
This file contains 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
load_script = function (url, callback) { | |
var oDOC = document; | |
var head = oDOC.head || oDOC.getElementsByTagName("head"); | |
// loading code borrowed directly from LABjs itself | |
setTimeout(function () { | |
if ("item" in head) { // check if ref is still a live node list | |
if (!head[0]) { // append_to node not yet ready | |
setTimeout(arguments.callee, 25); | |
return; |
This file contains 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 deepDetect = function(list, iterator, context) { | |
var _deepDetect = function(list, iterator, context) { | |
if (_.isArray(list[0])) { | |
_.each(list, function(sublist) { | |
return _deepDetect(sublist, iterator, context); | |
}); | |
} | |
else { | |
var res = _.detect(list, iterator, context); | |
if (!_.isUndefined(res)) { |