Skip to content

Instantly share code, notes, and snippets.

View Eihen's full-sized avatar

Emerson Belancieri Eihen

  • Brazil
View GitHub Profile
@Eihen
Eihen / CheckFK.sql
Last active July 27, 2018 11:51
Force InnoDB to recheck foreign keys
-- https://stackoverflow.com/questions/2250775/force-innodb-to-recheck-foreign-keys-on-a-table-tables
DELIMITER $$
DROP PROCEDURE IF EXISTS ANALYZE_INVALID_FOREIGN_KEYS$$
CREATE
PROCEDURE `ANALYZE_INVALID_FOREIGN_KEYS`(
checked_database_name VARCHAR(64),
checked_table_name VARCHAR(64),
temporary_result_table ENUM('Y', 'N'))
@Eihen
Eihen / post-receive
Last active February 8, 2018 15:01
Git post-receive hook to deploy changes to a server using "git push" and execute needed commands when successful
#!/bin/bash
# REQUIREMENTS:
# 1) SSH Access to the remote server
# 2) Reading the whole script and understanding what it does before using it
# If you can't understand something, let me know and I'll be happy to help
# 3) Understanding that this script is provided as-is and I have no responsibility for whatever damage occurs
# That said, if the script was strictly tested and no problems should arise if you use it without any modifications
# of areas which not states that can be modified
# Also if you find any problems let me know to see if I can help you (and/or fix the script)
@Eihen
Eihen / .bashrc
Last active August 17, 2018 23:10
Git Bash for Windows script for SSH Agent and Keys management
# REQUIREMENTS
# 1) Understanding that this script is provided as-is and I have no responsibility for whatever damage occurs
# That said, if the script was strictly tested and no problems should arise if you use it without any modifications
# of areas which not states that can be modified
# Also if you find any problems let me know to see if I can help you (and/or fix the script)
# Put this at the end of your ~/.bashrc if you already have one or just throw it in your home directory if you don't
# Make sure there are no other scripts starting ssh-agents or adding keys
# This assumes you have https://github.com/magicmonty/bash-git-prompt in your home directory
@Eihen
Eihen / manipulação.sql
Last active November 25, 2017 13:36
Ex BD2 - Banco de Dados Objeto-Relacional
INSERT INTO alunos VALUES (
ALUNO_TY (
'55522214800',
'1234567890',
'Manuel',
'Avenida Qualquer',
'emaiu@serv.dot',
'123456789',
'Tramandai',
'RS',
@Eihen
Eihen / Database.cs
Last active October 5, 2022 03:10
C# - Generic DB Management Class + Specialized class for PostgreSQL
using System.Collections.Generic;
using System.Data;
// Abstract class, can't be used directly, needs to be inherited in another class implementing the abstract methods
/// <summary>
/// Generic class for DataBase management implementing methods that doesn't depend on the DataBase used
/// </summary>
public abstract class Database
{