Skip to content

Instantly share code, notes, and snippets.

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

Edson Bonfim edsonbonfim

🏠
Working from home
View GitHub Profile
@edsonbonfim
edsonbonfim / create-pfx
Created May 12, 2022 20:46 — forked from jamielaundon/create-pfx
Create IIS .pfx from Let's Encrypt fullchain and privkey
sudo openssl pkcs12 -export -in /etc/letsencrypt/live/domain.com/fullchain.pem -inkey /etc/letsencrypt/live/domain.com/privkey.pem -out domain.com.pfx
private static ISessionFactory CreateSessionFactory()
{
var rawConfig = new NHibernate.Cfg.Configuration();
rawConfig.SetNamingStrategy(new PostgreSqlNamingStrategy());
return Fluently.Configure(rawConfig)
.Database(PostgreSQLConfiguration.Standard
.ConnectionString("<connection string>")
.Dialect<PostgreSQL82Dialect>().ShowSql())
.Mappings(m =>
public class PostgresNamingStrategy : INamingStrategy
{
public string ClassToTableName(string className)
{
return DoubleQuote(className);
}
public string PropertyToColumnName(string propertyName)
{
return DoubleQuote(propertyName);
class Employee {
final int id;
final String name;
final String cpf;
double _payment;
bool _profile = false; // if the employee is a boss
Employee(this.id, this.name, this.cpf);
@edsonbonfim
edsonbonfim / main.dart
Last active March 21, 2020 15:18
Bible Scrapping
import 'dart:io';
import "package:http/http.dart" as http;
import "package:html/parser.dart" show parse;
import 'package:meta/meta.dart';
const url = "https://www.bibliaonline.com.br";
void main() async {
var translations = await getTranslations();
import 'package:flutter/material.dart';
void main() async {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: ListView(
padding: EdgeInsets.only(top: 20.0),
children: <Widget>[
@edsonbonfim
edsonbonfim / install_mysql.txt
Last active February 2, 2020 19:57
Install mysql debian linux
sudo apt install mysql_server
sudo apt install mysql_client
sudo mysql -u root
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@edsonbonfim
edsonbonfim / mochila.c
Last active November 25, 2018 21:13
Algoritmo Problema da Mochila em C (Ingênuo)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
{
int peso;
int custo;
} Objeto;
@edsonbonfim
edsonbonfim / allegro5.sh
Created May 17, 2018 18:08
Install Allegro 5.4.2 with video addon debian/ubuntu
cd ~
apt update
apt install build-essential subversion cmake xorg-dev libgl1-mesa-dev libglu-dev libpng-dev libz-dev libcurl4-gnutls-dev libfreetype6-dev libjpeg-dev libvorbis-dev libopenal-dev libphysfs-dev libgtk2.0-dev libasound-dev libflac-dev libdumb1-dev
wget https://github.com/liballeg/allegro5/releases/download/5.2.4.0/allegro-5.2.4.0.tar.gz
tar -xvzf allegro-5.2.4.0.tar.gz
cd allegro-5.2.4.0
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
#include <stdio.h>
#include <stdlib.h>
typedef struct arvore {
int info;
struct arvore *esq;
struct arvore *dir;
} Arvore;
Arvore *criar(Arvore *arvore, FILE *arq)