Skip to content

Instantly share code, notes, and snippets.

{
[
{ "date": "2012-06-13" },
{ "date": "2012-07-20" },
{ "date": "2012-08-20" },
{ "date": "2012-09-20" }
]
}
@christemple
christemple / previous_30_days
Created October 31, 2014 10:46
Get previous 30 days labels
get_previous_thirty_days_labels_from = (now, callback)->
previous_days = []
for days_to_subtract in [0..29]
previous_days.unshift moment(now).subtract(days_to_subtract, 'day').format("DD")
callback(previous_days)
module Simulado
SIMULADO = Net::HTTP.new('localhost', 7001)
JSON_HEADERS = {'Content-Type' => 'application/json', 'Accept' => 'application/json'}
def mock(response)
SIMULADO.post('/syncMock', response.to_json, JSON_HEADERS)
end
def last_request(method, path)
headers = JSON_HEADERS.merge('method' => method, 'path' => path)
@christemple
christemple / honeybadger_api.json
Last active August 29, 2015 14:26
Show the total faults that have occurred in production only between <start> & <stop>
# Show the total faults that have occurred in production only between <start> & <stop>
# - sorted by: fault with most occurrences in the time period
# Last week
# https://app.honeybadger.io/projects/42287/faults/top?resolved=f&environment=production&start=2015-07-23&stop=2015-07-30&ignored=f&auth_token=<auth_token>
{
"project_id": 1717,
"faults": [
{
@christemple
christemple / show_jenkins_errors.bookmark
Created August 7, 2015 11:06
Bookmark: Show the errors in a Jenkins console output easier
javascript:var errors = jQuery('.console-output > span[style*="CD0000"]').clone(); jQuery('.console-output').empty(); jQuery('.console-output').append(errors); jQuery('.console-output > span').append("<br/>");