Skip to content

Instantly share code, notes, and snippets.

View Pablets's full-sized avatar
馃彔
Working from home

Pablo Godoy Pablets

馃彔
Working from home
View GitHub Profile
@Pablets
Pablets / TO-DO.md
Last active October 12, 2021 16:48
Lista de tareas

La idea es guardar la info de FW y Portal en el mismo m茅todo que se utiliza para comprobar actualizaciones, de este modo me aseguro de ejecutar la comprobaci贸n de versi贸n justo antes de comenzar el proceso de actualizaci贸n y que nunca se "pisen" dichos m茅todos.

async getVersionInfo(){
	let firmVer = localStorage.getItem('firmVer') || null
	let portalVer = localStorage.getItem('portalVer') || null

	return {
		firmVer,
 portalVer

async getStory(site = {}, record = {}, dateNow = '', dateUrl = '') { // console.log('WeatherController.getStory(609)', {site, dateNow, dateUrl}); const dateNowDay = fecha.format(dateNow, 'dddd DD'); const dateNowMonth = fecha.format(dateNow, 'MMMM'); const dateNowYear = fecha.format(dateNow, 'YYYY'); // console.log('WeatherController.getStory(613)', JSON.stringify(record)); const cityName = record.item.city; const provinceName = record.item.province; const provinceUrl = normalizeUrl(provinceName); const cityUrl = normalizeUrl(cityName);

@Pablets
Pablets / proAndCities.md
Last active July 26, 2021 14:08
Generar json de provincias y ciudades en weather controller

//#region /* let provincesAndCities = {}; let arrayOfProvincesAndCities = []; // for (let province of provinces) { let arrayOfCities = []; let provinceName; let key; for (let location of locations) {

@Pablets
Pablets / pm2.md
Last active September 21, 2021 19:11
Descripci贸n de scripts PM2

Use pm2 logs index [--lines 1000] to display logs

Use describe <name | id> describe all parameters of a process

Use pm2 env 0 to display environment variables

Use pm2 monit to monitor CPU and Memory usage index

Use pm2 stop <name> to stop a specific process

@Pablets
Pablets / README.txt
Last active December 8, 2021 01:19
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@Pablets
Pablets / addresses.md
Last active December 8, 2021 16:39
ethereum

0x28a99b6C5cB10572A8484260606f17a2103e00A3

ABI:

[{"constant":true,"inputs":[],"name":"manager","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pickWinner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getPlayers","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"enter","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"players","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

contract deployed at:

0x02D571f36F63A2d7a5296717BAf65765CC93431c

/*
* Custom timeout
*
* La complejidad de la soluci贸n viene de la necesidad de poder demostrar que
* funciona con la implementaci贸n de un custom setInterval.
*
* Su utilizaci贸n es similiar a setTimeout():
*
* setTimeout(cb, ms)
*
  • redux/
    • store.ts
    • storeTypes.ts
    • reducers/
      • sample/
        • sampleReducer.ts聽// Manejo de estado
        • sampleState.ts聽// Declaraci贸n de la interface del estado y聽 declaraci贸n del estado inicial聽
        • sampleTypes.ts聽// action types (constantes)
        • sampleAction.ts聽// Action dispatchers y creators (primero creators, y dispatchers al final)
  • index.ts聽//combine reducer

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?