Skip to content

Instantly share code, notes, and snippets.

View angeloped's full-sized avatar

Angeloped angeloped

  • Philippines
View GitHub Profile
@angeloped
angeloped / ASCII.json
Last active November 20, 2024 00:25
ASCII Table in JSON Format.
{
"_heading":[["OCT", "HEX", "BIN", "Symbol", "Description"]],
"ASCII":[
["000", "00", "00000000", "NUL", "Null char"],
["001", "01", "00000001", "SOH", "Start of Heading"],
["002", "02", "00000010", "STX", "Start of Text"],
["003", "03", "00000011", "ETX", "End of Text"],
["004", "04", "00000100", "EOT", "End of Transmission"],
["005", "05", "00000101", "ENQ", "Enquiry"],
["006", "06", "00000110", "ACK", "Acknowledgment"],
@angeloped
angeloped / Public and Private Key PGP Validator
Last active December 6, 2024 20:00
Public and Private Key PGP Validator | RegEx
/^(-----BEGIN PGP PUBLIC KEY BLOCK-----).*([a-zA-Z0-9//\n\/\.\:\+\ \=]+).*(-----END PGP PUBLIC KEY BLOCK-----)$|^(-----BEGIN PGP PRIVATE KEY BLOCK-----).*([a-zA-Z0-9//\n\/\.\:\+\ \=]+).*(-----END PGP PRIVATE KEY BLOCK-----)$/
@angeloped
angeloped / generate-ssh-key.sh
Created February 12, 2020 05:14 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@angeloped
angeloped / spongebobify.py
Last active January 2, 2020 15:22
ThIsS iS jUsT aNotHeR sPoNgeBoB fOrMatTeR. View revisions for other version.
import random
def sPongEbOb_iT(data):
return "".join([random.choice([s, s.upper()]) for s in data])
@angeloped
angeloped / puzzle.py
Last active December 29, 2019 21:20
Standard Problem Solver For Proof-of-Work System.
import os
from hashlib import sha512
def authBlock():
pass
# auth hash before inserting into blockchain
def authHashPOW(ref):
with open("HashPOWs","a+") as f:
for line in f:
@angeloped
angeloped / autocrop_center_square.php
Created December 16, 2019 06:24
Crop image from center and output a square cropped image; written in PHP language.
<?php
function cropAlign($image, $cropWidth, $cropHeight, $horizontalAlign = 'center', $verticalAlign = 'middle') {
$width = imagesx($image);
$height = imagesy($image);
$horizontalAlignPixels = calculatePixelsForAlign($width, $cropWidth, $horizontalAlign);
$verticalAlignPixels = calculatePixelsForAlign($height, $cropHeight, $verticalAlign);
return imageCrop($image, [
'x' => $horizontalAlignPixels[0],
'y' => $verticalAlignPixels[0],
'width' => $horizontalAlignPixels[1],
@angeloped
angeloped / geoip.py
Created November 22, 2019 10:55
IP Tracking System with ip-api. Compatible in Python 2.x and 3.x. Try it!
import json
import requests
import webbrowser
def _input(form):
try:
return raw_input(form)
except:
return input(form)
@angeloped
angeloped / bcpirates.js
Created November 19, 2019 17:21
The bandcamp pirates. ;P
/*
* title: The bandcamp pirates.
* coded by: Bryan Angelo Pedrosa
* date: 19 November 2019
*/
/* to download album (free version) */
window.location=TralbumData["freeDownloadPage"]
@angeloped
angeloped / AnSyn_salary_microeconomics.py
Created October 31, 2019 09:21
Anarcho-Syndicalism/Anarcho-Collectivist salary distribution system. 100% legit no scam. Accurate calaculation.
#!/usr/bin/python
from __future__ import division
"""
name: AnSyn_salary_microeconomics.py
description: Anarcho-Syndicalism/Anarcho-Collectivist salary distribution system. 100% legit no scam. Accurate calaculation.
author: Bryan Angelo Pedrosa
min_salary - the standard minimum pay. no matter what happen.
peak_salary - highest pay if average income per worker reached peak.
@angeloped
angeloped / lotto.py
Last active October 27, 2019 12:56
lotto lucky number guesser... (for PCSO Lotto only)
#!/usr/bin/python
import time
from random import random
from bisect import bisect
def probdist_choice(choices):
values, weights = zip(*choices)
total = 0
cum_weights = []