Skip to content

Instantly share code, notes, and snippets.

View joaodrp's full-sized avatar

João Pereira joaodrp

View GitHub Profile

Keybase proof

I hereby claim:

  • I am joaodrp on github.
  • I am joaodrp (https://keybase.io/joaodrp) on keybase.
  • I have a public key ASDT5wWsA2NKIwxVFo3ER2BkYbXL6ux9E6ljBNmREGXz0Ao

To claim this, I am signing this object:

$ rqlite
127.0.0.1:4001> .help
.help Show this message
.indexes Show names of all indexes
.schema Show CREATE statements for all tables
.status Show status and diagnostic information for connected node
.expvar Show expvar (Go runtime) information for connected node
.tables List names of tables
.timer on|off Turn SQL timer on or off
127.0.0.1:4001> SELECT * FROM foo
@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)
$ docker history hello-world-react-multi
IMAGE CREATED CREATED BY SIZE
24670e7da23a About a minute ago /bin/sh -c #(nop) COPY multi:22e02a340948b... 1.95MB
4695be7b167c About a minute ago /bin/sh -c #(nop) WORKDIR /usr/share/nginx... 0B
21a2450d623e 3 days ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daem... 0B
<missing> 3 days ago /bin/sh -c #(nop) STOPSIGNAL [SIGTERM] 0B
<missing> 3 days ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B
<missing> 3 days ago /bin/sh -c #(nop) COPY file:1d1ac3b9a14c94... 1.09kB
<missing> 3 days ago /bin/sh -c #(nop) COPY file:af94db45bb7e4b... 643B
<missing> 3 days ago /bin/sh -c GPG_KEYS=B0F4253373F8F6F510D421... 11.5MB
$ docker history hello-world-react
IMAGE CREATED CREATED BY SIZE
00cf24167b69 20 seconds ago /bin/sh -c apk del nodejs 26.7kB
26d976b24d47 22 seconds ago /bin/sh -c #(nop) WORKDIR /usr/share/nginx... 0B
c7d9c40c42d8 22 seconds ago /bin/sh -c cp -r ./build/** /usr/share/ngi... 1.95MB
f56be85e0f32 25 seconds ago /bin/sh -c npm install --production && n... 183MB
da4df67e4bcb 3 minutes ago /bin/sh -c #(nop) COPY dir:268e4e3e6bbc74a... 375kB
d50372672895 15 minutes ago /bin/sh -c #(nop) WORKDIR /src/app 0B
dbaf6b80e77a 15 minutes ago /bin/sh -c apk --no-cache add nodejs 28.4MB
21a2450d623e 3 days ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daem... 0B
$ docker history hello-world-go-multi
IMAGE CREATED CREATED BY SIZE
ea51dd184d58 2 minutes ago /bin/sh -c #(nop) CMD ["./hello-world"] 0B
10ba0619b65c 2 minutes ago /bin/sh -c #(nop) COPY dir:0369fffbae7eaf4... 1.86MB
d82070a626fa 2 minutes ago /bin/sh -c #(nop) WORKDIR /src/app 0B
76da55c8019d 3 days ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
<missing> 3 days ago /bin/sh -c #(nop) ADD file:4583e12bf5caec4... 3.97MB
$ docker history hello-world-go
IMAGE CREATED CREATED BY SIZE
89f4b3330c9d 14 minutes ago /bin/sh -c #(nop) CMD ["./hello-world"] 0B
214fd4f5ac0c 14 minutes ago /bin/sh -c go build -o hello-world 1.86MB
2e3c915dc835 14 minutes ago /bin/sh -c #(nop) COPY file:2d548923cbd267... 72B
320edf382c83 14 minutes ago /bin/sh -c #(nop) WORKDIR /src/app 0B
ed119d8f7db5 2 days ago /bin/sh -c #(nop) COPY file:ea7c9f4702f94a... 2.48kB
<missing> 2 days ago /bin/sh -c #(nop) WORKDIR /go 0B
<missing> 2 days ago /bin/sh -c mkdir -p "$GOPATH/src" "$GOPATH... 0B
<missing> 2 days ago /bin/sh -c #(nop) ENV PATH=/go/bin:/usr/l... 0B
#
# s3_store.rb
#
require "em-synchrony"
require "em-synchrony/em-http"
class S3Store
def initialize(uri)
@uri = uri
end