Skip to content

Instantly share code, notes, and snippets.

View ampc's full-sized avatar
🇵🇹
Hi

Antonio Carvalho ampc

🇵🇹
Hi
  • Critical TechWorks | BMW Group
  • Porto
View GitHub Profile
@ampc
ampc / openshift-cheatsheet.md
Created November 24, 2020 15:03 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@ampc
ampc / cypress_xhr.js
Last active October 1, 2018 10:22 — forked from axle07/cypress_xhr.js
Cypress.js: Assert that an XHR POST was successful.
describe('XHR form submission test', () => {
before(() => {
cy.server()
cy.visit('/testurl')
})
it('successfully submits an XHR on form submission', () => {
cy.get('[data-test="form"]').within(() => {
cy.get('#test-input').type('spyfu.com')
cy.route('POST', '/sumbit/here').as('postForm') // note that the route needs to match trailing slashes
cy.get('button[type="submit"]').click()
@ampc
ampc / gist:ec056f88e788a80bd80ce06217a39e20
Created July 10, 2017 18:28 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
2016-03-18 12:23:10 +0000
make
gcc-4.9 -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall -Wstrict-aliasing=2 -c -shared -fPIC -DBP_FREE -O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -I/usr/local/opt/gmp/include -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEPTH_LIMIT=1 -DTHREADS=1 -D_GNU_SOURCE -DTABLING=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -I/usr/local/opt/gmp/include -I/usr/local/opt/readline/include -I. -I./H -I./OPTYap -I./BEAM -I./MYDDAS -I./include ./console/yap.c -o yap.o
gcc-4.9 -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall -Wstrict-aliasing=2 -c -shared -fPIC -DBP_FREE -O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -I/usr/local/opt/gmp/include -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEPTH_LIMIT=1 -DTHREADS=1 -D_GNU_SOURCE -DTABLING=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -I/usr/local/opt/gmp/include -I/usr/local/opt/readline/include -I. -I./H -I./OPTYap -I./BEAM -I./MYDDAS C/agc.c -o agc.o
g
class Doente {
String nome; // nome do doente
int t_chegada; // hora de chegada (em minutos) entre 0 e 1440
int t_atend; // tempo que demorara o atendimento (em minutos)
int t_entrada; // tempo em que comecou a ser atendido
// construtor
Doente(String n,int tc, int ta) {
nome = n;
t_chegada = tc;