Skip to content

Instantly share code, notes, and snippets.

View jjeanjacques10's full-sized avatar
🚀
Learning

Jean Jacques Nascimento Barros jjeanjacques10

🚀
Learning
View GitHub Profile
@jjeanjacques10
jjeanjacques10 / eleicoes2022.py
Last active October 30, 2022 21:59
Script para gerar notificações dos resultados da eleição
# Author: Jean Jacques Barros
# Github: https://github.com/jjeanjacques10
from time import sleep
import requests
from win10toast import ToastNotifier
LAST_READ = ""
@jjeanjacques10
jjeanjacques10 / application.properties
Created July 8, 2022 00:49
Spring Data JPA application.properties config
# Database URL
spring.datasource.url=jdbc:mysql://localhost:3306/shinobiDatabase
# Database User and Password
spring.datasource.username=root
spring.datasource.password=hokage
# Driver -> MySQL
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
# Show SQL in terminal
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
@jjeanjacques10
jjeanjacques10 / index.html
Last active May 5, 2022 00:37
Preview file s3 without download it
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
@jjeanjacques10
jjeanjacques10 / extract-mangas.py
Created January 25, 2022 21:40
Extract mangas from muitomanga.com using python code.
import requests
import os
from bs4 import BeautifulSoup
def get_manga_chapter(manga_name, num_chapters):
'''
Get the chapter images of manga {manga_name} from the website muitomanga.com
'''
for chapter in range(1, num_chapters):
@jjeanjacques10
jjeanjacques10 / config.sh
Created November 2, 2021 17:17
NodeJS Server Config Script
echo " | SERVER CONFIG SCRIPT |"
echo "Install GIT"
sudo apt-get install git
sudo apt-get install build-essential
sudo apt-get install curl openssl libssl-dev
echo "======= Install NVM ======="
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
echo "======= Install NodeJS version 14.16.0 ======="
@jjeanjacques10
jjeanjacques10 / RefreshTokenHubspot.js
Created October 26, 2021 16:39
RefreshTokenHubspot.js
import axios from 'axios';
import NodeCache from 'node-cache';
import querystring from 'qs';
const accessTokenCache = new NodeCache({ deleteOnExpire: true });
class AuthService {
constructor() {
this.CLIENT_ID = process.env.CLIENT_ID
@jjeanjacques10
jjeanjacques10 / HubSpot Python.py
Last active July 16, 2021 16:13
HubSpot Python
import requests
HUBSPOT_API_KEY = '<HUBSPOT_API_KEY>'
def post_contact(data):
url = 'https://api.hubapi.com/crm/v3/objects/contacts?hapikey=' + HUBSPOT_API_KEY
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, json=data, headers=headers)
async function getNews() {
const doc = new GoogleSpreadsheet('<YOUR-SPREADSHEET-ID>')
await doc.useServiceAccountAuth(creds);
await doc.loadInfo();
const sheet = doc.sheetsByIndex[0];
const rows = await sheet.getRows();
// Get last news
return cleanText(rows[(rows.length - 1)].Message);
}
@jjeanjacques10
jjeanjacques10 / main.py
Last active October 19, 2019 02:06
Arquivo principal do projeto
from flask import Flask, request
app = Flask(__name__)
@app.route("/<nome>")
def hello(nome):
text = "<h1>Microsoft Student Partners</h1>"
text += "<h3>Hello, {}!</h3> <br>".format(nome)
text += "<img src='https://secure.meetupstatic.com/photos/event/b/b/2/a/global_481787914.jpeg'><br><br>"
text += "<i>by Jean J. Barros</i>"
@jjeanjacques10
jjeanjacques10 / requirements.txt
Last active October 19, 2019 02:06
Arquivo de configurações
click==6.7
Flask==1.0.2
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
Werkzeug==0.14.1