Skip to content

Instantly share code, notes, and snippets.

View drouillard's full-sized avatar

Douglas Drouillard drouillard

View GitHub Profile
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile(true) do
ruby '2.4.2'
source 'https://rubygems.org'
gem 'capybara'
gem 'faraday'
end
@shmookey
shmookey / translate.lhs
Last active January 18, 2020 19:24
off-chain storage for ethereum smart contracts
External storage on the EVM: a static recompilation approach 7 May 2017
Luke Williams <shmookey@shmookey.net> Rev. 3
This document describes a way of converting ordinary compiled EVM contracts to
a form suitable for use with an off-chain storage backend, such as the system
described by Smolenski for storing contract state on IPFS. This technique is
completely invisible to the contract developer and requires no modification to
contract logic. It is also generic to any EVM contract, regardless of the high
level language it was written in, and compatible with the public blockchain.
@tecsyscom
tecsyscom / gist:f0b5cce84821ad715d89532865376074
Created April 12, 2017 14:01
sample SAML request from keyCloak
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Destination="https://signin.aws.amazon.com/saml" ID="ID_15d519a5-88ac-4d2d-8206-409e570a0987" IssueInstant="2017-04-12T09:36:17.883Z" Version="2.0"><saml:Issuer>http://127.0.0.1:8080/auth/realms/aws</saml:Issuer><dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><dsig:Reference URI="#ID_15d519a5-88ac-4d2d-8206-409e570a0987"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>3cCxC7wj/4NIZAvVdU1xdlbfihU7q5OllDCLJ1TdbUw=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:Si
@paoloantinori
paoloantinori / keycloak.sh
Created January 26, 2016 15:59
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@gaearon
gaearon / ReduxMicroBoilerplate.js
Last active March 26, 2020 00:35
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------
@kristopherjohnson
kristopherjohnson / RoundRectButton.swift
Last active January 4, 2021 14:35
Swift: Custom UIButton subclass that displays a rounded rectangle in the background
import UIKit
/// UIButton subclass that draws a rounded rectangle in its background.
public class RoundRectButton: UIButton {
// MARK: Public interface
/// Corner radius of the background rectangle
public var roundRectCornerRadius: CGFloat = 8 {
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)