Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
@BlackAmda
BlackAmda / example_baileys.js
Created January 23, 2023 06:28
This is a JavaScript example source code of baileys repo example.ts code(https://github.com/adiwajshing/Baileys/blob/master/Example/example.ts).
const { Boom } = require('@hapi/boom')
const { default: makeWASocket, delay, DisconnectReason, fetchLatestBaileysVersion, isJidBroadcast, makeCacheableSignalKeyStore, makeInMemoryStore, useMultiFileAuthState } = require('@adiwajshing/baileys')
const P = require("pino");
let MAIN_LOGGER = P({ timestamp: () => `,"time":"${new Date().toJSON()}"` });
const logger = MAIN_LOGGER.child({});
logger.level = 'trace'
const useStore = !process.argv.includes('--no-store')
const doReplies = !process.argv.includes('--no-reply')
@IgorDePaula
IgorDePaula / post-receive.sh
Last active November 18, 2022 21:10
git deploy
#!/bin/bash
TARGET="/var/www/html"
GIT_DIR="/home/ubuntu/crm.git"
BRANCH="master"
TARGET_HOMOLOGACAO="/home/ubuntu/homologacao"
# GIT_DIR="/home/ubuntu/crm"
BRANCH_HOMOLOGACAO="homologacao"
while read oldrev newrev ref
do
@IgorDePaula
IgorDePaula / DockerFileEchoServer
Last active April 4, 2023 01:20
Laravel com redis e laravel-echo-server
# .docker/echo/Dockerfile
FROM node:erbium-alpine3.10
RUN npm install -g laravel-echo-server
RUN mkdir -p /var/www
WORKDIR /var/www
EXPOSE 6001
RUN ls /var/www
ENTRYPOINT laravel-echo-server start
#!/usr/bin/make
include .env
export
.PHONY: help
.DEFAULT_GOAL := help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
<template>
<q-page class="flex flex-center">
<component :key="index" v-for="(comps, index) in comp"
v-model="schema[comps.name]" :is="comps.is"
v-bind="comps"/>
</q-page>
</template>
<style>
</style>
@IgorDePaula
IgorDePaula / index.js
Created August 1, 2019 14:29
reducer count names js
var names = ['Alice', 'Bob', 'Tiff', 'Bruce', 'Alice'];
var countedNames = names.reduce(function (allNames, name) {
if (name in allNames) {
allNames[name]++;
}
else {
allNames[name] = 1;
}
return allNames;
@IgorDePaula
IgorDePaula / http.js
Created August 1, 2019 12:31
http vue
import axios from 'axios'
export const http = axios.create({ baseURL: 'https://some-domain.com/api/'})
const interceptors = (http) => {
http.interceptors.request.use((config) => {
// loading start
}, (error) => {
loadingInstance.close()
<?php
/**
* Created by PhpStorm.
* User: igor
* Date: 01/05/17
* Time: 11:19
*/
//echo htmlentities('<a href="http://google.com">google<a>');
<?php
namespace Tandle\Http\Middleware;
use Closure;
use JWTAuth;
class RefreshTokenMiddleware
{
import config from './config'
import axios from 'axios'
import router from './router'
// import * as types from './app/auth/vuex/mutation-types'
import { Loading } from 'element-ui'
export const http = axios.create(config)
let loadingInstance = null
const interceptors = (http, store, route, config) => {
http.interceptors.request.use((config) => {
loadingInstance = Loading.service({ fullscreen: true, text: 'Carregando...' })