Skip to content

Instantly share code, notes, and snippets.

View arky's full-sized avatar

Arky arky

View GitHub Profile
@arky
arky / app.py
Last active April 21, 2026 10:36
Building Iconforge, a Shiny app that uploads images, resizes them, compresses them, and outputs a base64 HTML img tag for Quicklink icons.
import base64
import io
import json
import os
import shinyswatch
from PIL import Image
from shiny import reactive
from shiny.express import input, render, ui
from shiny.types import FileInfo, SilentException
@arky
arky / app.py
Created April 16, 2026 09:54
BulkFetch allows you batch download files
import io
import csv
import re
from datetime import date, datetime
from urllib.parse import unquote, urlparse
import requests
import zipfile
from shiny import reactive
from shiny.express import render, ui, input
from shinyswatch import theme
@arky
arky / app.py
Last active April 13, 2026 08:33
Validate GPX files, convert CSVs into GPX
import io
import csv
import math
import datetime
import xml.etree.ElementTree as ET
from shiny import reactive
from shiny.express import input, render, ui
from shinyswatch import theme
from shinywidgets import render_widget
@arky
arky / gist:2f90993ea67a544f8801f7482e125c12
Created February 18, 2025 11:53
Improving Java GUI Rendering on Ubuntu
Running certain Java applications on GNU/Linux can be unreliable. Java applications often use their own mechanisms for GUI and font rendering, which might not work well under the GNU/Linux operating system.
On Ubuntu 20.04 LTS, I found that the behavior of most Java applications can be controlled by supplying predefined variables to the Java runtime in `/etc/profile.d/jre.sh`.
``` bash
# /etc/profile.d/jre.sh
export JDK_JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
export JDK_JAVA_OPTIONS='-Djdk.gtk.version={2,2.2,3}'
export _JAVA_OPTIONS='-Dsun.java2d.opengl=true'
@arky
arky / app.py
Last active February 19, 2024 14:59
# example and data from:
# https://ipyleaflet.readthedocs.io/en/latest/layers/geo_json.html
# https://ipyleaflet.readthedocs.io/en/latest/layers/marker.html
import json
import pathlib
import random
from shiny import reactive
from shiny.express import ui, render, input
from shinywidgets import render_widget
#!/usr/bin/env python
# coding: utf-8
# Example python code to extract Named-entity recognition (NER)
# from a PDF document.
#
# The script uses spacy and spacypdfreader
# Install a pip packages require for
#import sys
@arky
arky / gist:ace36ceac31f89e01ceb8cb8b5eabeeb
Created May 26, 2022 15:20
React Number input with support for abbreviations k, m and b
import React from 'react';
import CurrencyInput from 'react-currency-input-field';
import { FormFieldWrapper } from '@plone/volto/components';
const CurrencyWidget = (props) => {
const { id, value, isDisabled, onClick, onChange, maximum, minimum } = props;
return (
<FormFieldWrapper {...props}>
<CurrencyInput
@arky
arky / Myanmar-Pcode-Search.ipynb
Last active March 24, 2021 19:22
Pcodes-test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ISO3166-2 Province Date Incidents
VN-89 An Giang 2020/01/22 0
VN-43 Ba Ria - Vung Tau 2020/01/22 3
VN-54 Bac Giang 2020/01/22 0
VN-53 Bac Kan 2020/01/22 0
VN-55 Bac Lieu 2020/01/22 0
VN-56 Bac Ninh 2020/01/22 3
VN-50 Ben Tre 2020/01/22 0
VN-31 Binh Dinh 2020/01/22 0
VN-57 Binh Duong 2020/01/22 3
ID Tên Mục đích Chức năng Vị trí Quy mô (người) Sự tham gia Tỉnh Link tham khảo
1 Khu nhà ở sinh viên Pháp Vân - Tứ Hiệp Trưng dụng cách ly tập trung Khu nhà ở sinh viên "Khu nhà ở sinh viên Pháp Vân - Tứ Hiệp (quận Hoàng Mai, Hà Nội)" 4000 "Quân đội, Công an, Bảo vệ tổ dân phố, Dân quân tự vệ" Hà Nội https://vnreview.vn/tin-tuc-xa-hoi-so/-/view_content/content/3097388/ha-noi-co-bao-nhieu-khu-cach-ly-tap-trung-phong-chong-dich-covid-19
2 Cao đẳng nghề Công nghệ cao Hà Nội Trưng dụng cách ly tập trung Ký túc xá sinh viên "Cao đẳng nghề công nghệ cao Hà Nội phường Tây Mỗ, quận Nam Từ Liêm. Thành phố Hà Nội" 800 "Quân đội, Công an, Bảo vệ tổ dân phố, Dân quân tự vệ" Hà Nội https://vnreview.vn/tin-tuc-xa-hoi-so/-/view_content/content/3097388/ha-noi-co-bao-nhieu-khu-cach-ly-tap-trung-phong-chong-dich-covid-19
3 Khu nhà ở sinh viên Mỹ Đình 2 Trưng dụng cách ly tập trung Khu nhà ở sinh viên "Khu nhà ở sinh viên tại phường Mỹ Đình II, quận Nam Từ Liêm (Hà N