Skip to content

Instantly share code, notes, and snippets.

@Los-had
Los-had / programming.goggle
Last active June 29, 2022 23:50
Gist for the brave search new feature called goggles.
! name: Programming Questions
! description: Helps to find answers about programming related questions, Mainly for python and golang.
! public: true
! author: Loshad
! avatar: #bcd4e6
! license: MIT
$boost=5,site=stackoverflow.com
$boost=5,site=github.com
$boost=3,site=gist.github.com
@Los-had
Los-had / cesar_crack.php
Created June 21, 2021 10:44
Quebrando a cifra de César com php
function cesar_crack_ascii($ut) {
$txt = $ut;
$ftxt = '';
$v = str_split($txt);
$len = strlen($txt);
for ($nc = 0; $nc <= 26; $nc++) {
for ($g = 0; $g <= $len; $g++) {
$c = ord(@$v[$g]) - $nc;
$ftxt = $ftxt.chr($c);
}
@Los-had
Los-had / random.py
Created May 16, 2021 21:09
primeira gist, pegando variáveis aleatórias em python
from random import choice
valorum = "#yLR75@s56el"
valordois = "m!zR6VvFq75R"
valortres = "^JHNgr%oka4X"
valorquatro = "TF^OMZYyqx@&"
possibilidades = [valorum, valordois, valortres, valorquatro]
valoraleatorio = choice(possibilidades)
@miguelmota
miguelmota / crypto.go
Last active June 5, 2024 14:28
Golang SHA256 hash example
package crypto
import (
"crypto/sha256"
)
// NewSHA256 ...
func NewSHA256(data []byte) []byte {
hash := sha256.Sum256(data)
return hash[:]
Extensão:
rails: para cor;
ruby: para autocomplete;
rubocop: para corrigir erros;
beautify: para identaçao;
boxy: pra deixar o vscode bonito;
great icons: para deixar os icones bonitos;
slim para a identaçao do html slim
@dssstr
dssstr / vigenere.py
Last active June 20, 2024 13:19
Simple Vigenere Cipher written in Python 3.5.
def encrypt(plaintext, key):
key_length = len(key)
key_as_int = [ord(i) for i in key]
plaintext_int = [ord(i) for i in plaintext]
ciphertext = ''
for i in range(len(plaintext_int)):
value = (plaintext_int[i] + key_as_int[i % key_length]) % 26
ciphertext += chr(value + 65)
return ciphertext
@gowtham1337
gowtham1337 / temp_mail_server.md
Last active March 1, 2024 12:53
A quick guide for creating your own temporary mail server

##Overview You might have a need for a temporary mail service like mailinator.com on your own machine. This guide provides the minimum required steps to do that. The setup we will use is as follows

Procmail (Receive mail and forward to script)--->PHP Script(Parse Mail and put in Database)--->MySQL(Store the mails)--->JSON

Note: This is intended as a quick DIY for simple projects. Hence, we will not go into more details like spam detection and memory optimization.

##Instructions ####Setup Infrastructure

  1. Get a Top level domain name (Note: Getting this to work with a sub-domain will require more work and setup)