Skip to content

Instantly share code, notes, and snippets.

@jessepollak
jessepollak / page.html
Created June 24, 2015 01:33
Styling around the Clef embed
<html class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths">
<head></head>
<body id="login" data-twttr-rendered="true"><div id="pubnub" ssl="on" style="position: absolute; top: -1000px;"></div>
<div class="row">
<div class="header text-center">
<p>Sign in to your Clef dashboard.</p>
</div>
@jessepollak
jessepollak / async-clef.js
Created July 5, 2015 07:20
Load clef.js asynchronously
(function(d, s, id) {
var js, ejs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//clef.io/v3.1/clef.js";
ejs.parentNode.insertBefore(js, ejs);
}(document, 'script', 'clef-js'));
@jessepollak
jessepollak / clef-wave.js
Last active August 29, 2015 14:24
Easily add the Clef wave to any button
// tween.js v.0.15.0 https://github.com/sole/tween.js
void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var TWEEN=TWEEN||function(){var n=[];return{REVISION:"14",getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var r=n.indexOf(t);-1!==r&&n.splice(r,1)},update:function(t){if(0===n.length)return!1;var r=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();r<n.length;)n[r].update(t)?r++:n.splice(r,1);return!0}}}();TWEEN.Tween=function(n){var t=n,r={},i={},u={},o=1e3,e=0,a=!1,f=!1,c=!1,s=0,h=null,l=TWEEN.Easing.Linear.None,p=TWEEN.Interpolation.Linear,E=[],d=null,v=!1,I=null,w=null,M=null;for(var O in n)r[O]=parseFloat(n[O],10);this.to=function(n,t){return void 0!==t&&(o=t),i=n,this},this.start=function(n){TWEEN.add(this),f=!0,v=!1,h=void 0!==n?n:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance
@jessepollak
jessepollak / automatic_logout.php
Last active August 29, 2015 14:24
Automatic logout with Clef with Pusher
<?php
// On the backend we have the Pusher object set up
$PUSHER_APP_ID = 'YOUR_APP_ID';
$PUSHER_APP_KEY = 'YOUR_APP_KEY';
$PUSHER_APP_SECRET = 'YOUR_APP_SECRET';
$pusher = new Pusher( $PUSHER_APP_KEY, $PUSHER_APP_SECRET, $PUSHER_APP_ID );
// then, when a user logs out via Clef, we trigger a logout message
@jessepollak
jessepollak / keen_proxy.py
Created July 22, 2015 00:44
A keen.io proxy for doing super scoped keys
from flask import (
Blueprint,
request,
current_app,
render_template,
redirect,
url_for,
session,
jsonify,
flash,
@jessepollak
jessepollak / tmux-cheatsheet.markdown
Created January 3, 2016 02:07 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jessepollak
jessepollak / ClefButton.jsx
Created February 17, 2016 22:58
A React component to use the Clef button
//
// Requires:
//
// react-async-script-loader
//
import React, {Component} from 'react'
import ReactDOM from 'react-dom'
import scriptLoader from 'react-async-script-loader'
class ClefButton extends Component {
/* globals params */
/* Retention.jql
*
* A JQL query that gets retention data over a time period.
*
* Params:
*
* - fromDate: new Date
* - toDate: new Date
* - startEvents: [ jql.types.Event ]

Keybase proof

I hereby claim:

  • I am jessepollak on github.
  • I am jessepollak (https://keybase.io/jessepollak) on keybase.
  • I have a public key ASAIfjLbTykSXjtbKpPIhdfLneFSZRyciguJhz5-xGXrrQo

To claim this, I am signing this object: