Skip to content

Instantly share code, notes, and snippets.

View vktr's full-sized avatar
🐒
Monkey coding

Viktor Elofsson vktr

🐒
Monkey coding
View GitHub Profile
@vktr
vktr / rule.js
Created February 10, 2018 18:54
Add Stripe Customer Id to Auth0 via custom rule
function (user, context, callback) {
user.app_metadata = user.app_metadata || {};
if ('stripe_customer_id' in user.app_metadata) {
context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id;
return callback(null, user, context);
}
var stripe = require('stripe')('sk_....');
var customer = {
@vktr
vktr / Vector.cpp
Created July 17, 2014 14:34
Managed wrapper for a std::vector<T>
template<typename T, typename U>
ref class Vector : System::Collections::Generic::IList<U>
{
private:
std::vector<T>* _vector;
ValueConverter<T, U>^ _converter;
internal:
Vector(std::vector<T> &vector, ValueConverter<T, U>^ converter)
{
@vktr
vktr / install.ps1
Last active August 29, 2015 14:02
Hadouken install script for Powershell
<#
Copyright (C) 2014 Viktor Elofsson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

Keybase proof

I hereby claim:

  • I am vktr on github.
  • I am viktorelofsson (https://keybase.io/viktorelofsson) on keybase.
  • I have a public key whose fingerprint is 77C5 05A0 7F7C 4973 E5F9 4A2D 5D66 75C7 1DF2 074F

To claim this, I am signing this object: