Skip to content

Instantly share code, notes, and snippets.

View cwonrails's full-sized avatar

Chris Watson cwonrails

View GitHub Profile
@cwonrails
cwonrails / on-jsx.markdown
Created June 11, 2016 17:18 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

@cwonrails
cwonrails / Contract Killer 3.md
Created June 1, 2016 14:36
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@cwonrails
cwonrails / browser.md
Created May 19, 2016 14:24 — forked from defunctzombie/browser.md
browser field spec for package.json
@cwonrails
cwonrails / bs-config.js
Created May 16, 2016 16:13 — forked from Kenty/bs-config.js
browser-sync setting file
/*
|--------------------------------------------------------------------------
| Browser-sync config file
|--------------------------------------------------------------------------
|
| Please report any issues you encounter:
| https://github.com/shakyShane/browser-sync/issues
|
| For up-to-date information about the options:
| https://github.com/shakyShane/browser-sync/wiki/Working-with-a-Config-File
@cwonrails
cwonrails / wsk-watchify.js
Created May 13, 2016 12:33
Hooking up Watchify (Browserify) to Google's Web Starter Kit
/**
*
* Hooking up Watchify with Google's Web Starter Kit
*
* The primary use cases for Browserify/Watchify are:
* - Node.js-style `require`s on the client-side
* - Use of npm modules on the client-side
* - No more new <script> tags for each new script/module
*
* 1. npm install --save-dev vinyl-source-stream browserify watchify gulp-notify
@cwonrails
cwonrails / gulpfile.js
Created May 13, 2016 12:32 — forked from tachun/gulpfile.js
Watchify + Browserify + jade with Google's Web Starter Kit
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
var pagespeed = require('psi');
var reload = browserSync.reload;
@cwonrails
cwonrails / letsencrypt.md
Created May 12, 2016 15:23 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@cwonrails
cwonrails / nginx.conf
Created May 3, 2016 13:44 — forked from louy/nginx.conf
Docker Nginx Config
daemon off;
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@cwonrails
cwonrails / gulpfile.js
Created May 2, 2016 10:13 — forked from isochronous/gulpfile.js
The gulpfile we use for our webapp-in-android-app project
var gulp = require('gulp'),
// Used to process `include` statements in source files
includer = require('gulp-includer'),
// Compiles SASS files using LibSass
sass = require('gulp-sass'),
// Renames files in the file stream
rename = require('gulp-rename'),
// JavaScript minifier
uglify = require('gulp-uglify'),
// Filter files out of the vinyl stream
@cwonrails
cwonrails / nginx-latest.sh
Created April 2, 2016 13:15 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list