Skip to content

Instantly share code, notes, and snippets.

View karlstolley's full-sized avatar

Karl Stolley karlstolley

View GitHub Profile
@karlstolley
karlstolley / rgba.scss
Created October 19, 2012 03:04
RGB/RGBa in Sass
// Declare the color as RGB; SASS will treat this as hex
$green: rgb(27,224,63);
// Declare an alpha
$alpha: .5;
// Declare another color variable as a color with an alpha
$greenAlpha: rgba($green, $alpha);
body {
/* As RGB (which SASS actually ouputs as HEX) */
background: $green;

Version Control: Command-line Git Installation

Be sure to install Git version 2.30.0 or higher.

MacOS/OS X Installation

A lot of developer technologies require XCode’s command-line tools, but they are useful in their own right. To install them, you’ll need to pull up the Terminal app on your Mac. The easiest way to do this is through Spotlight Search: click the magnifying glass in the upper right-hand corner of your Mac, and start typing Terminal; click the result that appears labeled as an Application.

You’ll have a small white window that pops up, with a line that most likely has the name of your computer followed by a colon, tilde, and dollar-sign, e.g., janes-mac:~ $. There’ll also be a cursor, which may or may not blink.

@karlstolley
karlstolley / chrome-binary-data.js
Created October 12, 2021 01:37
RTC 2021 Code Examples
// Create a data channel for exchanging
// feature-detection information. Here,
// just the default `binaryType` on the
// data channel itself:
function addFeaturesChannel(peer) {
peer.featuresChannel =
peer.connection.createDataChannel('features',
{ negotiated: true, id: 60 });
peer.featuresChannel.onopen = function(event) {
@karlstolley
karlstolley / Gemfile
Last active September 22, 2021 13:30
Fancy-pants Jekyll stuff
source 'http://rubygems.org'
gem 'jekyll-haml' # See https://github.com/samvincent/jekyll-haml
gem 'bootstrap-sass' # See https://github.com/twbs/bootstrap-sass
@karlstolley
karlstolley / commented.pre-commit
Last active April 20, 2021 19:55
Script for running tests before a Git Commit
#! /usr/bin/env sh
# This basic file was cribbed liberally from the post at
# https://codeinthehole.com/tips/tips-for-using-a-git-pre-commit-hook/
# but the Git commands have been updated for current best practices.
# Sanity checker. Alerts to STDOUT that the pre-commit hook is about to run.
# (uncomment to use)
# echo "Running the pre-commit hook..."
# Stash any unstaged changes so that they don't interefere with the test suite
[
{
"dateutc": 1580328600000,
"tempinf": 68,
"tempf": 33.3,
"humidityin": 35,
"humidity": 65,
"windspeedmph": 0,
"windgustmph": 0,
"maxdailygust": 34.9,
@karlstolley
karlstolley / install.sh
Last active February 26, 2020 21:08
Basic unstaged-file friendly pre-commit script
ln -s ../../scripts/pre-commit.sh ../.git/hooks/pre-commit
@karlstolley
karlstolley / 404-error.js
Last active September 7, 2018 16:43
openweathermap.org API responses
// http://api.openweathermap.org/data/2.5/forecast/daily?q=Fake%20Town,%20AZ&units=imperial&cnt=5&callback=forecast
// (Call for 'Fake Town, AZ' -- there is of course no such town)
{
"message": "",
"cod": "404"
}
@karlstolley
karlstolley / setup.md
Created May 15, 2018 17:09
Summer API Technology Setup

If you run into any problems or have any questions about these instructions, ping Prof. Stolley on Basecamp or post to the chat room -- if you're getting error messages, take a screenshot or write down the exact wording of the error.

1. Browser: Firefox Developer Edition

Available for all platforms (Mac, Windows, Linux) at https://www.mozilla.org/en-US/firefox/developer/ Download & install like any other software.

2. Editor: Atom.io

If you don't yet have a favorite text editor that is highly capable of syntax highlighting HTML, CSS, and Javascript, give Atom a try. Available for all platforms at https://atom.io Download & install like any other software.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDw9k7eTc5mSEEc87KO7V8OMGNurkl8lcge78eglNcZUegUJ9u8wOIjxXvn8d8Wjg/uYsBnb+JWxlLQQE7jf2aPzkr8iwuMQrkjoaLm6S/7z/zLyYzlS0yv+Qom/9kHjtpMMk6RSCq8wbeJymx0FHxHk9/0FCuQgkN/8AJUmoc/gtWcHP3DRGBV4brDH3ghIfbiDJfIT/UfGiSE85XRt9rZZjzAlcLwWIELjZ3uxe/VuAAbfvxRQ9vApCKPgY2yKBL+Ki+gPHxwwgx4/8N+XYHiJ4DdDquGvQsuKSTwV4QzR0RuID7AQdfnaKS/kDvTTg8Mkby/egR7aVsf0aVscOtEEUR95Qkg9UxFFvNY/aR/RLwFb+fUFJr1nTdzkiZ9K8uyAVM58TktAbAaIO3tL58vvIB0oQUGbbutlTN9yiHUMSH9uxWORiOvoCUDmeDuScWtn8OfDtW08W0WZz/K1tUArxi0HWYSmZ5Y7qM5gPpsyFNPsWq3X78Axh3pdRE939Clevq+swnotdSkXmlfFSrC3Jz7Whk9dYDZxmuliFHnuRsLXhgOrI3D+S7LOJCffaxoWCCVhwfKeZFRlYEBL36+Dzw5BFRm7Poo/NUZtWdIddymU7nKWffEriIFNxPw01NgSQFBwL50+sd523oauMjcKzDMLolzISCxqZthX08mbw== karl.stolley+vico@gmail.com