This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot | |
from fastai.core import ifnone | |
# See my post on forums.fast.ai 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=''): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* smartPosition | |
TL;DR: | |
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 | |
smartPosition(onSuccess) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Testing</title> | |
<style> | |
#header { | |
position:fixed; | |
left:0; right:0; top:0; | |
padding: 0 50px; |