Skip to content

Instantly share code, notes, and snippets.

@jessepollak
jessepollak / per_login_logout_hooks.md
Last active August 29, 2015 13:56
Using per-login Clef logout hooks

Using per-login Clef logout hooks

Previously, to use the Clef logout hook, you had to set a single logout hook on your Clef application. This logout hook would be hit every time a user logged out of your app.

With the new per-login Clef logout hooks, you can pass a URL to be hit as the logout hook every time a user logs in.

Passing the logout hook

Using this version of the logout hook is very easy. When you do the /authorize portion of the OAuth handshake, just specify the URL to be hit for logout.

In the icsauth/includes/functions.php, there's a function:

function ics_login_errors($error) {
  global $error;
  global $validation_error;
  if ($validation_error) {
    $error = "<b>Fehler: </b>Ihre ÖAK-Nummer konnte nicht gefunden werden, oder ist fehlerhaft. Bitte geben Sie diese erneut ein, um den Loginvorgang abzuschließen!";
  }
 else {
@jessepollak
jessepollak / gist:11262729
Created April 24, 2014 17:30
Clef badge without WordPress
<a href="https://bit.ly/wordpress-login-clef" class="clef-badge pretty" style="display: block; overflow: hidden; text-indent: -579px; height: 50px; width: 140px; background: url(http://bit.ly/clef-login-badge); background-size: 100% 100%; opacity: .8;">Secure Login Powered by Clef</a>
@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')).

@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 / final_proposal.md
Created October 1, 2012 06:41 — forked from dunvi/final_proposal.md
final proposal

Final Proposal

Our plan is to create a continuous integration server.

A variety of continuous integration server options already exist, such as Jenkins, CruiseControl, and Buildbot. These options, and many others, satisfy a variety of different user requirements; however, they all also suffer from problems. The largest problem is that most are massively complicated, built for the intricate needs of big, diverse teams that need an extremely customized set of needs. This means that they are massively configurable, but also means that it takes a serious chunk of time to set up any project. For small teams, testing is already a major hurdle, and setting up a continuous integration server takes so much time and expertise that it is difficult to justify.

We intend to build Rosie as a better option for small teams. Continuous integration is one of the best forms of testing feedback out there, and it should be easier to start using for any project. We are looking to shed much of the weight in current continuous