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
// Create a trigger on this | |
function onCalendarChange(triggerEvent) { | |
Logger.log("triggerEvent:", triggerEvent); | |
Main() | |
} | |
function Main() { | |
var today = new Date(); | |
var endDate = new Date(); |
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
import type { Paths, I18n, Translate } from "next-translate" | |
type Tail<T> = T extends [unknown, ...infer Rest] ? Rest : never | |
export type TranslationsKeys = { | |
common: Paths<typeof import("./locales/en/common.json")> | |
["feat-analytics"]: Paths<typeof import("./locales/en/feat-analytics.json")> | |
["feat-participate"]: Paths< | |
typeof import("./locales/en/feat-participate.json") | |
> |
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
## Triggers (Bringing data into Zapier) | |
### Sleep - polling | |
https://api.fitbit.com/1/user/-/sleep/date/today.json | |
### Activity - polling | |
https://api.fitbit.com/1/user/-/activities/list.json?beforeDate=today&sort=desc&limit=10&offset=0 | |
## Scripting API | |
see script.js |
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
/** @jsx React.DOM */ | |
module React from 'react' | |
var Delay = React.createClass({ | |
propTypes: { | |
by: React.PropTypes.number.isRequired, | |
}, | |
getInitialState() { |
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
/** @jsx React.DOM */ | |
/** @type React */ | |
module React from 'react' | |
var RB = require('react-bootstrap') | |
module Router from 'react-router' | |
var DisplayModal = React.createClass({ | |
mixins: [RB.OverlayMixin], |
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
class MyAdmin(admin.ModelAdmin): | |
def response_change(self, request, obj): | |
if "_activate_and_send_email" in request.POST: | |
self.activate_account_and_send_email(request, (obj,)) | |
return HttpResponseRedirect(request.path) | |
return super().response_change(request, obj) |
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
class MyAdmin(admin.ModelAdmin): | |
list_display = (..., 'actions_html') | |
def actions_html(self, obj): | |
return format_html('<button class="btn" type="button" onclick="activate_and_send_email({pk})">Activate and send email</button>', pk=obj.pk) | |
actions_html.allow_tags = True | |
actions_html.short_description = "Actions" |
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 python | |
from datetime import datetime | |
import os | |
import sys | |
from dateutil.relativedelta import relativedelta | |
import sh | |
def checkout_repo_at(path, dt): |