Skip to content

Instantly share code, notes, and snippets.

View merlox's full-sized avatar
😄
Building great things together!

merlox merlox

😄
Building great things together!
View GitHub Profile
function payProduct(req, cb){
console.log('PayProduct, functions.js');
let dataObject = req.body.data,
direccion = dataObject.direccion,
arrayProductos = dataObject.productos,
token = dataObject.token,
idPago = 0,
customerId = null,
error = null,
precioTotalCentimos = null,
@merlox
merlox / enabling brotli.txt
Created October 21, 2019 14:27
Here's how you enable brotli to load your web apps 95.5% faster (or 50% faster if you're using webpack -p)
// Webpack.config.js
const brotliPlugin = require('brotli-gzip-webpack-plugin')
// Inside your config
plugins: [
new brotliPlugin({
asset: '[file].br[query]',
algorithm: 'brotli',
test: /\.(js|css|html|svg)$/,
threshold: 10240,
@merlox
merlox / Upload.txt
Created October 23, 2019 12:19
The steps to upload your files
// Index.html
<div>
<h1>File upload</h1>
<input type="file" multiple onChange={e => uploadFile(e)}/>
</div>
// Index.js
const uploadFile = async e => {
const files = e.target.files
@merlox
merlox / Upload.txt
Created October 23, 2019 12:22
The file upload summary
// Index.html
<div>
<h1>File upload</h1>
<input type="file" multiple onChange={e => uploadFile(e)}/>
</div>
// Index.js
const uploadFile = async e => {
const files = e.target.files
@merlox
merlox / a.js
Created October 24, 2019 17:37
{
"name":"aldfasdkfmasf",
"owner":"5d9f2e642cbd71300c861254",
"emails":[
{
"number":2,
"id":"5da9d9208ca7971f0431eb23",
"name":"Nullam vehicula pretium eros. Integer imperdiet consectetur diam sed fermentu1.5561770601055591",
"subject":"Nullam vehicula pretium eros. Integer imperdiet consectetur diam sed fermentu13.685347144285123",
"content":"Nullam vehicula pretium eros. Integer imperdiet consectetur diam sed fermentu0.998378519267737",
@merlox
merlox / a.js
Created October 25, 2019 10:24
{
"El":"110919616035159615177",
"Zi":{
"token_type":"Bearer",
"access_token":"ya29.ImCpBx9Jx36WuEh-_F8Q4u5sM-CBQiCt2GUam47Uwhs30yeU2kwfxukiZeJtQapCchcw6_jSmJRLvNIzIn_o_1Hddm4p8EBZophUw3kutajiIF5qy2ST7UHbgHzh414jUbk",
"scope":"email profile openid https://www.googleapis.com/auth/gmail.send https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/gmail.compose https://www.googleapis.com/auth/gmail.readonly",
"login_hint":"AJDLj6JUa8yxXrhHdWRHIV0S13cAqzOTJvQ3WreAWLbGgXwkBbE-r-LhZo3vTqsNufV5WsYHxwTSfpSNjfW3o_OvEJ2sEjP4NA",
"expires_in":3600,
"id_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjhhNjNmZTcxZTUzMDY3NTI0Y2JiYzZhM2E1ODQ2M2IzODY0YzA3ODciLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXpwIjoiODU2NTkwMDk4NDIwLWV1MW4wN3BldjYwMnM0a3JxcGVhZzUyYjdkcGF1bjQxLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiYXVkIjoiODU2NTkwMDk4NDIwLWV1MW4wN3BldjYwMnM0a3JxcGVhZzUyYjdkcGF1bjQxLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY2
@merlox
merlox / a.js
Created November 1, 2019 14:34
Mongoose: activesequences.insertOne({ status: 'active', recipientsReplied: [], currentSequence: 1, triggers: [ 1 ], _id: ObjectId("5dbc4212c258b00f44978640"), name: 'merunas', owner: ObjectId("5d9f2e642cbd71300c861254"), emails: [ { links: [], _id: ObjectId("5dbc4212c258b00f44978642"), subject: 'dsfgsd', content: '<html><head></head><body><p>gsdfg</p></body></html>', attachments: [], templateId: '5db962025c3fe60a199c3a8a' }, { links: [], _id: ObjectId("5dbc4212c258b00f44978641"), subject: 'ppp', content: '<div><p>ppp</p>\n' + '<p><a href="https://staging.palawan.io/stats/link-click?token=19489000598093750&amp;to=https://google.com/">https://google.com</a></p>\n' + '<p><a href="https://staging.palawan.io/stats/link-click?token=41436211247327544&amp;to=https://google.com/">https://google.com</a></p></div>', attachments: [], templateId: '5db85b9c4c0d641233f74b34' } ], recipients: { to: [ '[email protected]' ], cc: [], bcc: [] }, sequenceId: '5dbc3e90c258b00f44978636', threadId: '16e276217a012a09', createdAt: ne
1. Learn to setup webpack.
2. Learn to create react files.
3. Setup package.json scripts.
4. Setup a server.js server.
5. Updating state, using effect and importing files.
To learn react:
Steps to earn money by closing expired or under-collateralized loans.
1. Clone the repository https://github.com/merlox/cdl-loans-expirer by executing this command:
`git clone https://github.com/merlox/cdl-loans-expirer`
2. Install dependencies with `yarn install` or `npm install` note that you must have node.js installed https://nodejs.org/en/
3. Then create a file inside the project folder called `.secret` and paste your mnemonic phrase inside.
This will be used to give you the rewards to your address.
pragma solidity 0.6.2;
pragma experimental ABIEncoderV2;
import 'https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol';
contract Insurance is usingProvable {
struct Policy {
uint256 id;
uint256 price;
string url;