Skip to content

Instantly share code, notes, and snippets.

View bergpb's full-sized avatar
🏠
Working from home

Lindemberg Barbosa bergpb

🏠
Working from home
View GitHub Profile
@bergpb
bergpb / transformacao.c
Created August 14, 2019 22:12
Transformação Geométrica
#include <stdio.h>
#include <math.h>
int main() {
//entre com o valor de teta
//e retorne uma matriz no formato a seguir:
// cos 0 sen 0
//-sen 0 cos 0
@bergpb
bergpb / remove_pycache.py
Created August 16, 2019 17:28
Remove __pycache__ folders
echo "Removing __pycache__ folders"
find . -name __pycache__ -type d -exec rm -rf {} \;
find ./app/* -name __pycache__ -type d -exec rm -rf {} \;
echo "Ok!"
@bergpb
bergpb / aula_05_exer04.py
Created August 17, 2019 17:20
Exercício da Disciplina de Técnicas de Programação - Aula 05
from datetime import datetime as dt
class Pessoa:
def __init__(self, nome, cpf, data_nascimento):
self.nome = nome
self.cpf = cpf
self.data_nascimento = data_nascimento
class Funcionario(Pessoa):
@bergpb
bergpb / app.py
Created August 18, 2019 12:50
Get id with javascript in flask web app
from flask import Flask, render_template_string
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home():
data = [
{'id': 1, 'name': 'Nicola', 'age': 17},
{'id': 2, 'name': 'Josh', 'age': 17},
@bergpb
bergpb / Jenkinsfile
Last active August 27, 2019 01:33
Simple Jenkins declarative example
pipeline {
agent any
stages {
stage('build') {
steps {
echo 'Running build ...'
}
}
stage('test') {
steps {
import re
class Pessoa():
@staticmethod
def validaCpf(cpf):
if (len(cpf) == 11) and (re.match('[0-9]+', cpf)):
return True
else:
return False
@bergpb
bergpb / Vagrantfile
Created September 5, 2019 18:41
Vagrantfile <- Zabbix 4.0 + Ubuntu Trusty64
# -*- mode: ruby -*-
# vi: set ft=ruby :
# based on https://gist.github.com/ad-m/189273d73388e094293a35267d7301c3
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
@bergpb
bergpb / Vagrantfile
Last active September 8, 2019 16:43
Vagrant - Zabbix + Grafana
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Install Zabbix and Grafana
# based on https://gist.github.com/ad-m/189273d73388e094293a35267d7301c3
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
@bergpb
bergpb / icons.txt
Created November 14, 2019 19:16
List with all Font Awesome 5 Icons
["500px", "accessible-icon", "accusoft", "acquisitions-incorporated", "ad", "address-book", "address-card", "adjust", "adn", "adobe", "adversal", "affiliatetheme", "air-freshener", "airbnb", "algolia", "align-center", "align-justify", "align-left", "align-right", "alipay", "allergies", "amazon", "amazon-pay", "ambulance", "american-sign-language-interpreting", "amilia", "anchor", "android", "angellist", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "angry", "angrycreative", "angular", "ankh", "app-store", "app-store-ios", "apper", "apple", "apple-alt", "apple-pay", "archive", "archway", "arrow-alt-circle-down", "arrow-alt-circle-left", "arrow-alt-circle-right", "arrow-alt-circle-up", "arrow-circle-down", "arrow-circle-left", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "arrows-alt", "arrows-alt-h", "arrows-alt-v", "artstation", "assistive-listening-systems", "asterisk"
@bergpb
bergpb / __init__.py
Created November 16, 2019 21:29
__init__.py - LisaPi
import os
import config
from flask import Flask
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from flask_socketio import SocketIO, emit
db = SQLAlchemy()
migrate = Migrate()