Skip to content

Instantly share code, notes, and snippets.

View lrq3000's full-sized avatar
🎵

Stephen Karl Larroque lrq3000

🎵
View GitHub Profile
@MarcSkovMadsen
MarcSkovMadsen / HvplotInteractive.ipynb
Created November 1, 2021 19:42
HvplotInteractive.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MarcSkovMadsen
MarcSkovMadsen / hvplot_interactive.py
Last active January 3, 2023 20:12
Example of using hvPlot .interactive with Panel
import pandas as pd
import hvplot.pandas
import panel as pn
pn.extension(sizing_mode="stretch_width")
PALETTE = [
"#ff6f69",
"#ffcc5c",
"#88d8b0",
// License: WTFPL
<div id="loadingMask" style="width: 100%; height: 100%; position: fixed; background: #fff;"></div>
<script>
function fadeOut(el) {
el.style.opacity = 1;
var last = +new Date();
var tick = function() {
el.style.opacity = +el.style.opacity - (new Date() - last) / 80;
last = +new Date();
@vaab
vaab / win_subprocess.py
Last active February 3, 2023 03:11
Fixing python 2.7 windows unicode issue with ``subprocess.Popen``.
# -*- coding: utf-8 -*-
## Copyright (C) 2021 Valentin Lab
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## are met:
##
## 1. Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
@linwoodc3
linwoodc3 / keyholemarkup_converter.py
Last active January 30, 2024 11:51
Convert KML/KMZ to CSV or KML/KMZ to shapefile or KML/KMZ to Dataframe or KML/KMZ to GeoJSON. Full script with classes to convert a KML or KMZ to GeoJSON, ESRI Shapefile, Pandas Dataframe, GeoPandas GeoDataframe, or CSV. Can write the converted file directly to disk with no human intervention.
# Author:
# Linwood Creekmore III
# email: valinvescap@gmail.com
# Acknowledgements:
# http://programmingadvent.blogspot.com/2013/06/kmzkml-file-parsing-with-python.html
# http://gis.stackexchange.com/questions/159681/geopandas-cant-save-geojson
# https://gist.github.com/mciantyre/32ff2c2d5cd9515c1ee7
@MarcCote
MarcCote / trk2tck.py
Last active December 2, 2022 12:49
Script that converts TRK to TCK using https://github.com/MarcCote/nibabel/tree/streamlines_tck
import os
import argparse
import nibabel as nib
def build_argparser():
DESCRIPTION = "Convert tractograms (TRK -> TCK)."
p = argparse.ArgumentParser(description=DESCRIPTION)
p.add_argument('tractograms', metavar='bundle', nargs="+", help='list of tractograms.')
p.add_argument('-f', '--force', action="store_true", help='overwrite existing output files.')
@Tydus
Tydus / waifu2x.py
Last active May 30, 2022 07:16
waifu2x in 15 lines of Python by @marcan42
import json, sys, numpy as np
from scipy import misc, signal
from PIL import Image
infile, outfile, modelpath = sys.argv[1:]
model = json.load(open(modelpath))
im = Image.open(infile).convert("YCbCr")
im = misc.fromimage(im.resize((2*im.size[0], 2*im.size[1]), resample=Image.NEAREST)).astype("float32")
planes = [np.pad(im[:,:,0], len(model), "edge") / 255.0]
for step in model:
o_planes = [sum([signal.convolve2d(ip, np.float32(kernel), "valid")
@eirikb
eirikb / demo.md
Last active January 28, 2017 13:53
Demo of clicktest.sh

#Demo

##About The demo is meant to show how to make an automated answer to a hn comment, translated from Norwegian to English with these steps:

  1. Click on Chrome address bar.
  2. Type translate.google.com and press enter.
  3. Click on input field.
  4. Type the text for translation and wait for it to translate.
@ChuckJHardy
ChuckJHardy / gource.md
Last active August 12, 2022 00:22
Gource Recording for Git

Install Gource

brew install gource

Convert Quicktime Movie to Animated Gif

ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

Record Gource

@eirikb
eirikb / clicktest.md
Last active April 9, 2021 16:49
Automated click testing in bash

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies