I hereby claim:
- I am danallison on github.
- I am danallison (https://keybase.io/danallison) on keybase.
- I have a public key ASDUznCpicoQz-TtNd0WOBIMNXMAYktgZzXbIRT3TjIJlAo
To claim this, I am signing this object:
var yearsMonthsDaysBetween = function(date) { | |
var andString, days, daysString, months, monthsString, s, today, years, yearsString; | |
today = new Date(); | |
date = new Date(date); | |
years = today.getFullYear() - date.getFullYear(); | |
months = today.getMonth() - date.getMonth(); | |
days = today.getDate() - date.getDate(); | |
if (days < 0) { | |
months -= 1; | |
days = Math.floor((today - new Date(today.getFullYear(), today.getMonth() - 1, date.getDate())) / 1000 / 60 / 60 / 24); |
paginationTemplate = (data) -> | |
url = data.url | |
currentPage = +data.currentPage | |
totalPages = +data.totalPages | |
lis = [] | |
if totalPages < 7 | |
for i in [1..totalPages] | |
li = if i is currentPage then "<li class='active'><a>#{i}</a></li>" else "<li><a href='#{url}/page#{i}'>#{i}</a></li>" | |
lis.push(li) |
class Trie | |
constructor: (strings = [], @root = {}) -> | |
@addString string for string in strings | |
addString: (string) -> | |
chars = string.split "" | |
string = "" | |
node = @root | |
for char in chars | |
string += char |
useWorkerToDo = (fn, data) -> | |
window.URL or = window.webkitURL | |
workerSupported = window.Worker and window.URL and window.Blob | |
callbacks = [] | |
done = false | |
returnVal = undefined | |
resolve = -> | |
while callbacks.length | |
returnVal = callbacks.shift()(returnVal) | |
return |
dispatcher = {} | |
dispatcher._subscribers = {} | |
dispatcher.on = (eventName, callback, context) -> | |
(dispatcher._subscribers[eventName] or = []) | |
.push { | |
callback: callback | |
context: context | |
} |
function downloadString(text, fileType, fileName) { | |
var blob = new Blob([text], { type: fileType }); | |
var a = document.createElement('a'); | |
a.download = fileName; | |
a.href = URL.createObjectURL(blob); | |
a.dataset.downloadurl = [fileType, a.download, a.href].join(':'); | |
a.style.display = "none"; | |
document.body.appendChild(a); | |
a.click(); |
function flowMap () { | |
var functions = [].slice.call(arguments); // convert arguments to array | |
return function () { | |
var _this = this; // maintain context | |
return functions.reduce(function (args, fn) { | |
// for each function or array of functions, | |
// pass in the previous return value. | |
if (_.isArray(fn)) { | |
return [fn.map(function (_fn) { return _fn.apply(_this, args); })]; | |
} else { |
I hereby claim:
To claim this, I am signing this object:
import requests | |
import datetime | |
auth_token = '** replace this with your auth token **' | |
def get_time_entries_for_project(project_id, date_range=None): | |
''' | |
Fetches time entries from the API, including suggestions and phases | |
''' | |
base_url = 'https://api.10000ft.com' |