Skip to content

Instantly share code, notes, and snippets.

View brittanydionigi's full-sized avatar

Brittany Dionigi brittanydionigi

View GitHub Profile
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Made of Code.tmTheme",
"font_face": "Inconsolata",
"font_size": 11.0,
"ignored_packages":
[
"Vintage"
],
@brittanydionigi
brittanydionigi / ctopox.css
Last active December 17, 2015 06:29
mou editor/css theme
html { border-top: 3px solid #C2E7A5; border-bottom: 3px solid #C2E7A5; }
body { font-family: "Helvetica Neue", Arial, sans-serif; font-size: 13px; line-height: 18px; color: #666; background-color: #fafafa; padding: 10px 15px; font-weight: 200; }
/* Headers */
h1, h2, h3, h4, h5, h6, p, blockquote { margin: 0; padding: 0; }
h1 { padding: 40px 0px 0px 0px; text-align: right; font-weight: 100; color: #333; font-size: 18px; }
h2 { font-size: 24px; margin: 70px 0px 15px 0px; font-weight: 100; border-bottom: 1px solid #ddd; padding: 10px 0px; }
h3 { font-size: 14px; text-transform: uppercase; color: #555; margin: 30px 0px 0px 0px; }
h4 { font-size: 14px; color: #555; margin: 25px 0px 0px 0px; font-weight: 500; }
@brittanydionigi
brittanydionigi / googlemap.html
Last active June 30, 2020 21:42
pin cities on a google map based on city name & country
<!doctype>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps - pin cities</title>
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
#map_canvas { height: 100%; }
</style>
@brittanydionigi
brittanydionigi / .hashrc
Last active December 20, 2015 09:09
git aliases
# forked from: https://github.com/hashrocket/dotmatrix/blob/master/.hashrc
# git_prompt_info accepts 0 or 1 arguments (i.e., format string)
# returns text to add to bash PS1 prompt (includes branch name)
git_prompt_info () {
local g="$(git rev-parse --git-dir 2>/dev/null)"
if [ -n "$g" ]; then
local r
local b
local d
@brittanydionigi
brittanydionigi / document-fragments.js
Last active December 24, 2015 06:09
over-engineering document fragments to death
/*
* Helper function for creating document fragments
* @param {object} node The DOM node we are creating
* @param {string} txt The text, if any, that we want directly inside of our DOM node
* @param {object} nodeAttrs A hash of any attributes we want to set on the DOM node (e.g. className, id, href, etc.)
* @param {array} childNodes An array of any child elements we want to insert within our DOM node
* @return {object} elem The DOM element we've built with appropriate text and child nodes
*/
constructElem = function(node, txt, nodeAttrs, childNodes) {
var elem = node;
@brittanydionigi
brittanydionigi / custom.css
Created December 15, 2013 17:34
devtools sooo cute!!
/*****************************************************************************/
/* Zero-Dark-Matrix
/* Optimized for Chrome Dev/Canary Channel v31
/* https://github.com/mauricecruz/chrome-devtools-zerodarkmatrix-theme
/*************************************************************************/
/**********************************************
/* Readability
/* -------------------------------------------
/* Adjust the line height for elements|sources
@brittanydionigi
brittanydionigi / strength.py
Last active January 1, 2016 14:19
get play-by-play event strength
def get_strength_transitions(teams, events):
strength = [{"start_time": 0, "advantage": None }]
originalAdvantage = None
for ind, event in enumerate(events):
if len(event["strength"]) == 2:
timeExpired = parseGameTime(event["total_time_expired"])
eventStrength = event["strength"]
teamAdvantage = None
@brittanydionigi
brittanydionigi / D3-Line-Chart-Plotting-Shot-Attempts.markdown
Last active January 1, 2016 16:58
codepen to gist. it's amazing.

D3 Line Chart Plotting Shot Attempts

D3 line chart plotting shot attempts for an NHL hockey game. Different point styling for goals vs. shots, tooltip on hover & additional details show on click. Optional strength chart toggle which underlays 5v4, 4v5 and 5v5 events during the game.

A Pen by Brittany Storoz on CodePen.

License.

@brittanydionigi
brittanydionigi / responsive-background-colors.css
Created January 28, 2014 01:44
responsive CSS template for development
/* RED 1024 */
@media only screen and (max-width: 1024px) {
body { background-color: rgba(255, 0, 0, 0.5); }
}
/* ORANGE 972 */
@media only screen and (max-width: 972px) {
body { background-color: rgba(255, 165, 0, 0.5); }
}
/*
* Helper function for getting query string parameters
* @param {string} name The name of the query parameter we want the value of
* @return {string} results Value of the query parameter
*/
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));