Skip to content

Instantly share code, notes, and snippets.

Avatar
🦝

Dani ellygaytor

🦝
View GitHub Profile
@ellygaytor
ellygaytor / hex_to_decimal.rs
Created Apr 11, 2022
Simple rust library to convert a string containing hexadecimal data to base 10 numbers. Not on crates.io.
View hex_to_decimal.rs
/// Convert a single hex character to its integer value. `Err` if the character is not a hex character.
fn convert_digit(digit: &str) -> Option<u8>{
match digit {
"0" => Some(0),
"1" => Some(1),
"2" => Some(2),
"3" => Some(3),
"4" => Some(4),
"5" => Some(5),
"6" => Some(6),
@ellygaytor
ellygaytor / multi_input.py
Last active Dec 2, 2021
Allow multi-line input
View multi_input.py
def multi_input(prompt = None):
lines = []
while True:
line = input(prompt)
if line:
lines.append(line)
else:
break
output = '\n'.join(lines)
return output
@ellygaytor
ellygaytor / prime_factorization_web.jl
Created Nov 1, 2021
Use Genie to show the prime factors of a number
View prime_factorization_web.jl
using Genie, Genie.Router
using Genie.Renderer, Genie.Renderer.Html, Genie.Renderer.Json
function primefactors(x)
factors = []
i=2
while x != i
if x%i==0
push!(factors, i)
@ellygaytor
ellygaytor / cloudflareipwhitelister.md
Created Mar 26, 2021
Whitelist all Cloudflare IPs with IPtables
View cloudflareipwhitelister.md

Cloudflare IP Whitelister

Whitelist all Cloudflare IPs with IPtables

IPv4

iptables -I INPUT -p tcp -m multiport --dports http,https -s 173.245.48.0/20 -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dports http,https -s 103.21.244.0/22 -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dports http,https -s 103.22.200.0/22 -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dports http,https -s 103.31.4.0/22 -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dports http,https -s 141.101.64.0/18 -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dports http,https -s 108.162.192.0/18 -j ACCEPT
@ellygaytor
ellygaytor / readme.md
Last active Mar 14, 2021
Send you a Pushover notification when TurboVax adds an availability
View readme.md

Vaxx Notify

This program will send you a Pushover notification when TurboVax adds an availability

Requires: firefox-gecko from apt, and pushover, selenium, and bs4 from pip.

You will need to fill in your own pushover api details.

View howtosolder.md

How To Solder:

When soldering, NEVER apply solder directly to the soldering iron (except when “tinning” the tip of the iron). Solder is not applied directly from the iron to the electronics. In fact, touching the actual solder site with the soldering iron is often the worst thing you can do. This is because, irritatingly, the solder is very often more attracted to the soldering iron than the spot where you actually want the solder to go. The iron seems to have an almost magnetic attraction for the molten solder, and when this happens, touching the iron directly to the soldering point will result in nothing more than a rounded blob of solder collected on the tip of the iron, with no solder actually on the joint. Attempting to add more solder will only increase the size of the blob on the iron, until gravity finally takes over when the blob becomes so huge that its surface tension cannot keep it on the tip of the iron any longer. When this happens and the blob falls onto the solder joint, it is usually so hug

@ellygaytor
ellygaytor / rickroll.html
Last active Aug 6, 2020
Toggleable rick roll
View rickroll.html
<div id="rrl">
</div>
//On is one
//off is zero
<script>
const rrl=0;
if (rrl) {
document.getElementById("rrl").innerHTML += '<iframe width="0" height="0" src="https://www.youtube-nocookie.com/embed/oHg5SJYRHA0?autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
}
</script>
@ellygaytor
ellygaytor / index.php
Created Jun 3, 2020
Dynamic item/directory listing in PHP
View index.php
<?
$dirs = array_filter(glob('*'), 'is_dir');
echo "<ul>";
foreach ($dirs as $dir) {
$dataurl = dirname(__FILE__).'/'.$dir."/itemdata.json";
$url = $dataurl; // path to your JSON file
$data = file_get_contents($url);
$itemdata = json_decode($data);
if ($galdata->enabled == true) {
echo '<li><a href="'.$dir.'">'.$itemdata->item.'</a>';
View gtavantiafk.ahk
f7:: ;toggle anti afk Macro
SetTimer Click, 100
F8::Toggle := !Toggle
Click:
If (!Toggle)
Return
send, {w down}
sleep, 850