Skip to content

Instantly share code, notes, and snippets.

View Adobe-Android's full-sized avatar

David Brown Adobe-Android

View GitHub Profile
#!/bin/env python3
def main():
purchase_price = 100
current_price = 200
percentage_change = round(((current_price - purchase_price) / purchase_price) * 100, 2)
print(f"At ${current_price}, that is a change of {percentage_change}% from ${purchase_price}")
if __name__ == "__main__":
#!/bin/env python3
def main():
y = 13
x = 52
percentage = round((y / x) * 100)
print(f"{y} is {percentage}% of {x}")
if __name__ == "__main__":
@Adobe-Android
Adobe-Android / percent_diff.py
Last active April 16, 2024 21:09
Find the percentage difference between two numbers
#!/bin/env python3
def main():
num1 = 80
num2 = 100
absolute = abs(num1 - num2)
average = (num1 + num2) / 2
answer = round((absolute / average) * 100)
@Adobe-Android
Adobe-Android / midpoint.py
Last active April 3, 2024 15:47
An easy way to find the midpoint between two numbers
#!/bin/env python3
def main():
num1 = 29.89
num2 = 29.86
midpoint = (num1 + num2) / 2
print(midpoint)
if __name__ == "__main__":
main()
@Adobe-Android
Adobe-Android / divisible.py
Created October 9, 2023 16:07
Divisibility Test
#!/bin/env python3
def main():
dividend = 1500
divisor = 52
limit = 6500
increment_num = 100
while dividend <= limit:
# print(dividend)
@Adobe-Android
Adobe-Android / obs_twitch_chat.css
Last active March 16, 2023 09:47 — forked from Bluscream/obs_twitch_chat.css
Twitch chat transparent popout for OBS
/*
Twitch chat browsersource CSS for OBS
Just set the URL as https://www.twitch.tv/%%TWITCHCHANNEL%%/chat?popout=true
And paste this entire file into the CSS box
Original by twitch.tv/starvingpoet modified by github.com/Bluscream and later github.com/Adobe-Android
General Settings
*/
body {
color: #FFFFFF!important;
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var getterPropInstance = new GetterAutoProp();
Console.WriteLine(getterPropInstance.RandomInt);
@Adobe-Android
Adobe-Android / fish_check_interactive_shell.sh
Last active April 23, 2021 21:19
A fish shell script to check if running in an interactive shell
#!/bin/fish
if status --is-interactive
echo an interactive shell
else
echo not an interactive shell
end
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
~!@#$%^&*()[]{}<>_+-=,.:;?/\|'"
0123456789
@Adobe-Android
Adobe-Android / top_bash_commands.sh
Last active April 23, 2021 19:44
A simple way to check your most frequently used Linux commands
#!/bin/bash
# Reads from specified shell history file.
HISTFILE=~/.bash_history
# Enable history. Disabled by default in a non-interactive shell (e.g. scripts like this).
# Uses awk to get just the command name from shell history, sorts list by command name, filters out non-unique data, sorts by frequency, grabs top 5.
set -o history
history | awk '{print $2}' | sort | uniq -c | sort -nr | head -5