Skip to content

Instantly share code, notes, and snippets.

View Manuelandro's full-sized avatar
💭
I may be slow to respond.

Manuel Palma Manuelandro

💭
I may be slow to respond.
  • Solana Beach
  • Milan
View GitHub Profile
@Manuelandro
Manuelandro / index.js
Created September 29, 2021 17:32
Altered console.log
/**
* Time complexity O(n)
**/
// clone the function before reassignin a value to console.log
const log = console.log.bind({});
console.log = function (...args) {
const argsAndTypes = []
@Manuelandro
Manuelandro / flatten.js
Created June 17, 2019 09:35
Old fashioned flatten array
/**
* By the current state of EcmaScript,
* I would definitely use Array.proptotype.flat / Array.prototype.flatMap
* This is how I did flat arrays in the past without the use of external libraries
*
* The whole point is to make use of recursion to loop deep inside
*/
// extend matchers to simplify test -> see https://github.com/jest-community/jest-extended
import 'jest-extended'
@Manuelandro
Manuelandro / fb-page-access-token-no-expire
Created January 17, 2018 16:58 — forked from lucnap/fb-page-access-token-no-expire
How to get a Facebook Page Access Token that doesn't expire Never!
How to get a Facebook Page Access Token that doesn't expire Never!
- Go to http://developers.facebook.com/tools/explorer/
- Get a User Access Token with a permission "manage_pages"
- Convert this short-lived access token into a long-lived one by making this Graph API call:
https://graph.facebook.com/v2.6/oauth/access_token?client_id=<your FB App ID >&client_secret=<your FB App secret>&grant_type=fb_exchange_token&fb_exchange_token=<your short-lived access token>
- Make a call Graph API:
https://graph.facebook.com/v2.6/<your personal account FB user id>/accounts?access_token=<your long-lived access token>
- The returned access_token has no expiration unless you change your password or not more admin of the target page or deauthorize FB page
import React, { Component } from ‘React’
import HighOrderBoundarie from ‘./components/boundarie’
class App extends Component {
...
...
render() {
import React, { Component } from ‘React’
import MyFallbackComponent from ‘./components/fallback’
const HighOrderBoundarie = (MyComponent) =>
class ErrorBoundaries extends Component {
state = {
errorFound: false
}
componentDidCatch(error, info) {
class JustOurComponent extends Component {
state = {
errorFound: false
}
componentDidCatch(error, info) {
/* here is where the magic happens.
code inside here is executed if an error
itn thrown from children */
this.setState({ errorFound: true })
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@Manuelandro
Manuelandro / introrx.md
Created February 14, 2017 21:51 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing