This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>OTP Input</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> | |
<style> | |
*{ | |
margin:0px; | |
padding:0px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Detect OS | |
function DetectOS(){ | |
var Detect = { | |
init: function () { | |
this.OS = this.searchString(this.dataOS); | |
}, | |
searchString: function (data) { | |
for (var i=0;i<data.length;i++) { | |
var dataString = data[i].string; | |
var dataProp = data[i].prop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###Generating a QR Code### | |
#pip install pyqrcode | |
#`pip install pypng` for PNG import errors, or try reinstalling Pillow! | |
import pyqrcode | |
from PIL import Image | |
s = "www.geeksforgeeks.org" | |
url = pyqrcode.create(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Reverse Iterate an array using FOR and range in python3. | |
arr = [2,4,-5,0,-120,23,2] | |
# range(start, stop, step) | |
for i in range(len(a)-1,-1,-1): | |
print(arr[i], end=" ") #Prints 2 23 -120 0 -5 4 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from argparse import ArgumentParser | |
from random import shuffle | |
from typing import List, Tuple | |
def generate_pixels(width: int, height: int) -> List[Tuple[int, int]]: | |
"""Generates random pixel locations""" | |
pixels = [] | |
for x in range(width): | |
for y in range(height): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 #pip install opencv-python | |
#This program generates a cartoonized image of the given image! | |
img = cv2.imread("image.jpg") | |
def color_quantization(img, k): | |
data = np.float32(img).reshape((-1, 3)) | |
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 20, 1.0) | |
ret, label, center = cv2.kmeans(data, k, None, criteria, 10, cv2.KMEANS_RANDOM_CENTERS) | |
center = np.uint8(center) | |
result = center[label.flatten()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Get the MAC address of a local system. | |
This can be used to ID systems on your network. | |
MAC addresses can be spoofed but are not in most cases | |
and are static unless tampered with so it makes a better ID than a client's IP address. | |
*/ | |
const getmac = require('getmac'); //https://www.npmjs.com/package/getmac | |
const callMac = () =>{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from random import randint | |
uid = str(datetime.utcnow().strftime('%Y%m%d%H%M%S%f')[:-3]*randint(1,37)) | |
print(f"Here: {uid}\nUse this logically unique ID if you aren't using the traditional +=1 technique!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$whitelist = array('127.0.0.1','::1'); | |
if(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){ | |
//SERVER | |
$server = 'localhost'; | |
$username = 'server_username'; | |
$password = 'server_password'; | |
$dbname = 'username_dbname'; | |
$conn = mysqli_connect($server, $username, $password, $dbname); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHPMailer SPL autoloader. | |
* PHP Version 5 | |
* @package PHPMailer | |
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project | |
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> | |
* @author Jim Jagielski (jimjag) <jimjag@gmail.com> | |
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> | |
* @author Brent R. Matzelle (original founder) |