Skip to content

Instantly share code, notes, and snippets.

@Gerschel
Gerschel / ui_dropdown_w_for.py
Last active May 6, 2023 01:31
Gradio dropdown example with x number of dropdowns; fix for loop and list comprehension concerning scope with components
"""
Example program for moving forward through dropdowns, each one being dependent
on the prior one.
Ideally, you'd want to disable interactive, so they can't pick a choice higher up
that was selected lower. #SOLVED: ~~I haven't solved the interactive issue yet~~. Interaction issue solved.
gr.Dropdown.update interactive didn't modify when using this style of dependent dropdowns
The fix was to use gr.update, which, in other testing, didn't work when developing this script,
but does, when you have the helper functions.
@Gerschel
Gerschel / english.py
Created April 29, 2022 16:52
Bip39 English wordlist with \n removed, formatted for python import
wordlist = ["abandon",
"ability",
"able",
"about",
"above",
"absent",
"absorb",
"abstract",
"absurd",
"abuse",
@Gerschel
Gerschel / instructions.md
Created November 23, 2020 04:22 — forked from richlander/instructions.md
Installing .NET Core 3.0 on Linux ARM64

Installing .NET Core on Linux ARM64

The following intructions can be used to install .NET Core on Linux ARM64.

Pro tip: Check out .NET Core Docker files to determine the exact instructions for installing .NET Core builds, for example .NET Core 3.1 ARM32 SDK Dockerfile.

Installing .NET Core Globally

The following instructions install the latest .NET Core globally. It isn't required to do that, but it provides the best experience.

@Gerschel
Gerschel / reprint_functions.py
Created February 21, 2020 08:33
Get source of self-defined functions in interpreter; will need editing for your use; saves your butt when you write some cool stuff on the fly in the interpreter, and you like keeping cool stuff.
#!python3
"""
This file will need to be edited before each use, it's not copy and run
It's worth the trouble if you find yourself playing in the interpreter
and you get carried away and write a lot of code you don't feel like
losing.
"""
#from inspect import getsource //builtin, helps when files are saved
from dill.source import getsource #python3 -m pip install dill; usage, when in repl/interpreter/interactive shell
@Gerschel
Gerschel / gist:40e49a219f566d67d0964c557c6823c0
Created April 18, 2019 13:46
VSCode pylint; recognize modules when importing
#Instead of whitelisting add this snippet to json settings in vscode
{
"python.linting.pylintArgs": ["--generate-members"],
}
@Gerschel
Gerschel / binarysearchtree.py
Created January 24, 2017 02:46 — forked from pcalcao/binarysearchtree.py
Binary Search Tree implementation, supporting article in http://intothewebs.tumblr.com
#!/etc/python
class BinarySearchTree():
def __init__(self, parent=None):
self.key = None
self.value = None
self.left = None
self.right = None
@Gerschel
Gerschel / README.rst
Created January 17, 2017 10:14 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@Gerschel
Gerschel / README.md
Created January 12, 2017 02:52 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@Gerschel
Gerschel / 0_reuse_code.js
Created December 12, 2016 08:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Gerschel
Gerschel / my_timer.py
Created December 12, 2016 06:58
Simple function timer; Python
#!python3
import time
def func_timer(func, *args):
"""
Input: function without parenthesis with any number of functions
Output: Dictionary with Minimum, Maximum and Average times over 10000 calls
Example: func_timer(add, 1, 2)
"""
count = 0