Skip to content

Instantly share code, notes, and snippets.

View Michaelgathara's full-sized avatar
👋
Hi

Michael Gathara Michaelgathara

👋
Hi
View GitHub Profile
@Michaelgathara
Michaelgathara / rainbow-border.css
Created April 20, 2020 04:55
Rainbow Border Css
@-webkit-keyframes rainbow {
0% {border-color: hsl(0, 100%, 50%);}
14% {border-color: hsl(30,100%,50%);}
28% {border-color: hsl(60,100%,50%);}
42% {border-color: hsl(120,100%,50%);}
56% {border-color: hsl(240,100%,50%);}
70% {border-color: hsl(280,100%,50%);}
84% {border-color: hsl(320,100%,50%);}
100% {border-color: hsl(255, 100%, 50%);}
}
@Michaelgathara
Michaelgathara / random.js
Last active April 20, 2020 07:06
Express.js server side random site sender
app.get('/random', function(req,res) {
var randomSite = [
"https://michaelgathara.com",
"https://wikiwand.com/",
"http://www.staggeringbeauty.com/",
"https://trypap.com/",
"http://www.omfgdogs.com/#",
"https://cat-bounce.com/",
"https://isitchristmas.com/",
"https://michaelgathara.com/yt",
@Michaelgathara
Michaelgathara / politicalBias.js
Last active June 16, 2020 07:16
Javascript Political Bias Ratings
var leftLeaning = ['cnn','nbc','msnbc','theguardian.com','npr','abc-news','cbs-news','nytimes.com','bbc.com','pbs','huffington-post','politico','economist','huffpost.com','vox.com','slate.com','usa today','the washington post','cbs news','nbc news', 'business insider', 'al jazeera english', 'al jazeera','latimes.com','cnbc','cnbc television'];
var rightLeaning = ['nypost.com','fox news', 'forbes'];
var centerLeaning = ['reuters','bloomberg','chicagotribune.com','the hill','npr.org'];
var nonPolitical = ['collider.com','tmz.com','engadget','espn.com','ninersnation.com','spaceflightnow.com','cnet.com','cbssports.com','hollywoodreporter.com','wired','hypebeast.com','gamespot.com','benzinga','yahoo finance','the motley fool','zacks','gurufocus','investorplace','bloomberg markets and finance','seeking alpha','see it market'];
@Michaelgathara
Michaelgathara / matrixBuilder.py
Created January 26, 2021 02:39
A simple python program to create a matrix
def buildMatrix(x, y):
for r in range(1,x):
for c in range(1,y):
n = r*c
print(n, end=' ')
print()
buildMatrix(5,5)
@Michaelgathara
Michaelgathara / pythonRemainder.py
Created January 26, 2021 02:43
Find remainder from user input
num1 = int(input("Enter your Dividend number: "))
num2 = int(input("Enter you Divisor number: "))
num3 = 0
def findRemainder(first, second):
return first%second
print(findRemainder(num1, num2))
@Michaelgathara
Michaelgathara / physics.html
Created June 21, 2021 03:14
Physics Page, no longer in need
<!DOCTYPE html>
<html>
<head>
<!--michaelgathara.com-->
<title>Michael G | Physics</title>
<!--Meta Stuff created April 13th 2019-->
<meta name="description" content="Michael Gathara's Ap Physics 1 review site"/>
<meta name="robots" content="noindex,nofollow,nosnippet">
<meta name="google" content="nositelinkssearchbox,notranslate" />
<meta name="theme-color" content="#000">
@Michaelgathara
Michaelgathara / bt.rkt
Created March 15, 2023 21:34
Binary Tree Racket
#lang racket
(define (create-bt line)
(match line
[`(,x0 ,x1) (if (< x0 x1) `(bt ,x0 empty (bt ,x1 covered empty)) 'empty)]
[_ 'error]
)
)
#lang racket
(define (call num1 num2)
(let ([x num1] [y num2]) x))
(define (brouhaha_main)
(call 5 42))
'((define (call num1 num2)
(let ([x num1] [y num2]) x))
@Michaelgathara
Michaelgathara / polish-notation.html
Last active January 30, 2024 04:05
Infix to Prefix notation convertor
<!DOCTYPE html>
<!-- THIS IS CODE DONE IN 20 MINUTES, NOT THE BEST LOOKING CODE OUT THERE -->
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Infix to Prefix Notation Converter</title>
<style>
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");
body,
def power_set(original_set):
if not original_set:
return [set()]
element = original_set.pop()
subsets_without_element = power_set(original_set)
subsets_with_element = []
for subset in subsets_without_element:
new_subset = subset.copy()
new_subset.add(element)
subsets_with_element.append(new_subset)