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
<!-- Script for disabling the left/right Bootstrap carousel controls at the first/last slide --> | |
(function() { | |
const removeClass = function(selector, className) { | |
Array.from(document.querySelectorAll(selector)).forEach(function(el) { | |
el.classList.remove(className); | |
}); | |
}; | |
const addClass = function(selector, className) { | |
Array.from(document.querySelectorAll(selector)).forEach(function(el) { | |
el.classList.add(className); |
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
# Hash-based set implementation from the Coffeescript cookbook | |
# http://coffeescriptcookbook.com/chapters/arrays/removing-duplicate-elements-from-arrays | |
Array::unique = -> | |
output = {} | |
output[@[key]] = @[key] for key in [0...@length] | |
value for key, value of output | |
class Solver | |
constructor: (data) -> | |
words = new String(data).trim().split(' ') |
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
SELECT avg(hits) AS value, | |
extract(dow from ts) as day, | |
extract(hour from ts) as hour | |
FROM ( | |
WITH filled_dates as ( | |
select hour, 0 as blank_count from | |
generate_series( | |
(SELECT date_trunc('hour', MIN(timestamp)) FROM activities WHERE user_subject_id=#{user_id}), | |
(SELECT MAX(timestamp) from activities WHERE user_subject_id=#{user_id}), | |
'1 hour' |
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 flask import Flask, request | |
import hmac | |
import urllib | |
import json | |
app = Flask(__name__) | |
app.secret_key = 'THIS IS A SECRET KEY (JUST KIDDING)' | |
def get_auth_code(payload): |