Skip to content

Instantly share code, notes, and snippets.

View caseyanderson's full-sized avatar

Casey Anderson caseyanderson

View GitHub Profile
@caseyanderson
caseyanderson / osx_command_line_tools.md
Last active September 19, 2016 23:32
how to check to see if you have the command line tools

The Command Line Tools

Is Xcode on my computer?

Do you have Xcode on your computer? We are not going to use it in this class, but need something that Apple ships with it (unfortunately there is not an alternative to this for Mac OSX). To check to see if you have Xcode on your CPU, go to the Terminal (In finder navigate to Applications/Utilities and double click on the Terminal) and type the following:

xcode-select -p

If you see this as a response:

@caseyanderson
caseyanderson / gulpfile_connect.js
Last active February 26, 2017 21:38
boilerplate gulpfile for local web dev. creates connect server and opens a browser window at base, watches for changes and reloads sass and html.
var gulp = require('gulp');
var connect = require('gulp-connect');
var sass = require('gulp-sass');
var open = require('gulp-open');
var config = {
port: 9005,
url: 'http://localhost',
html: './html/*.html',
css: './css/',
@caseyanderson
caseyanderson / gulpfile_browsersync.js
Last active April 3, 2017 20:46
boilerplate gulpfile for local web dev. uses browsersync, watches for changes to html and css, regens css if changes in sass. also uses autoprefixer and clean css..
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var clean = require('gulp-clean-css');
var browserSync = require('browser-sync').create();
// store sass options
var sassOptions = {
errLogToConsole: true,
@caseyanderson
caseyanderson / watcher_handler.py
Created July 26, 2017 18:12
watches a directory for file events and responds with handler
'''
watcher and handler
to install watchdog for python3: pip3 install watchdog
sourced from https://www.michaelcho.me/article/using-pythons-watchdog-to-monitor-changes-to-a-directory
'''
import time
from watchdog.observers import Observer
@caseyanderson
caseyanderson / trig_video.py
Last active November 22, 2017 21:48
start video playback via button press (or similar input)
# trigger a video from button press or similar input
import os
import signal
import subprocess
from gpiozero import Button
video_path = '/home/pi/head_explode.mp4'
input_pin = 4
is_playing = 0
@caseyanderson
caseyanderson / rpi_media_control.md
Last active February 23, 2018 21:51
control media via python3 on raspberry pi
@caseyanderson
caseyanderson / write_backup_raspbian.md
Last active August 27, 2019 22:32
write or backup raspbian to or from a microSD

Writing, Backing Up, and Cloning Raspbian (RPi) Images

Materials

  • laptop (with internet access)
  • microSD card (ex: 8GB)
  • Raspbian Buster Lite Image File

Pre-flight

@caseyanderson
caseyanderson / connectivity_laptop_rpi.md
Last active September 5, 2018 00:30
Connectivity: Laptop to RPi
@caseyanderson
caseyanderson / intro_python3.md
Last active September 3, 2018 21:09
Intro to Python 3

Introduction to Python 3

Materials

  • laptop
  • Python3 development environment with Jupyter (see here for instructions)

Python is a general-purpose, interpreted, high-level programming language. The syntax of the language has been optimized to emphasize code readability, as well as brevity.

Strings

@caseyanderson
caseyanderson / command_line.md
Last active August 28, 2018 21:15
The Command Line

The Command Line

Materials

  • laptop
  • Max OSX Terminal or iTerm2

Navigate to the Command Line on Mac OSX (Applications > Utilities > Terminal).