Skip to content

Instantly share code, notes, and snippets.

View gauthierm's full-sized avatar

Michael Gauthier gauthierm

View GitHub Profile
@mbrochh
mbrochh / some_test.js
Last active February 8, 2024 13:02
Controlling a Stripe payent popup with Cypress.io
// for this to work you need to set `"chromeWebSecurity": false` in cypress.json
describe('Make Stripe Payment', function() {
before(function() {
cy.visit('http://localhost:3000/en/stripe/checkout/')
Cypress.Cookies.preserveOnce('sessionid')
})
it('should enter credit card details and finalise payment', function() {
cy.get('[data-test="button-FormStripeCart-PayWithCreditCard"]').click()
@blueyed
blueyed / xterm-bg.sh
Last active March 19, 2024 01:02
Query background setting from terminal (xterm / rxvt-unicode)
#!/bin/sh
#
# Query a property from the terminal, e.g. background color.
#
# XTerm Operating System Commands
# "ESC ] Ps;Pt ST"
oldstty=$(stty -g)
# What to query?
@elis
elis / ApplicationRoute
Created November 26, 2013 15:17
Login/Authentication Process using Ember
var ApplicationRoute = Ember.Route.extend({
beforeModel: function () {
var self = this,
user = this.controllerFor('currentUser');
if (user.get('isLoggedIn')) {
var verifyPromise = user.verifyToken();
return verifyPromise.then(function(userName) {
self.transitionTo('/');
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048