Skip to content

Instantly share code, notes, and snippets.

@HackerGaucho
HackerGaucho / install-docker.sh
Created June 20, 2022 23:45 — forked from roberson-miguel/install-docker.sh
Script para instalar Docker e Dependências, que já teste com imagem do Hello World.
#!/bin/bash
remove=$(sudo apt-get remove docker docker-engine docker.io containerd runc > /dev/null)
atualiza=$(sudo apt-get update > /dev/null)
certificado=$(sudo apt-get install \
ca-certificates \
curl \
gnupg \
@HackerGaucho
HackerGaucho / arbitrary_base_conversion.php
Created December 2, 2021 23:12
Conversão de base arbitrária em PHP
<?php
//https://www.php.net/manual/en/function.base-convert.php#106546
print convBase('10','0123456789','0123456789ABCDEF');//result: A
function convBase($numberInput, $fromBaseInput, $toBaseInput)
{
if ($fromBaseInput==$toBaseInput) return $numberInput;
$fromBase = str_split($fromBaseInput,1);
$toBase = str_split($toBaseInput,1);
$number = str_split($numberInput,1);
@HackerGaucho
HackerGaucho / pdo_db.php
Created September 17, 2021 17:34 — forked from bradtraversy/pdo_db.php
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;
@HackerGaucho
HackerGaucho / mysql_cheat_sheet.md
Created September 17, 2021 17:28 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@HackerGaucho
HackerGaucho / browser.py
Created September 2, 2021 16:14
Browser com uma janela só feito em Python
import sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import * # pip3 install --upgrade PyQtWebEngine
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.browser = QWebEngineView()
self.browser.setUrl(QUrl('http://hackergaucho.com'))
@HackerGaucho
HackerGaucho / parser.php
Created June 23, 2021 18:56
Parser para o Dicionário de Palavras Simples Flexionadas para o Português Brasileiro
<?php
//eu: eu,eu.PRO+Pes:N1ms:N1fs
$str="Olá,Olá.INTERJ";
$parser=function ($str) {
$str=trim($str);
//Palavra,canônica.Classe+traços:flexão
$classeETracos=[
'ABREV'=>'abreviatura',
'ADV'=>'advérbio',
'CONJ'=>'conjunção',