Skip to content

Instantly share code, notes, and snippets.

View firozzer's full-sized avatar
📱
PWAs FTW!

Firoze Sethna firozzer

📱
PWAs FTW!
View GitHub Profile
@sebastiancarlos
sebastiancarlos / minimal_dir.py
Last active January 20, 2024 10:08
Like dir(), but filters out __*__ attributes, standard library packages, and built-ins, to give a better idea of the object's custom attributes.
# explicitly define the interface
__all__ = ["minimal_dir"]
from functools import cache
@cache
def get_stdlib_packages():
""" Get list that should include all stdlib package/module names.
Not perfect. Has false positives.
@Julynx
Julynx / 15_python_tips.md
Last active April 4, 2024 06:20
15 Python Tips To Take Your Code To The Next Level!
@7aman
7aman / sqlite3-in-python.py
Created January 21, 2019 07:29
sqlite3 cheatsheet for python 3
#!/usr/bin/env python3
'''
Thanks to Andres Torres
Source: https://www.pythoncentral.io/introduction-to-sqlite-in-python/
'''
import sqlite3
# Create a database in RAM
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});