Skip to content

Instantly share code, notes, and snippets.

View fastfingertips's full-sized avatar
🧶
knitting..

fastfingertips

🧶
knitting..
  • Istanbul
  • 11:13 (UTC +03:00)
View GitHub Profile
url="https://gist.githubusercontent.com/zneak/53f885f1fc5856741cb4/raw/a17a81d15acb8109cda8524c743186901dd269b6/words.txt"
words=($(curl -s $url | grep '^\w\w\w\w\w$' | tr '[a-z]' '[A-Z]'))
actual=${words[$[$RANDOM % ${#words[@]}]]}
end=false
guess_count=0
max_guess=6
if [[ $1 == "unlimit" ]]; then
max_guess=999999
fi
while [[ $end != true ]]; do
import webbrowser
new = 2 # open in a new tab, if possible
url = "https://unix.org/"
webbrowser.open(url,new=new)
# open an HTML file on my own (Windows) computer
url = "file://C:/Users/User/index.html"
webbrowser.open(url,new=new)
@fastfingertips
fastfingertips / get_a_href.py
Created February 20, 2022 16:05
Scraping Link from HTML
from bs4 import BeautifulSoup
import requests, re
def getDom(_url):
return requests.get(_url).text # response
urlDom = getDom(input('Url: '))
parserDom = BeautifulSoup(urlDom, 'html.parser')
for link in parserDom.find_all('a', attrs={'href': re.compile('^https://')}):
@fastfingertips
fastfingertips / wlan-export.bat
Created March 10, 2022 12:34
Export wlan pw
netsh wlan export profile folder="%UserProfile%\Desktop"
netsh wlan export profile key=clear folder="%UserProfile%\Desktop"
@fastfingertips
fastfingertips / ssid_pw.sh
Created March 10, 2022 12:37
Get ssid pw
echo Wifi name:?
read ssid
netsh wlan show profile name=$ssid key=clear
read -s -p "Press any key to exit ..."
@fastfingertips
fastfingertips / scraping
Last active August 11, 2022 00:49
Scraping tools
LXML
SCRAPY
HTTPLIB
REQUESTS
SELENIUM
HTMLparser
HTMLPARSER
BEAUTIFULSOUP
URLLIB / URLLIB2
https://lxml.de/
def uncamel(text):
"""helloWorld => hello_world"""
r = ''
for t in text:
r += '_' + t.lower() if t.isupper() else t
return r
print(uncamel('helloWorld'))
print(uncamel('goodbyeWorld'))
print(uncamel('loremIpsum'))
@fastfingertips
fastfingertips / google-10000-words.txt
Last active September 2, 2022 17:45
Google 10000 words.
the
of
and
to
a
in
for
is
on
that
@fastfingertips
fastfingertips / youtubeCheckbox.js
Last active September 15, 2022 18:57
Is the youtube video being watched available on any of your lists?
var l = document.getElementsByClassName('style-scope ytd-playlist-add-to-option-renderer').length
for (let i = 0; i < l; i++) {
var liste = document.getElementsByClassName('style-scope ytd-playlist-add-to-option-renderer')[i].getAttribute("aria-checked");
if(liste == 'true'){alert("This video is in your playlist.");}
}
/*
var checkbox = document.querySelector("#checkbox")
var listName = document.querySelector("#checkboxLabel")
import requests
import json
# The query to get the most popular anime
query = """
query ($page: Int) {
Page (page: $page, perPage: 50) {
media (sort: POPULARITY_DESC, type: ANIME, isAdult: true) {
id
title {