Skip to content

Instantly share code, notes, and snippets.

View vovavili's full-sized avatar
🎯
Focusing

Vladimir vovavili

🎯
Focusing
  • Paris, France
View GitHub Profile
@vovavili
vovavili / time_script.py
Last active June 11, 2024 08:16
Time Python scripts
"""Time functions using a decorator."""
import time
from collections.abc import Callable
from functools import wraps
from typing import ParamSpec, TypeVar
P = ParamSpec("P")
R = TypeVar("R")
# -*- coding: utf-8 -*-
import os
from html.parser import HTMLParser
import dash
import pandas as pd
import plotly.express as px
import requests
from dash import html, dcc, dash_table, Input, Output
@kgriffs
kgriffs / results.py
Created May 21, 2021 23:05
Benchmarking Python JSON libs: std vs. orjson vs. simdjson - simple encode/decode tests
# ----------------------------------------------------------------------------
import json
import simdjson
import libpy_simdjson
decoder_std = json.JSONDecoder()
encoder_std = json.JSONEncoder(ensure_ascii=False)
p = simdjson.Parser()
p2 = libpy_simdjson.Parser()
# extract SQLite3 data to dict example, explained in this post:
# https://nickgeorge.net/programming/python-sqlite3-extract-to-dictionary/
# run with:
# python3 extract-to-dict.py
import os
import sqlite3
import sys
def sql_data_to_list_of_dicts(path_to_db, select_query):
@miketartar
miketartar / ColdTurkeyBlockerActivator.py
Created September 26, 2020 04:21
Cold Turkey Blocker Activator
import json
import sqlite3
import os
DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"
def activate():
@bbengfort
bbengfort / zipr.py
Last active December 5, 2021 01:34
Dealing with Zip archives and json data in Python
#!/usr/bin/env python3
import os
import json
import random
import zipfile
config = {
"color": "red",
"amount": 42.24,
@LambdAurora
LambdAurora / optifine_alternatives_fabric.md
Last active June 30, 2024 17:13
Recommended OptiFine alternatives on Fabric

The list is moving out!

If you share this list, please use this link instead: https://lambdaurora.dev/optifine_alternatives

It may still be only a redirection link, but it will have a better web display of the list soon. And the list being on GitHub/GitHub pages improves load times.

The gist version of this list will stop being updated.

Why?

@tfeldmann
tfeldmann / duplicates.py
Last active May 26, 2024 03:18
Fast duplicate file finder written in python
#!/usr/bin/env python
"""
Fast duplicate file finder.
Usage: duplicates.py <folder> [<folder>...]
Based on https://stackoverflow.com/a/36113168/300783
Modified for Python3 with some small code improvements.
"""
import os
import sys
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h
index 0094beb299..433a623963 100644
--- a/gtk/gtkfilechooserprivate.h
+++ b/gtk/gtkfilechooserprivate.h
@@ -32,10 +32,14 @@
#include "gtktreestore.h"
#include "gtktreeview.h"
#include "gtkbox.h"
+#include "gtkiconview.h"
+#include "gtkscale.h"
@chazmaniandinkle
chazmaniandinkle / 0_README.md
Last active June 17, 2024 06:57
Guide for setting up Tree Style Tabs as replacement for horizontal tab bar in Firefox

This gist is to help in setting up the Tree Style Tabs sidebar as a full replacement of the built-in horizontal tabs bar in Firefox. These settings are customized to what I've found to be the most comfortable, but feel free to experiment with them and find the settings that are perfect for you!


userChrome.css

This should be added to userChrome.css file under your FireFox profile (on my Macbook, "/Users/<username>/Library/Application Support/Firefox/Profiles/<default profile>/chrome/userChrome.css")

tree-style-tab_extension-extras.css

After installing the "Tree Style Tabs" Firefox extension, open the extension settings and paste this into the text box under "Advanced -> Extra style rules for sidebar contents"