Skip to content

Instantly share code, notes, and snippets.

//Headers: AppAuthorization
const axios = require('axios');
let c = {};
let token;
c.headers = {'AppAuthorization': 'RTFM'};
// ppur objVoie: CODE COMMUNE : code insee, codeVoie (propre à orange), numVoie : numéro maison ou immeuble normalement
const objVoie = {codeCommune: '01...', codeVoie : '', numVoie: '' };
@guizmo51
guizmo51 / communication.js
Created September 23, 2021 18:20
communication between Cypress and Vue app
// ======CYPRESS_SIDE========
//$window is available with cy.window() or in Cypress.Command
// $window = window's object | postMessage(options)
// postMessage allows cross-origin communication between Window objects
// Direction: CYPRESS => APP
$window.postMessage(OBJECT);
@guizmo51
guizmo51 / gist:ac5d4cc58d047596f039f37f97958864
Created January 16, 2020 09:42
Upgrade AWS ELASTICBEANSTALK php 7.2 to 7.3
aws elasticbeanstalk update-environment --environment-name [ENV_NAME] --solution-stack-name "64bit Amazon Linux 2018.03 v2.9.1 running PHP 7.3"
#you can also use environment-id instead of name
@guizmo51
guizmo51 / si.vue
Created December 21, 2019 13:46
sportident
this.webusb(navigator.usb).detect().then((d) => {
this.device = d;
this.station = SiMainStation.fromSiDevice(this.device);
this.station.addEventListener('siCardInserted', (s) => {
this.stationWorking = true;
s.siCard.read().then((d) => {
});
});
@guizmo51
guizmo51 / gist:e4c2c7d1b9c1f1c2c38bb1f3e981878e
Created July 18, 2016 14:08
Script pour concours RT Follow Twitter
var Twitter = require('twitter');
var client = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
});
client.get('search/tweets', {
@guizmo51
guizmo51 / gist:876d8ce1fd10d3b5692f0008f025594f
Created April 11, 2016 08:38
Mass twitter unfollowing script (to execute in the chrome developer console)
setInterval(function(){
$('.following .follow-button').trigger('click');
$('html, body').animate({ scrollTop: $(document).height() }, 50);
}, 3000);
@guizmo51
guizmo51 / gist:6f45655e3afda2ed3559
Created January 4, 2016 19:12
Tweets RER_A sur colis suspect
[{
"text": "En répercussion d'un colis suspect et d'une panne de matériel, le trafic est fortement ralenti sur l'ensemble de la ligne. #RERA #RATP",
"date": "2015-07-09T06:51:33.000Z",
"id": "619036149282156544"
}, {
"text": "08:44, le trafic reprend progressivement (colis suspect) #RATP #RERA",
"date": "2015-07-09T06:45:29.000Z",
"id": "619034622136090624"
}, {
"text": "08:13, le trafic est interrompu entre Auber et Vincennes (colis suspect) #RATP #RERA",
setStates { RF_CH: 4 }
setStates { RF_PWR: 3 }
setStates { RF_DR_LOW: false, RF_DR_HIGH: false }
setStates { EN_CRC: true, CRCO: 1 }
setStates { ARC: 15, ARD: 15 }
Set CE low.
blocked for 130µs.
Set CE low.
blocked for 130µs.
execCommand FLUSH_TX 0
setStates { RF_CH: 4 }
setStates { RF_PWR: 3 }
setStates { RF_DR_LOW: false, RF_DR_HIGH: false }
setStates { EN_CRC: true, CRCO: 1 }
setStates { ARC: 15, ARD: 15 }
Set CE low.
blocked for 130µs.
Set CE low.
blocked for 130µs.
execCommand FLUSH_TX 0
{
"id": 110072314,
"pseudo": "Vic",
"online": true,
"sex": 1,
"$ref": "http://www.adopteunmec.com/api/users/110072314",
"age": 22,
"city": "Rive-de-Gier",
"cover": "http://s4.adopteunmec.com/fr/4/1/3/2/7/0/0/1/13",
"last_cnx": "2014-09-10 00:29:12",