Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
// #include <ESP32Servo.h>
// Servo myservo; // create servo object to control a servo
// // 16 servo objects can be created on the ESP32
// int pos = 0; // variable to store the servo position
// // Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33
// // Possible PWM GPIO pins on the ESP32-S2: 0(used by on-board button),1-17,18(used by on-board LED),19-21,26,33-42
// // Possible PWM GPIO pins on the ESP32-S3: 0(used by on-board button),1-21,35-45,47,48(used by on-board LED)
// // Possible PWM GPIO pins on the ESP32-C3: 0(used by on-board button),1-7,8(used by on-board LED),9-10,18-21
@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
{