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
com.acme.app.handlers = java.util.logging.FileHandler | |
com.acme.app.level = ALL | |
com.acme.app.useParentHandlers = false | |
java.util.logging.FileHandler.pattern = app.log | |
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter | |
java.util.logging.SimpleFormatter.format = %4$-5s [%1$tY-%1$tm-%1$tdT%1$tH:%1$TM:%1$TS,%1$TL%1$Tz] %2$10s: %5$s%6$s%n |
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
from monitoring import notification | |
# a callback to print each notification to stderr | |
def print_notification(event_list): | |
for e in event_list: | |
print >> sys.stderr, e | |
# a callback to write each event to the db | |
def write_to_db(event_list): | |
for e in event_list: |
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
# Report the sum of read bytes from the users | |
# of tenant ntua every 10 minutes, if the reads | |
# have come from the object service and the #bytes | |
# read are larger than 1000. | |
# | |
# The aggregation result will be queued under topic 'foo' | |
rule 'sum-over-ntua' | |
topic 'foo' | |
when | |
e.tenant = 'ntua', |
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
// lib/bar.js | |
var puts; | |
try { | |
puts = require('system').puts; // rhino | |
} catch (e) { | |
puts = require('util').puts; // node | |
} |
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
#doc.route-home #page-outer #page-container.page-container.home-container #page-node-home .main-content .page-header.home-header .stream-tabs .stream-tab.stream-tab-activity { | |
display:none !important; | |
} | |
#doc.route-home #page-outer #page-container.page-container.home-container #page-node-home .dashboard .component .dashboard-activity-teaser-inner { | |
display:none !important; | |
} |
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
// Clone this object and (optionally) append | |
// own properties of `other_object` to the newly cloned one. | |
// This is a convenience method over the Object#create | |
// Initial code from here: http://howtonode.org/prototypical-inheritance | |
// Amended with: http://msdn.microsoft.com/en-us/library/ff877835(VS.94).aspx, | |
// the part about the clone function. | |
Object.defineProperty(Object.prototype, 'clone', { | |
get: function() { | |
var self = this; |
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
;; from here: http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html | |
(defmacro forloop | |
[var-init & body] | |
(let [myvar (nth var-init 0) | |
start (nth var-init 1) | |
end (nth var-init 2)] | |
(list 'loop [myvar start] | |
(list 'when (list '<= myvar end) | |
(cons 'do body) |