Skip to content

Instantly share code, notes, and snippets.

View mmwtsn's full-sized avatar

Maxwell Watson mmwtsn

View GitHub Profile
@mmwtsn
mmwtsn / .bashrc
Last active August 29, 2015 13:56
Bash helper functions for local development updates at Do Something. Make sure to update the PRODUCTION_PATH variable.
#
# Vagrant Helper Functions
#
# Abstract path to local installation of the Do Something site
export PRODUCTION_PATH='/Users/maxwell/Code/do-something/production'
# Update Git environment by pulling upstream/dev, rebasing and pushing to origin dev
function update() {
# Run this in the appropriate directory
@mmwtsn
mmwtsn / traver.md
Last active August 29, 2015 14:00
Traver's web development reading list.

Web Development

server-side

You should know two server-side languages, plus JavaScript. For each language, become familiar with one framework and one micro-framework or DSL.

language framework micro-framework
Python Django Flask
Ruby Rails Sinatra
JavaScript NodeJS ExpressJS
@mmwtsn
mmwtsn / ibm-cloud-active-pages.txt
Created June 24, 2014 17:23
A list of IBM's Cloud Marketing Pages.
IBM Cloud
Active Pages
/index.html
/catalog.html
/iaas.html
/paas.html
/saas.html
/private-cloud.html
/consulting.html
@mmwtsn
mmwtsn / _retina-images.scss
Created December 12, 2014 20:06
A comparison of `else` placements in a SCSS mixin.
// Bourbon _retina-images.scss via:
// https://raw.githubusercontent.com/thoughtbot/bourbon/502c2108dea1970ffeb4f91cb95b545d67bddfd0/app/assets/stylesheets/addons/_retina-image.scss
// Current version with @else on a new line
@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) {
@if $asset-pipeline {
background-image: image-url("#{$filename}.#{$extension}");
}
@else {
background-image: url("#{$filename}.#{$extension}");
@mmwtsn
mmwtsn / csv2json.js
Created October 20, 2015 20:36
Convert CSV line by line into JSON using streams in ES6.
import fs from 'fs'
import readline from 'readline'
let headers = []
let lines = 0
const rl = readline.createInterface({
input: fs.createReadStream('input.csv'),
output: fs.createWriteStream('output.json')
})
@mmwtsn
mmwtsn / branches.txt
Created June 25, 2013 17:33
Current branches off DoSomething/DoSomething-7.x as of 6/25
# Aaron
22 minutes ago Aaron Schachter /origin/campaign_login
7 days ago Aaron Schachter /origin/ds_sub_test_queue
4 weeks ago Aaron Schachter /origin/user_reg_template
# Admin (?)
5 weeks ago admin@dosomething.org /origin/picsforpets
# Dave
3 hours ago David Furnes /origin/qa
@mmwtsn
mmwtsn / official-npm.md
Created December 2, 2013 19:56
Official NPM Package Stamp
@mmwtsn
mmwtsn / html-classes.scss
Created January 3, 2014 19:33
Visualization of three CSS options.
// 1. NO MODIFIER CLASSES
// <header class="header">A Header</header>
// <footer class="footer">A Footer</footer>
.header,
.footer {
width: 100%;
max-width: 960px;
margin: 0 auto;
background: $gray;
@mmwtsn
mmwtsn / pattern-library.md
Last active January 4, 2016 03:59
Notes from the first NEUE DS => Pattern Library meeting with Mr. Furnes

Pattern Library

Decisions

  1. HTML classes allow for rapid prototyping content, however, they tie presentation and content. For that reason we're electing to move the lion's share of the work to SCSS mixins and functions. See: Bourbon Neat.
  2. Documentation will happen both inline amongst the source code and in a manually updated pattern library for now. In the research conducted thus far, no automated solutions have met our standards. If one comes along having living documentation that is automatically generated is, in theory, preferable. Worth noting that Bootstrap is manually documented. If it's good enough for Twitter...
  3. Our current grid system and all HTML classes under "Layout" are going to be reworked by Mr. Furnes. We're looking to simplify our approach.
  4. Further work on NEUE DS is not expected. For that reason all Pattern Library work will happen on feature branches. In order to preserve the development environment for Do Something's current Drupal installation, a local copy of NEUE

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.