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
window.globalConfig = { | |
siteName: "http://basdasdlahblah.com" | |
} |
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
# Selenium Imports | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.support.ui import WebDriverWait | |
from webdriver_manager.chrome import ChromeDriverManager | |
from selenium.webdriver.support import expected_conditions as EC | |
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
list_to_be_sorted = [{'salary': 1000, 'n':'a'},{'salary': 1000, 'n':'b'},{'salary': 100, 'n':'b'}] | |
newlist = sorted( list_to_be_sorted, key=lambda k: (k['salary'], k['n']) ) | |
print(newlist) |
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
data= [ | |
{'_id': '1001', 'data': [{'_id':1, 'variation': 1, 'quantity': 25}]}, | |
{'_id': '1000', 'data': [{'_id': 3, 'variation': 1, 'quantity': 0}]} | |
] | |
data = {x['_id']:x['data'] for x in data} | |
print(data) |
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 | |
import numpy as np | |
cap = cv2.VideoCapture(0) | |
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640) | |
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) | |
logo = cv2.imread('watermark.png') |
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> | |
<meta charset="utf-8"> | |
<title>Clear Interval Test</title> | |
</head> | |
<body> | |
<h1>Clear setInterval w/ JS</h1> | |
<br/> | |
<h4 id="status">Click Start</h4> |
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 requests | |
import base64 | |
def imageTest(url): | |
return base64.b64encode(requests.get(url).content) | |
def writeback(image): | |
decodeit = open('myimage.png', 'wb') | |
decodeit.write(base64.b64decode((image))) |
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
function getToken(name) { | |
let user = '{{request.user}}' | |
let cookieValue = null; | |
if (document.cookie && document.cookie !== '') { | |
const cookies = document.cookie.split(';'); | |
for (let i = 0; i < cookies.length; i++) { | |
const cookie = cookies[i].trim(); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) === (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |
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
#!/usr/bin/python3 | |
# python AES_Cryptography.py -e/-d <AbsolutePathToFile> | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
import os | |
import os.path | |
from os import listdir | |
from os.path import isfile, join | |
import hashlib | |
import sys |
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>Center anything with Grid</title> | |
<style> | |
*{ | |
margin:0; | |
padding: 0; | |
} | |
#parent{ |
NewerOlder