Skip to content

Instantly share code, notes, and snippets.

View demmer's full-sized avatar

Michael Demmer demmer

View GitHub Profile
@demmer
demmer / main.juttle
Last active August 29, 2015 14:25
Simple Input Controls
// Simple example of using input controls as parameters
input message: text -label 'Message to show' -default 'Testing...';
input num_points: dropdown -items [1,2,3,4,5,6,7,8] -label 'Number of points' -default 5;
emit -limit num_points
| put message="${message} ${count()}"
| @tile
@demmer
demmer / main.juttle
Created July 28, 2015 16:45
silly twitter analytics
// silly little juttle that compares the twitterati
(
emit -limit 1 | put name='demmer', tweets=12, followers=33, first_tweet=:2015-06-02:;
emit -limit 1 | put name='apurva', tweets=81, followers=71, first_tweet=:2002-06-18:;
emit -limit 1 | put name='henri', tweets=121, followers=61, first_tweet=:2007-12-31:;
)
| put followers_per_day = Duration.get(:now: - first_tweet, "days")
| put followers_per_tweet = followers / tweets
|(
@barchart -title "Followers" -valueField 'followers' -categoryField 'name';
@demmer
demmer / README.md
Last active January 28, 2016 17:28
Juttle API Proxy Example

Juttle API Proxy

This is a simple proof-of-concept example of how one could embed Juttle-powered charts and visualizations in a custom application.

Installing / Running

Requires node.js to be installed.

@demmer
demmer / extendable-base-to-es6-class.js
Created February 5, 2016 01:12
converter script to translate extendable-base classes into ES6 classes
#!/usr/bin/env node
//
// Script to convert any extendable-base derived classes in the specified
// files into proper ES6 classes.
//
// Along the way it will remove any require() statements for extendable-base
// itself, convert any prototype literals into ES6 properties, and add the
// appropriate superclass constructor invocations to get the same behavior as
// the extendable-base initialize chain.
//
@demmer
demmer / slack-messages-by-user.py
Created December 2, 2016 22:59
count slack messages posted to a channel by user
#!/usr/bin/python
'''
Script to count messages by user posted to a channel for a given date range.
Install:
# sudo pip install slackclient
Also you will need to obtain a slack API token:
https://api.slack.com/docs/oauth-test-tokens