Skip to content

Instantly share code, notes, and snippets.

View allenyllee's full-sized avatar

Allen.YL allenyllee

View GitHub Profile
@allenyllee
allenyllee / fetch_gdrive_file.sh
Last active November 10, 2017 08:03 — forked from ppetraki/fetch_gdrive_file.sh
allows you do non-interactively download large public files from gdrive
#!/bin/bash
SOURCE="$1"
if [ "${SOURCE}" == "" ]; then
echo "Must specify a source url"
exit 1
fi
DEST="$2"
#if [ "${DEST}" == "" ]; then
@allenyllee
allenyllee / Convolutional Arithmetic.ipynb
Created December 21, 2017 08:18 — forked from akiross/Convolutional Arithmetic.ipynb
Few experiments on how convolution and transposed convolution (deconvolution) should work in tensorflow.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@allenyllee
allenyllee / uuid.sh
Created January 12, 2018 14:57 — forked from markusfisch/uuid.sh
Generate a random UUID in bash
#!/usr/bin/env bash
# Generate a pseudo UUID
uuid()
{
local N B C='89ab'
for (( N=0; N < 16; ++N ))
do
B=$(( $RANDOM%256 ))
@allenyllee
allenyllee / dynupdate.sh
Last active September 2, 2018 13:38 — forked from kylegibson/dynupdate.sh
Simple bash script to update a dyndns host entry
#!/bin/bash
HOST=foo.example.com
USER=
PASS=
IPADDR=$(curl -s https://api.ipify.org)
RESULT=$(wget -q -O- "https://$USER:$PASS@members.dyndns.org/nic/update?hostname=$HOST&myip=$IPADDR&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG")
@allenyllee
allenyllee / defaultdict.py
Last active November 27, 2019 10:46 — forked from ohe/defaultdict.py
emulation of collections.defaultdict
"""
emulation of collections.defaultdict
"""
class defaultdict(dict):
"""
emulation of collections.defaultdict
to test, run python defaultdict.py -v
>>> dd = defaultdict(list)
@allenyllee
allenyllee / pandas-to-excel.py
Created December 18, 2020 10:50 — forked from ojdo/pandas-to-excel.py
From Pandas to Excel using Openpyxl
import pandas as pd
from io import StringIO
from openpyxl.formatting.rule import ColorScaleRule
from openpyxl.styles import Alignment, Font, NamedStyle
from openpyxl.utils import get_column_letter
df = pd.read_csv(StringIO("""\
alpha beta gamma
2000-01-01 -0.173215 0.119209 -1.044236
2000-01-02 -0.861849 -2.104569 -0.494929