Skip to content

Instantly share code, notes, and snippets.

View fxadecimal's full-sized avatar
👨‍💻

fxadecimal

👨‍💻
View GitHub Profile
@fxadecimal
fxadecimal / SysML2.0.md
Last active September 20, 2023 15:27
Attempting to install the SysML2.0 Extension in Jupyter
@fxadecimal
fxadecimal / flask_folium_geojson_ajax_jquery.py
Last active November 7, 2022 11:37
Python Flask Folium GeoJson Leaflet Ajax Example
# -*- coding: utf-8 -*-
"""
# Python Flask Folium GeoJson Leaflet Ajax (Jquery) Sample
I couldn't find a simple example of how to combine Folium with an AJAX / getJson call.
1. Generate Folium Map with some static map features
2. Render to Template View with `render_template_string`
3. jquery Ajax call polls `/geojson` with `getJson`
@fxadecimal
fxadecimal / bare_minimum.html
Last active April 2, 2022 12:02
Bare minimum html file to get started. Sprinkle in your CDN dependencies as required.
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- cache killer for development -->
<meta http-equiv="Pragma" content="no-cache">
<title>Hello, World!</title>
@fxadecimal
fxadecimal / Python3_Snippets.py
Last active April 29, 2022 10:37
Python3 Snippets
# Quick Virtualenv
sudo apt-get install python3-pip python3-virtualenv
virtualenv .venv && source .venv/bin/activate
which pip # .venv/bin/pip
pip install -r requirements
# CSV
@fxadecimal
fxadecimal / quick_find_strings_in_df.ipynb
Last active March 15, 2021 18:26
Find Strings in DF
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fxadecimal
fxadecimal / django3-snippets.md
Last active November 22, 2021 15:23
Django 3+ Snippets

Django 3+ snippets

Virtual Env

pip3 install virtualenvwrapper

mkvirtualenv $ENV && \
workon $ENV
@fxadecimal
fxadecimal / raspberrypi-pinout.md
Last active March 25, 2024 10:39
Markdown Raspberry PI Pinout table and list.

Raspberry Pi Markdown Text

A markdown friendly Raspberry PI Pinout table and list.

I used a mixture of Excel, Vim and Regex to make these.

Output from the PIs pinout command

"""
Simple Pandas demo
- generating time-series data
- writing & load with CSV
- resampling
"""
@fxadecimal
fxadecimal / django-serve-spa.py
Created July 20, 2020 17:38
Quick workaround for serving static HTML / SPA from django in development
# app/urls.py
urlpatterns += [
path('<path:path>', views.view_static, name='serve')
]
# app/views.py
from django.views.static import serve
def view_static(response, path):
path = os.path.join('static', path)