Skip to content

Instantly share code, notes, and snippets.

View wolfiex's full-sized avatar

Dan Ellis wolfiex

View GitHub Profile
@wolfiex
wolfiex / simple_upload.html
Last active November 14, 2020 02:08
Upload Flask
<!doctype html>
<title>File Uploader</title>
<style>
body,
.center {
margin: auto;
width: 50%;
border: 3px solid green;
padding: 10px;
}
@wolfiex
wolfiex / log_example.py
Last active November 26, 2020 00:57
Loggingdemo
import logging
'''
Set up logger
'''
log = logging.getLogger(__file__.rsplit('/',1)[1]) ## if running interactively with ipython, replace this with a descriptive string
log.propagate = False
log.setLevel(logging.DEBUG)
logfile = 'test.log'
@wolfiex
wolfiex / pdfdiff.bash
Created November 28, 2020 18:10 — forked from jadephilipoom/pdfdiff.bash
Pretty PDF diff using wdiff and MarkDown
wdiff -n -w $'~~' -x $'~~' -y $'\\textcolor{blue}{' -z '}' base.md new.md | pandoc -o diff.pdf
@wolfiex
wolfiex / ARC4 config_machine.xml
Last active March 18, 2021 01:07
CESM ARC4 Machine File
<machine MACH="arc4">
<DESC>
A port of CEM to the leeds ARC4 machine. CEMAC.
</DESC>
<NODENAME_REGEX>.*.arc*</NODENAME_REGEX>
<OS>LINUX</OS>
<COMPILERS>intel</COMPILERS>
<MPILIBS>mpich</MPILIBS>
<PROJECT>None</PROJECT>
<SAVE_TIMING_DIR></SAVE_TIMING_DIR>
@wolfiex
wolfiex / ARC4_config_complilers.xml
Last active March 18, 2021 01:08
CESM compiler script for ARC4
<compiler MACH="arc4">
<SLIBS>
<append> -I$ENV{ILIBS}/include -I$ENV{ILIBS}/lib -Wl,-rpath -Wl,%{ILIBS}/lib -Wl,--enable-new-dtags -L$ENV{ILIBS}/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -L$ENV{ILIBS}/lib -lnetcdff -lnetcdf</append>
</SLIBS>
<ESMF_LIBDIR>/home/home01/earfw/esmf_arc4/lib/libO/Linux.intel.64.openmpi.default/</ESMF_LIBDIR>
</compiler>
@wolfiex
wolfiex / CSS811.ino
Created May 5, 2021 13:34
CSS811 example
/***************************************************************************
This is a library for the CCS811 air
This sketch reads the sensor
Designed specifically to work with the Adafruit CCS811 breakout
----> http://www.adafruit.com/products/3566
These sensors use I2C to communicate. The device's I2C address is 0x5A
@wolfiex
wolfiex / tiletools.py
Last active June 8, 2022 13:24
Map-Tile Tools in Python
'''
A collection of Tile tools in python.
Author: Daniel Ellis 2022
Contact: daniel.ellis.research (a-t) gmail (dot) com
Article: https://medium.com/p/e54de570d0bd
'''
import mpmath as mp
@wolfiex
wolfiex / sim.py
Created May 19, 2022 21:59
Simulate Dataset
'''
A script to generate a synthetic dataset replacing the original one.
Author: danielellisresearch.com
'''
# !pip install synthia pandas
import pandas as pd
@wolfiex
wolfiex / getcss.py
Created June 21, 2022 00:20
Extract CSS from url
# headless browser
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
import re
url = 'myurl.com'
querySelect = 'section'
@wolfiex
wolfiex / OpenGraph.svelte
Last active July 18, 2022 11:45
Svelte Sharable Content
<script>
import {onMount} from 'svelte';
export let title = '';
export let description = '';
export let url = '';
export let image = '';
export let type = 'article';
export let print = false;