Skip to content

Instantly share code, notes, and snippets.

View CodeByAidan's full-sized avatar
💻
new semester 🔥🔥🔥

aidan CodeByAidan

💻
new semester 🔥🔥🔥
View GitHub Profile
var text = $('.nonHideableWords').textContent.split(' '),
input = $('input');
function triggerKeyboardEvent(el, keyCode)
{
var eventObj = document.createEventObject ?
document.createEventObject() : document.createEvent("Events");
if(eventObj.initEvent){
eventObj.initEvent("keydown", true, true);
@CodeByAidan
CodeByAidan / prime.py
Created September 15, 2022 16:17
checks whether a number is prime or not
# Check whether the number is prime or not
number = int(input('Enter a number : '))
counter = 0
for i in range (1, number + 1):
if(number % i == 0):
counter += 1;
if(counter == 2):
print(f"{number} is a Prime number")
else:
@CodeByAidan
CodeByAidan / vigenere.py
Created September 15, 2022 16:19
Vigenère cipher encryption
import string
a = string.ascii_lowercase
p = "mei"
k = "biru"
if len(k) > len(p): k = k[:len(p)]
if len(k) < len(p):
i = 0
while len(k) != len(p):
k += k[i % len(k)]
i += 1
import os
import threading
try:
import EXAMPLE v1
except:
os.system("pip install EXAMPLE v1")
import EXAMPLE v1
try:
var getElementsByClassName = function(e, s, t) {
return (getElementsByClassName = document.getElementsByClassName ? function(e, s, t) {
for (var a, n = (t = t || document)
.getElementsByClassName(e), c = s ? new RegExp("\\b" + s + "\\b", "i") : null, r = [], l = 0, i = n.length; l < i; l += 1) a = n[l], c && !c.test(a.nodeName) || r.push(a);
return r
} : document.evaluate ? function(e, s, t) {
s = s || "*", t = t || document;
for (var a, n, c = e.split(" "), r = "", l = "http://www.w3.org/1999/xhtml", i = document.documentElement.namespaceURI === l ? l : null, o = [], u = 0, h = c.length; u < h; u += 1) r += "[contains(concat(' ', @class, ' '), ' " + c[u] + " ')]";
try {
a = document.evaluate(".//" + s + r, t, i, 0, null)
positions = [
(20, 18),
(19, 18),
(20, 17),
(19, 17),
(20, 16),
(19, 16),
(20, 15),
(19, 15),
(20, 14),
@CodeByAidan
CodeByAidan / SearchAssignments.js
Created October 18, 2022 18:33
Search through assignments in Google Classroom and return as an alert in JavaScript.
function checkForActiveAssignment() {
var activeClass = document.evaluate(
"//div[@class='hrUpcomingAssignmentGroup']//..//..//..//div//div//div",
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;
// i.e.
// activeClass = (class name, i.e. "AP Physics 1")
@CodeByAidan
CodeByAidan / clock.js
Created October 31, 2022 03:01
Simple bookmarklet that turns entire page to current time & updates constantly. It uses 12-hour formatting!
javascript:var t=setInterval(function(){var d=new Date();var h=d.getHours();var m=d.getMinutes();var s=d.getSeconds();var ampm=h>=12?'pm':'am';h=h%12;h=h?h:12;m=m<10?'0'+m:m;s=s<10?'0'+s:s;var strTime=h+':'+m+':'+s+' '+ampm;document.body.innerHTML=strTime;},1000);
@CodeByAidan
CodeByAidan / PowerFunction.py
Created October 31, 2022 13:00
Power Function Calculator - super simple
try:
# Take the base value from the user
x = int(input("Enter the base value: "))
# Take the power value from the user
n = int(input("Enter the power value: "))
# Print the result
print("%d to the power %d = %f" % (x, n, pow(x, n)))
# Print the remainder value
print("The remainder value = ", pow(x, n, 5))
except:
@CodeByAidan
CodeByAidan / math.tex
Last active November 18, 2022 22:43
i hate you
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{xcolor}
\usepackage{xcolor}
\definecolor{blue}{RGB}{54,151,220}
\definecolor{lime}{RGB}{45,204,113}
\definecolor{orange}{RGB}{231,128,33}