Skip to content

Instantly share code, notes, and snippets.

View thameera's full-sized avatar

Thameera Senanayaka thameera

View GitHub Profile
@thameera
thameera / zendesk-trigger-compiler.js
Last active June 27, 2017 08:52
wt compiler for zendesk+auth0 extend integration demo
'use strict';
module.exports = (options, cb) => {
console.log('a');
options.nodejsCompiler(options.script, (e, Func) => {
console.log('b');
if (e) return cb(e);
console.log('c');
let instance = new Func();
@thameera
thameera / linkedin.html
Created May 30, 2017 03:21
Auth0.js 7.6 popup mode - linkedin
<!DOCTYPE html>
<html>
<body>
<script src="//cdn.auth0.com/w2/auth0-7.6.1.min.js"></script>
<button type="button" onclick="login()">Log in</button>
<script type="text/javascript">
@thameera
thameera / change-secret.md
Last active September 3, 2016 05:26
How to change Auth0 global client secret

You can revoke the global client secret yourself as follows:

  1. Go to your Account Settings -> Advanced tab and copy the Global Client ID value.
  2. Go to the Management API v2 Explorer
  3. Click on Clients -> Update a client in the left sidebar.
  4. In the center panel, select the scopes update:clients and update:client_keys.
  5. In the id textbox, paste the global client ID that you copied in step 1.
  6. Enter the new global client secret in the body textarea, like this:
@thameera
thameera / Zendesk-Slack-post.md
Last active August 31, 2016 11:12
Mention Slack users in Zendesk using Webtasks

Whenever you get a cool idea to create an app, the mere thought of preparing and maintaining a server always gets you down. Not to mention all the security considerations you have to think through. The advent of PaaS services like Heroku solved this to some extent. Now that serverless technologies have come into the mainstream, bringing your ideas into reality is easier than ever.

Serverless platforms allows you to focus more on the code and get real work done without worrying about managing servers. Many people prefer the term FaaS (Function-as-a-Service) to serverless, because what essentially functions are the unit of application logic in this realm. Auth0's Webtask is a hassle-free serverless platform to deploy and run your functions.

At Auth0, we tend to solve most of our problems using Webtasks. Here's an example of how we used them to create a Slack bot to tackle a pressing need we had.

The Problem

Not to brag, but Auth0 is known for its wonderful customer service. We use

@thameera
thameera / surfingkeys.txt
Last active May 31, 2025 12:54
SurfingKeys config
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Normal.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// Map disabling surfing keys hotkey
map('<Ctrl-i>', '<Alt-s>');
// Free up Alt-s for jetzt's use
unmap('<Alt-s>');
@thameera
thameera / template.html
Created July 25, 2016 09:23
Auth0 login page with Lock v10
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html, body { padding: 0; margin: 0; }
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgIyENN+isSjR76vaB0iTfP4njkg2RfuzO1RbrGQngn/sKp3BheWxvYWTFAux7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTIwMjMyMTBkMzdlOGFjNGEzNDdiZWFmNjgxZDIyNGRmM2Y4OWUzOTIwZDkxN2VlY2NlZDUxNmViMTkwOWUwOWZmYjBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwMjMyMTBkMzdlOGFjNGEzNDdiZWFmNjgxZDIyNGRmM2Y4OWUzOTIwZDkxN2VlY2NlZDUxNmViMTkwOWUwOWZmYjBhIiwidWlkIjoiNjczODQ5NjJlMTAxYzY0Mjc2MGJkODVkNjRkN2I2MTkiLCJ1c2VybmFtZSI6InRoYW1lZXJhIn0sInNlcnZpY2UiOnsibmFtZSI6ImdpdGh1YiIsInVzZXJuYW1lIjoidGhhbWVlcmEifSwidHlwZSI6IndlYl9zZXJ2aWNlX2JpbmRpbmciLCJ2ZXJzaW9uIjoxfSwiY2xpZW50Ijp7Im5hbWUiOiJrZXliYXNlLmlvIGdvIGNsaWVudCIsInZlcnNpb24iOiIxLjAuMTYifSwiY3RpbWUiOjE0Njc5MjgzODIsImV4cGlyZV9pbiI6NTA0NTc2MDAwLCJtZXJrbGVfcm9vdCI6eyJjdGltZSI6MTQ2NzkyODMyOSwiaGFzaCI6IjNkM2RmMTBjNGE3YzYxMzUwZDYxMDI2ZTFjMTE0MzQxODMyZTgzZWY1ZmFhNjkzMTExNDU0MzA5NzExMjFmNmE2YzBjNTE4ZTFiODIxMTA2ZDE2MWRkY2E0N2FjNDc4YzI1Y2YyMzU1YjYwZjkxOTZmZDRiZTJlOTI4OTk2NWM3Iiwic2Vxbm8iOjUxMjk1NH0sInByZXYiOiI1YjM0ZjJkZTg2MDliN2I1ZWIwNzFkMTNlMDYwNWVkOTdi
@thameera
thameera / create_and_link_users.js
Last active June 10, 2016 10:52
Auth0 - Create new passwordless user and link him to current account on first login
{% if request_language contains ",nl;" %}
Uw verificatie code: {{ code }}
{% elsif request_language contains ",es;" %}
Tu código de verificación es: {{ code }}
{% else %}
Your verification code is: {{ code }}
{% endif %}
@thameera
thameera / app.js
Created January 15, 2016 12:58
winston singleton
'use strict';
const logger = require('./logger');
const util = require('./util');
util.doStuff();