Skip to content

Instantly share code, notes, and snippets.

View jessepollak's full-sized avatar

Jesse Pollak jessepollak

View GitHub Profile

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:

/* 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 ]
@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 {
@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 / 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 / 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 / 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 / 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 / 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 / Create_Clef_Application.md
Last active August 29, 2015 14:00
Clef application iframe guide

Anyone can use the easy-embed Clef application creation iframe to allow users of their plugin to quickly create a Clef application for their site without leaving the plugin environment.

Embeding the iframe

When you embed the iframe, you must provide a variety of variables, which allow Clef to customize the experience for the user. Each of these variables must be passed as a URL parameter with a URL encoded value.

  • domain — The domain that the website is hosted on. In WordPress, we get this value by accessing urlencode(get_option('site_url')).

  • name - The name of the application that will be created. In WordPress we get this value by accessing urlencode(get_option('blogname')).