Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am TylerFisher on github.
  • I am tylrfishr (https://keybase.io/tylrfishr) on keybase.
  • I have a public key whose fingerprint is 02CC 8F1D CD3F 9F3E 9043 573E C4F9 D233 89B2 E288

To claim this, I am signing this object:

@TylerFisher
TylerFisher / README.md
Last active July 13, 2021 18:48 — forked from onyxfish/README.md
Google Spreadsheets script to generate slugs from a range of cells

This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.

Use it like this!

# A B C
1 a b slug
2 foo baz bing =slugify(A2:B4)
3 bar BAZ
4 FOO baz-bing
@TylerFisher
TylerFisher / april_7_lesson.md
Last active April 7, 2016 18:29 — forked from jeremyjbowers/april_7_lesson.md
The April 7th Class Lecture

April 7th Lesson

Now that we've all had a good face-to-face, we're going to accomplish two things today.

First, we're going to add a new route to your app.py that will let you see a single incident / detainee by clicking on a link from your home page.

Second, we're going to walk through how CSS works and discuss how you might use Materialize to clean up your site's design.

Update your app.py

Current state of your app.py

@TylerFisher
TylerFisher / tally.py
Created December 17, 2015 15:29
Sample agate-based script for tallying the results for the All Songs Considered listeners poll: http://www.npr.org/sections/allsongs/2015/12/16/459822811/poll-results-listeners-pick-their-favorite-albums-of-2015
import agate
data = {}
output = {}
"""
Converts all entries to lowercase for easier matching.
"""
def process_csv():
lowered_list = []
@TylerFisher
TylerFisher / LICENSE
Last active March 22, 2020 11:26
A basic library and example usage for JavaScript-based Chromecast apps, developed by NPR Visuals for elections.npr.org.
The MIT License (MIT)
Copyright (c) 2014 NPR
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@TylerFisher
TylerFisher / LICENSE
Last active August 29, 2015 14:08
Our elections app relied on a 16x9 slide layout across all devices, regardless of the size of the actual screen. We wrote some tricky CSS and JavaScript to achieve this.
The MIT License (MIT)
Copyright (c) 2014 NPR
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@TylerFisher
TylerFisher / LICENSE
Last active August 29, 2015 14:08
This code will refresh all users on your webpage upon deployment of a timestamp.json file to S3. We used this to deploy hotfixes on election night for elections.npr.org. It requires Fabric (a Python library for running tasks on the command line) and jquery-cookie.js, but could easily be refactored to not.
The MIT License (MIT)
Copyright (c) 2014 NPR
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@TylerFisher
TylerFisher / code-structure.js
Created May 21, 2014 17:39
An example of good code structure for Unclass
// all variables I will use
var photosArray;
var photosArrayCounter;
var $visiblePhoto;
// all functions
var changePhoto = function() {
if ($(this).hasClass('next') && photosArrayCounter < photosArray.length) {
@TylerFisher
TylerFisher / slide.html
Created April 23, 2014 15:03
Slide template from Borderland
<div {% if row.data_panel %} data-anchor="{{ row.data_panel.lower() }}" {% endif %} class="slide {% if row.extra_class %} {{ row.extra_class }} {% endif %}" style="{% if row.color %} background-color: {{ row.color }}; {% endif %}" {% if row.image %} data-bgimage="{{ row.image }}" {% endif %}>
<div class="text full-block {% if row.text_background == 'yes' %} text-bg {% endif %}">
<div class="full-block-cell">
<div class="full-block-content">
{{ row.text }}
</div><!--full-block-content-->
</div><!--full-block-cell-->
</div><!--full-block-->
</div><!--slide-->
@TylerFisher
TylerFisher / index.html
Created April 23, 2014 15:02
Looping over a copytext spreadsheet to find jinja2 templates
{% for row in COPY.content %}
{% include "%s.html"|format(row.template) ignore missing %}
{% endfor %}