Skip to content

Instantly share code, notes, and snippets.

View NoriSte's full-sized avatar

Stefano Magni NoriSte

View GitHub Profile
@NoriSte
NoriSte / virtualbox-linux-no-lan
Created November 8, 2018 13:57
In case Linux on VirtualBox loses the internet connection
$ sudo dhclient enp0s8
@NoriSte
NoriSte / redux-saga-typeguard.ts
Last active November 1, 2023 02:22
Redux-saga + Typescript: implementing typeguard for Axios AJAX requests
import { AxiosResponse } from "axios";
// the kind of data I expect from the AJAX request...
interface AuthData {
access_token?: string;
refresh_token?: string;
}
// ... a type dedicated to the Axios response...
type AuthResponse = AxiosResponse<AuthData>;
@NoriSte
NoriSte / git-diff-to-archive
Created March 20, 2019 10:20
Create an archive containing all the files changed between two commits
$ git diff --name-only IDCOMMIT1 IDCOMMIT2 | xargs tar -czf gitdiff-result.tar.gz
@NoriSte
NoriSte / README.md
Last active May 9, 2019 05:04
list-package-json-scripts
@NoriSte
NoriSte / README.md
Created June 17, 2019 07:55
Conio Business site monitoring

A Cypress test checking the most common issues faced by Conio with the AWS/S3 management (with a custom configuration for Brotli)

@NoriSte
NoriSte / README.md
Created July 15, 2019 13:53
TypeScript and PropTypes
@NoriSte
NoriSte / index.js
Last active July 17, 2019 15:27
Recursive promise
let recursivePromise = (partial = []) => {
return new Promise((resolve, reject) => {
const result = /* your logic */;
resolve(result);
//reject();
}).then((result) => {
partial.push(result);
if(/* when to continue recursively */) {
return recursivePromise(partial);
}
@NoriSte
NoriSte / machine.js
Last active August 1, 2019 10:27
Old Conio BO Auth Flow - Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@NoriSte
NoriSte / machine.js
Last active August 1, 2019 10:27
New Conio BO Auth Flow - Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions