Skip to content

Instantly share code, notes, and snippets.

cassus / Dev platform settings
Created Nov 1, 2016
Zapier app to read Activity and Sleep data from FitBit
View Dev platform settings
## Triggers (Bringing data into Zapier)
### Sleep - polling
### Activity - polling
## Scripting API
see script.js
cassus / Delay.js
Created Oct 25, 2014
Delay component for Facebook React
View Delay.js
/** @jsx React.DOM */
module React from 'react'
var Delay = React.createClass({
propTypes: {
by: React.PropTypes.number.isRequired,
getInitialState() {
cassus / DisplayModal.js
Created Aug 10, 2014
Open a react-bootstrap.Modal from a react-router Route
View DisplayModal.js
/** @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],
cassus /
Last active Aug 29, 2015
Action button on django model edit page
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)
cassus /
Last active Jun 17, 2019
Django admin action as row button
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>',
actions_html.allow_tags = True
actions_html.short_description = "Actions"
cassus /
Created Aug 14, 2013
Load repo history to sonar
#!/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):