Skip to content

Instantly share code, notes, and snippets.

View compleatang's full-sized avatar

Casey Kuhlman compleatang

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 = {
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@steeve
steeve / _readme.md
Last active July 9, 2024 04:49
How to cross compile Go with CGO programs for a different OS/Arch

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@miklschmidt
miklschmidt / server.coffee
Created July 1, 2013 18:42
Scripts for making autoupdates in node-webkit for Linux and Windows. This is a very early work in progress, more like a proof of concept. TODO: Add OS X support. Check for and notify about filelocks. Use a real db. Abstract out update logic into strategies (node-webkit, assets, updater). Use semver for version handling. Changelogs in Markdown. P…
fs = require('fs')
http = require('http')
https = require('https')
express = require('express')
path = require 'path'
_ = require('underscore')
sessionToken = "secretString"
secretUploadPass = "Change me"
secretPass = "Change me too"
@glurp
glurp / gtk3.css
Last active December 11, 2015 20:49
a theme for gnome3 on windows
/* put this file in
*
D:\usr\Ruby\ruby19\lib\ruby\gems\1.9.1\gems\gdk3-1.2.0-x86-mingw32\vendor\local\...
* ...share\themes\GreyBird\gtk-3.0\gtk.css
*
* update the file :
*
ruby19\lib\ruby\gems\1.9.1\gems\gdk3-1.2.0-x86-mingw32\vendor\local\etc\...
* ..gtk-3.0\settings.ini
* with :
@uu59
uu59 / .gitignore
Created August 13, 2012 08:12
socket.io and Sinatra
vendor/
.bundle/
node_modules/
Gemfile.lock
@freegenie
freegenie / Gemfile
Created March 10, 2012 22:18
EventMachine + ZeroMQ Pipeline Pattern
# vim: ft=ruby
source :rubygems
gem 'eventmachine'
gem 'em-zeromq', :path => '~/Work/em-zeromq'
gem 'sinatra'
gem 'zmq'
@wolfeidau
wolfeidau / sass_converter.rb
Created May 7, 2011 02:43
Sass plugin for Jekyll
module Jekyll
# Sass plugin to convert .scss to .css
#
# Note: This is configured to use the new css like syntax available in sass.
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end