Skip to content

Instantly share code, notes, and snippets.

View eestrada's full-sized avatar

Ethan Estrada eestrada

View GitHub Profile
@eestrada
eestrada / force_iter.py
Last active November 3, 2021 20:42
Example(s) of how to force iteration of lazy iterators.
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@eestrada
eestrada / win_env.py
Last active November 4, 2021 00:20
Pythonic interface to the global and user environment variables on Windows.
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@eestrada
eestrada / cookie_converter.py
Last active May 2, 2022 21:17
simple script to convert google chrome sqlite cookie entries to old netscape cookies.txt format. Original code from here: https://productforums.google.com/d/msg/chrome/LWvfAFolOW4/hrC8ssNr27YJ
@eestrada
eestrada / data_structures.py
Last active May 2, 2022 21:27
A collection of useful data structures including a very complete linked list class that implements the full feature set of _collections.MutableSequence.
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@eestrada
eestrada / flask_server.py
Created May 11, 2017 19:17 — forked from tschieggm/flask_server.py
Stackdriver webhook server example
import string
import sys
import logging
import json
from flask import Flask
from flask import Response, request
logger = logging.getLogger(__name__)
logger.info("Stackdriver webhook-sample starting up on %s" % (string.replace(sys.version, '\n', ' ')))
@eestrada
eestrada / chmod.py
Last active September 5, 2022 21:10
Python chmod helper functions.
from __future__ import division, absolute_import, print_function
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@eestrada
eestrada / sqlite_regex.py
Last active December 21, 2023 13:46
How to do regular expressions in sqlite3 (using python).
#!/usr/bin/env python
"""How to do regular expressions in sqlite3 (using python)."""
from __future__ import division, absolute_import, print_function, unicode_literals
import re
import sys
import time
import datetime
import sqlite3