Skip to content

Instantly share code, notes, and snippets.

Denise Draper denised

Block or report user

Report or block denised

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
denised /
Created Sep 8, 2019
Accumulate multiple lr/loss curves in fastai
from matplotlib import pyplot
from fastai.core import ifnone
# See my post on for an example
class LRAccumulator(object):
"""Accumulate multiple recorder results to compare them on the same graph. Can be applied across any Learner fit method
(lr_find, fit, etc.), and a single accumulator can be used across multiple learners, models, data... anything where you'd like
to compare the loss graphs."""
def __init__(self, learner=None, title="a", fmt=''):
denised / pull_from_github.yml
Created Aug 30, 2017
Ansible tasklist to pull from a github repo, with different behavior in dev vs. production
View pull_from_github.yml
# This is a *task-level* include
# Invoke it as a task like so
# - include: "lib/pull_from_github.yml"
# vars:
# ...
# where the vars are these:
# repo=name required. name is like "smbbeta_testing"
# dest=dir required. directory for the repo
# deploy_type=prod|dev required. deployment type.
denised / fillRows.js
Created Mar 28, 2017
Left-justify columns in html tables (datatables implementation, generally applicable concept)
View fillRows.js
* Create a justified table, while *also* enabling wrapable columns to mainain their width.
* This is not possible today with pure css, so we resort to javascript.
* This code is a tweak of the way datatables computes column widths (no way would I have been
* able to write this from scratch!).
* Usage: give the header of one column in the table the class 'dt-rowFiller'. As the most
* common use case, to have a natural looking, left-justified, table, add an extra empty column
* at the end, with this class. Then invoke one of the functions: fillRows() will cause the filling
* to happen a single time, while autoFillRows() watches for events that may cause table resizing and
denised / responsive-measure.scss
Created Apr 23, 2016
Simple Sass mixin for responsive css: start height / width / margin / font-size/etc. at one size, and shrink when the screen is smaller.
View responsive-measure.scss
* Set a measure to a standard size on large screens,
* and beneath 750 pixels width, scale it according to screen width.
* Useful for margins, padding, font-sizes: anything which takes a measure.
* Works with absolute measures (px, pt, etc., also rem), not
* with relative measures (em, etc.)
* Usage:
* foo {
* @include responsive-measure(margin,20px);
denised / layout.css
Created Mar 19, 2016
Simple css to for sticky footer or fixed header/footer *independent of footer size*. (Applies to wordpress as well as other sites).)
View layout.css
/* There are a lot of 'sticky footer' implementations out there, but they
* almost always require you to know the size of your footer in advance.
* Or they rely on some trick like display: table-row, whatever that really
* does. And most "fixed" header/footer implementations cause
* scrolling of the main body to be unintuitive (try to page forward and
* it goes too far, putting text you haven't seen yet under the header)
* This implementation is:
* (1) Very direct and 'semantic', i.e. No tricks. It uses
* flex display which is by now well supported.
denised / smartposition.js
Last active Aug 29, 2015
Some smart behavior for Cordova geolocation
View smartposition.js
/* smartPosition
smartPosition makes using the cordova geolocation plugin easier.
It "tries a reasonable amount" to obtain a desired level of
location accuracy.
the minimal call is just
denised / gist:5924370
Created Jul 4, 2013
Illustration of problem scrolling to fragment identifiers with absolutely positioned div.
View gist:5924370
<!DOCTYPE html>
<meta charset="utf-8" />
#header {
left:0; right:0; top:0;
padding: 0 50px;
You can’t perform that action at this time.