Skip to content

Instantly share code, notes, and snippets.

View joaodrp's full-sized avatar

João Pereira joaodrp

View GitHub Profile
@joaodrp
joaodrp / rbenv-ruby187-highsierra.sh
Created December 15, 2017 15:24 — forked from nerdo/rbenv-ruby187-highsierra.sh
Install ruby-1.8.7 with rbenv on macOS High Sierra (10.13)
#!/bin/sh
# 1) Install HomeBrew
# 2) brew install openssl gcc@4.9 rbenv
# 3) Setup rbenv
CC=gcc-4.9 \
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls -I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
rbenv install 1.8.7-p375
@joaodrp
joaodrp / client_code.js
Created October 16, 2017 21:30 — forked from petermikitsh/client_code.js
SAML implementation for feathers.js
/* SAML Authentication Flow
* - Open GET /SSO/SAML2 in an iframe
* - this will redirect to the identity provider ("IdP")
* - The user will insert their credentials in the IdP's website
* - The IdP will redirect to POST /SSO/SAML2
* - The response is validated
* - A user is created (should check if it exists first)
* - Set the JWT cookie
* - Send HTML response to instruct parent window to close the iframe
*/
function injectGitFileStatus()
{
const timeout = 5000;
const addedColor = "#98C379";
const modifiedColor = "#D19A66";
const stagedColor = "#E06059";
const ignoredOpacity = "0.4";
const explorer = document.getElementById("workbench.view.explorer");
if (explorer)
@joaodrp
joaodrp / benchmark.sh
Created October 28, 2011 14:11 — forked from emersonmoretto/benchmark.sh
Apache bench + Gnuplot Script with custom line titles and cleaning *.out files
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <line tittle>:<URL1> <line tittle>:<URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 google:http://www.google.com/ bing:http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'