Skip to content

Instantly share code, notes, and snippets.

View mapreal19's full-sized avatar
🎯
Focusing

Mario Pérez Alarcón mapreal19

🎯
Focusing
View GitHub Profile
@mapreal19
mapreal19 / some_test.js
Created February 12, 2019 16:29 — forked from mbrochh/some_test.js
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()
Function PlusOne(number As Integer) As Integer
PlusOne = number + 1
End Function
Sub PrintNumber(number As Integer)
Console.WriteLine(number)
End Sub
Dim number As Integer = 3
Select Case number
Case 1 To 5
Console.WriteLine("Between 1 and 5, inclusive")
Case 6, 7, 8
Console.WriteLine("Between 6 and 8, inclusive")
Case 9 To 10
Console.WriteLine("Equal to 9 or 10")
Case Else
function check() {
fb_checks = document.querySelectorAll('a[role="checkbox"]');
for(i = 0; i < fb_checks.length; i++) {
if(fb_checks[i].getAttribute('aria-checked') == 'false') {
fb_checks[i].click();
}
}
}
function forDisplay(num, index) {
return {
time: index,
value: num
};
}
function nTimesArray(arr, nTimes) {
return [].concat.apply([], Array.apply(null, Array(nTimes)).map(function() {
return arr;
% This script sets up a very simple simulation of habituation
% of the Aplysia gill withdrawal reflex.
% The size of the output (B) decreases with each input (A)
function main
startWeight = 4;
weigthDecrement = 0.7;
pulse = [0 0 1 0 0];
@mapreal19
mapreal19 / fetch-rails.js
Created September 8, 2015 09:09
fetch-in-rails
submitComment(comment) {
const csrfToken = $('meta[name=csrf-token]').attr('content'); // Retrieve token from `csrf_meta_tags`
return fetch(API_URL, {
method: 'post',
credentials: 'same-origin', // Needed. See https://github.com/github/fetch#sending-cookies
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-CSRF-Token': csrfToken,
@mapreal19
mapreal19 / scriptCom.js
Last active January 2, 2016 15:09
Comunio Puntos
function calcPtos()
{
var _i, _fila;
var _filas_tabla = $('#tablestandings tr');
var _pushed;
var myMappings = [];
//Somos 7 jugadores
for (_i = 1; _i < _filas_tabla.length; _i += 1) {
_pushed = false