Skip to content

Instantly share code, notes, and snippets.

View mariosanchez's full-sized avatar

Mario Sánchez mariosanchez

View GitHub Profile
@mariosanchez
mariosanchez / git_aliases.txt
Last active December 27, 2018 15:17 — forked from jaumecapdevila/git_aliases.txt
Basic git aliases and configs
[user]
email = <your email>
name = <yout name>
[alias]
ci = commit
st = status
s = status
a = !git add -A && git status
co = checkout
@mariosanchez
mariosanchez / react.md
Last active October 27, 2017 12:17 — forked from monicao/react.md
React Lifecycle Cheatsheet

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
{
	// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	"Print to console": {
		"prefix": "log",
 "body": [
@mariosanchez
mariosanchez / truquis-linux-mint.md
Created March 16, 2019 13:16
Truquis Linux Mint

Para que no te habra los directorios con PHP Storm

xdg-mime default caja-folder-handler.desktop inode/directory

// ensure the keys being passed is an array of key paths
// example: 'a.b' becomes ['a', 'b'] unless it was already ['a', 'b']
const keys = ks => Array.isArray(ks) ? ks : ks.split('.')
// traverse the set of keys left to right,
// returning the current value in each iteration.
// if at any point the value for the current key does not exist,
// return the default value
const deepGet = (o, kp, d) => keys(kp).reduce((o, k) => o && o[k] || d, o)
@mariosanchez
mariosanchez / parallel-fetch.js
Created April 13, 2020 07:59 — forked from ericelliott/parallel-fetch.js
Parallel requests example
// setup
const wait = value => new Promise(resolve => {
setTimeout(() => resolve(value), 3000);
});
const fetchFoo = () => wait('foo');
const fetchBar = () => wait('bar');
const fetchBaz = () => wait('baz');
const fetchDataSlowly = async time => {
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
executors:
builder:
docker:
- image: circleci/node:10.15.3
@mariosanchez
mariosanchez / updateDynamoDB.js
Last active June 5, 2021 17:31
DynamoDB node.js update multiple elements
// ------------ NodeJS runtime ---------------
// Add aws-sdk in package.json as a dependency
// Example:
// {
// "dependencies": {
// "aws-sdk": "^2.0.9",
// }
// }
// Create your credentials file at ~/.aws/credentials (C:\Users\USER_NAME\.aws\credentials for Windows users)
// Format of the above file should be: