Skip to content

Instantly share code, notes, and snippets.

View afiedler's full-sized avatar

Andy Fiedler afiedler

View GitHub Profile
@afiedler
afiedler / parks.json
Last active July 2, 2018 17:33
US National Parks
[
{
"name": "Acadia",
"photo": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Bass_harbor_head_light_20041002_123635_1.1504x1000.jpg/200px-Bass_harbor_head_light_20041002_123635_1.1504x1000.jpg",
"location": "Maine",
"dateFounded": "1919-02-26",
"area": 49075.26,
"visitors": 3509271
},
{
  • white - white
  • snow - grey-100
  • sleet - grey-200
  • slush - grey-300
  • smoke - grey-400
  • smog - grey-500
  • carbon - grey-600
  • silver - grey-700
  • slate - grey-800
  • steel - grey-900
(function() {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d")
var devicePixelRatio = window.devicePixelRatio || 1;
var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
ctx.backingStorePixelRatio || 1
console.log("devicePixelRatio: " + devicePixelRatio + "; backingStoreRatio: " + backingStoreRatio);
}());
@afiedler
afiedler / nvps_conventions.js
Last active July 8, 2016 14:49
NVPS JS Coding Conventions
{
// Taken from Visual Studio Code Defaults
// Enable / disable JavaScript validation
"javascript.validate.enable": true,
// Defines space handling after a comma delimiter
"javascript.format.insertSpaceAfterCommaDelimiter": true,
// Defines space handling after a semicolon in a for statement
"javascript.format.insertSpaceAfterSemicolonInForStatements": true,
[
{
"id": 4,
"name": "1.3.2 Explore",
"iframes": [
{
"url": "https:\/\/coretools.ldc.org\/#\/curriculumLibrary",
"button": "\u00d7Click here to explore library"
}
]
@afiedler
afiedler / eeg_spectrogram.ipynb
Created January 5, 2016 01:38
EEG Spectrogram
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afiedler
afiedler / lodash.js
Last active March 1, 2022 16:05
Lodash 3.5.0 (Modern build) modified to not throw exceptions on when used in Google App Script
/**
* @license
* lodash 3.5.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -o ./lodash.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
;(function() {
@afiedler
afiedler / gist:c06b12f6476d855ac237
Created February 3, 2015 17:24
Lock down Heroku with HTTP Auth
# in config/environments/production.rb
if ENV['HTTP_AUTH'].present?
config.middleware.use '::Rack::Auth::Basic' do |u, p|
[u, p] == ENV['HTTP_AUTH'].split(',')
end
end
# Set HTTP_AUTH on staging:
# $ heroku config:set HTTP_AUTH=username,password
@afiedler
afiedler / tokenize.c
Created November 4, 2010 17:12
C string tokenizer that returns empty strings for adjacent delimiters
/* TOKENIZE -- demonstrates a way to tokenize a string, with adjacent delimiters
* returned as empty strings.
* Partially based on: http://stackoverflow.com/questions/874161
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
/* Function declarations */