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
@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
@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 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 / 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 / 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 / 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,
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,
import React from 'react'
import ReactDOM from 'react-dom'
import { MetamaskProvider } from '@0xcert/ethereum-metamask-provider'
import { schema88 } from '@0xcert/conventions'
import { Cert } from '@0xcert/cert'
// Assets Ledgers are groups of tokens that are managed by certain users just like mods in a chat to do what's required
// The Capabilities determine what those mods can do with the assets they are managing
// The Ethereum address that deploys this ledger has full powers to do whatever he wants as the administrator
import { AssetLedger, AssetLedgerCapability } from '@0xcert/ethereum-asset-ledger'
import './index.css'
import React from 'react'
import ReactDOM from 'react-dom'
import { MetamaskProvider } from '@0xcert/ethereum-metamask-provider'
import { schema88 } from '@0xcert/conventions'
import { Cert } from '@0xcert/cert'
// Assets Ledgers are groups of tokens that are managed by certain users just like mods in a chat to do what's required
// The Capabilities determine what those mods can do with the assets they are managing
// The Ethereum address that deploys this ledger has full powers to do whatever he wants as the administrator
import { AssetLedger, AssetLedgerCapability } from '@0xcert/ethereum-asset-ledger'
import './index.css'
// To create a new asset ledger containing several assets and managed by several individuals
// The asset ledger is mandatory to create new assets since they need a place to be stored, they can't exist without a ledger
async deployNewLedger() {
let deployedLedger = {}
// The required keys are name, symbol, uriBase and schemaId
const recipe = {
name: 'Art Piece',
symbol: 'ART',
uriBase: 'www.example.com/tokenMetadata/', // This is a demonstration, you have to setup a server for generating tokens to this URI