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 moviePilotRatingAnalyser = { | |
movieId: function () { | |
return jQuery("[data-type='Movie']").data('id'); | |
}, | |
ratings: function () { | |
return this.ratingData.map(function (rating) { | |
return rating.value || 0; | |
}); | |
}, | |
average: function () { |
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
#!/usr/bin/env bash | |
JAVA_FILE_ENDING="*.java" | |
JAVA_MARKER="\/* TODO: Check for data center *\/" | |
DIRECTORY=$1 | |
if [ -z "$DIRECTORY" ]; then | |
echo "Usage: $0 <directory>" |
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 all queries that are running longer than one minute | |
SELECT | |
pid, | |
now() - pg_stat_activity.query_start AS duration, | |
query, | |
state | |
FROM pg_stat_activity | |
WHERE (now() - pg_stat_activity.query_start) > interval '1 min' | |
ORDER BY duration; |
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
function interceptFunction (object, fnName, options) { | |
var noop = function () {}; | |
var fnToWrap = object[fnName]; | |
var before = options.before || noop; | |
var after = options.after || noop; | |
object[fnName] = function () { | |
before.apply(this, arguments); | |
var result = fnToWrap.apply(this, arguments); | |
after.apply(this, arguments); |
OlderNewer