Skip to content

Instantly share code, notes, and snippets.

View codewithpom's full-sized avatar
🎯
Building txtutils

Padmashree Jha codewithpom

🎯
Building txtutils
View GitHub Profile
from selenium.webdriver import Chrome
# import the Chrome class
import time
driver = Chrome()
# create driver instance
driver.get("https://www.seleniumeasy.com/test/basic-first-form-demo.html")
time.sleep(3)
close_button = driver.find_element_by_id('at-cv-lightbox-close')
close_button.click()
import requests
url = "https://type.fit/api/quotes"
data = requests.get(url).json()
for i in data:
print(i['text'])
print(i['author'])
print()
print()
# Have fun
import matplotlib.pyplot as plt
y_axis = [4, 6, 7, 5, 9, 10]
# create y_axis list for y axis
x_axis = list(range(len(y_axis)))
# create x_axis list for x axis
plt.plot(x_axis, y_axis)
# plot the lists on the graph
plt.title("My first Matplotlib Graph")
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
import time
options = Options()
options.add_argument("--disable-notifications")
options.add_argument("--headless")
driver = Chrome(chrome_options=options)
driver.get("https://facebook.com")
import viewer # Python Beat C#
# Python WON 🎉🎉🎉
// Sample express app
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
@codewithpom
codewithpom / Google-Trend-Single-Graph.ipynb
Created November 17, 2021 14:44
A jupyter notebook with Google Trend analysis on a topic plotted with plotly.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codewithpom
codewithpom / char-to-binary.js
Created November 19, 2021 09:06
Convert a character to binary using js.
function convert_char_to_binary(char){
const code = char.charCodeAt(0); // convert the char to ASCII (UTF-16)
return code.toString(2); // convert ASCII integer to binary
}
const binary = convert_char_to_binary("a")
console.log(binary) // logs '1100001'
@codewithpom
codewithpom / string-to-binary.js
Created November 19, 2021 09:22
Converts a word or sentence to binary
function convertToBinary(text) {
var result = '';
for (var i = 0; i < text.length; i++) {
var char = text[i];
var code = char.charCodeAt(0);
result += code.toString(2) + ' ';
}
return result;
}