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
/** | |
* Generates a random key name such as "yfva-pyxd-qxfv-ftjr" | |
* @param {number} quartets | |
* @returns {string} | |
* | |
* (C) 2018 Adam C. Abernathy, [email protected]. Licence MIT | |
* https://gist.github.com/adamabernathy/4047f2e79b05af2d5f8b23e0748ac1a2 | |
*/ | |
const randomKey = (quartets = 4) => { | |
const f = () => Math.floor(Math.random() * 26) + 97; // Lowercase charcodes: 97->122 |
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
/** | |
* Parse string with `parameter:value` style search syntax to object. | |
* | |
* Examples: | |
* state:ut --> {state: ['ut']} | |
* state:ut,az,id --> {state: ['ut', 'az', 'id]} | |
* complete --> {complete: 1} // defaults to value of 1 | |
* {air_temp > 10} --> {filter_on: '(air_temp > 10)'} // explicit statement | |
* | |
* @param {string} blob, query |
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 array of n length | |
const range = n => Array.from({ length: n }, (v, i) => i); |
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
<html> | |
<head> | |
<style> | |
ul { | |
list-style: none; | |
} | |
label { | |
margin-right: 1em; |
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
<html> | |
<head> | |
<style> | |
h1 { | |
text-align: center; | |
} | |
.container { | |
padding: 0 5em 5em 5em; |
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 urllib import urlencode | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
import json | |
def fetch_data(service, parameters={}, debug=False): | |
'''Calls the Mesonet API service and returns data as a dictionary''' | |
baseurl = 'https://api.mesowest.net/v2/' | |
_parameters = urlencode(parameters) | |
payload = None # Set default to None, so you can catch errors later |
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
<html> | |
<head> | |
<title>Scrolling Weather Ticker</title> | |
<style> | |
@-webkit-keyframes ticker { | |
0% { | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0); | |
visibility: visible; |
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
<html> | |
<body> | |
<h2>Simple Latest Example</h2> | |
<p>See the console for the full data response.</p> | |
<hr/> | |
<div id="result"></div> | |
</body> | |
<script> |
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> | |
<!-- | |
Photo Viewer | |
View all images in a directory by clicking buttons. | |
This allows you to stay on the same page rather than clicking the back button every time you want to see a different image. | |
Image name can not have any spaces!! | |
Created by Brian Blaylock | |
Date: November 30, 2015 | |
Updated with bootstrap style: February 10, 2017 | |
http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/home.html |
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
# encoding: utf-8 | |
""" | |
TESTING SCRIPT for Time Rate of Change - QC Flag Test | |
""" | |
def assert_(statement, result, caption='*'): | |
""" | |
Simple assertion test | |
""" |