Skip to content

Instantly share code, notes, and snippets.

View FileInput error.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericdill
ericdill / button.ino
Last active Jun 22, 2019
Arduino button semaphore
View button.ino
//www.elegoo.com
//2016.12.08
int ledPin = 5;
int buttonApin = 9;
int buttonBpin = 8;
bool ledOn = false;
int loops = 0;
View gist:0c9aff06726f74efb70e702515a5a24c
num_tiles = 10
ret = []
for _ in range(num_tiles):
x0 = random.randint(0, source_size[0] - target_width)
y0 = random.randint(0, source_size[1] - target_height)
x1 = x0 + target_width
y1 = y0 + target_height
ret.append((x0, x1, y0, y1))
View why_oh_why.py
def _load(path, fsrw_class=None):
"""Returns a dictionary of configuration by reading from the configuration
file."""
if fsrw_class is None:
fsrw_class = FileSystemReaderWriter
config_file = fsrw_class(path)
config_file.ensure_file_exists()
config_text = config_file.read_lines()
line = u"".join(config_text).strip()
@ericdill
ericdill / LICENSE.txt
Created Jan 19, 2019 — forked from eriknw/LICENSE.txt
Jupyter Notebook "goto" demo
View LICENSE.txt
Copyright (c) 2018 Erik Welch
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
a. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
b. Redistributions in binary form must reproduce the above copyright
View keybase.md

Keybase proof

I hereby claim:

  • I am ericdill on github.
  • I am ericdill (https://keybase.io/ericdill) on keybase.
  • I have a public key ASBKy3lX_Nir2vYhR4IuxKB-X9-vUzEbI4gVuDiZGWDbrAo

To claim this, I am signing this object:

View feedstocks-per-maintainer.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:c75b798e1aef8421fe1d261dac2551f4
{
"cells": [
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import fnmatch"
@ericdill
ericdill / cmap
Created May 11, 2017
6 element viridis colormap
View cmap
# import matplotlib.cm as cm
# import numpy as np
# np.round(cm.viridis(np.arange(0, 1.2, 1/5)) * 255)
array([[ 68, 1, 84, 255],
[ 65, 68, 135, 255],
[ 42, 120, 142, 255],
[ 34, 168, 132, 255],
[122, 209, 81, 255],
[253, 231, 37, 255]])
@ericdill
ericdill / pre-commit
Last active Jul 21, 2018
Pre-commit hook that reformats your code according to yapf
View pre-commit
#!/bin/bash
# capture the changed files that have been staged
changed_files=$(git diff --staged --name-only)
echo "Changed files: ${changed_files}"
for file in ${changed_files}
do
echo "Modifying ${file}"
yapf ${file} -i
git add ${file}
done