Skip to content

Instantly share code, notes, and snippets.

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

fastfingertips

🧶
knitting..
  • 06:46 (UTC +03:00)
View GitHub Profile
from github import Github
from github import Auth
import github.InputFileContent
import json
def update_gist_file(gist_id, file_name, content):
if isinstance(content, dict):
content = json.dumps(content)
content = github.InputFileContent(content)
gist = g.get_gist(gist_id)
@fastfingertips
fastfingertips / parse_film_id.js
Last active February 9, 2024 20:30
Letterboxd bookmarklets
// https://letterboxd.com/film/<film-slug>
// https://letterboxd.com/<user-name>/film/<film-slug>
javascript:(function(){var e=document.querySelector('a[data-film-id]');if(e){var t=e.getAttribute("data-film-id");alert("Film ID: "+t);}else{alert("Film ID not found.");}})();
@fastfingertips
fastfingertips / issues.yaml
Last active February 9, 2024 20:34
tracking
- https://github.com/appwrite/awesome-appwrite/pull/489
- https://github.com/microsoft/terminal/issues/16100
- https://github.com/mozilla/geckodriver/issues/330
- https://googlechromelabs.github.io/chrome-for-testing/

In Python, the property() function and decorator play a crucial role in managing attributes by providing a structured way to define getters, setters, and deleters. These tools empower developers to create well-organized and readable code, enhancing the maintainability of their programs.

The Basics of property()

The property() function returns a property attribute, which is particularly useful for defining managed attributes in a class. It takes up to four arguments: fget for the getter function, fset for the setter function, fdel for the deleter function, and doc for creating a docstring.

Here is a basic example:

class C:
import json
test_list = ['2024', '01', '23', '']
keys = list(range(len(test_list)))
keys_2 = list(range(len(test_list) - 1))
# 1
try:
print(json.dumps(
dict(zip(
import asyncio
async def example_coroutine(lock):
print("Before acquiring the lock")
async with lock:
print("Lock acquired")
# Critical section: Access shared resource
print("Inside the critical section")
# Do some work...
print("Lock released")
@fastfingertips
fastfingertips / scraper.js
Created January 8, 2024 05:19
rotten tomatoes guide list scraper
const axios = require('axios');
const cheerio = require('cheerio');
const guide_url = "";
if (guide_url == "") {
console.log("Please set the guide_url variable to the url of the guide you want to scrape.");
return;
}
@fastfingertips
fastfingertips / .yaml
Last active October 19, 2023 05:05
snippets
html
bootstrap
docs
https://getbootstrap.com/docs/5.3/customize/color-modes/#enable-dark-mode
https://getbootstrap.com/docs/5.3/getting-started/download/
python
scraping
https://selenium-python.readthedocs.io/
flask
https://flask.palletsprojects.com/en/2.3.x/patterns/flashing/
@fastfingertips
fastfingertips / video_sharing_sites.md
Last active August 26, 2023 15:07
not require login