Skip to content

Instantly share code, notes, and snippets.

View mwpastore's full-sized avatar

Mike Pastore mwpastore

  • Chicago, Illinois
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@mwpastore
mwpastore / controllers.application.js
Created April 23, 2017 16:32
ember-composable-helpers#263
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
receivedArg: null,
save(arg) {
return this.set('receivedArg', `-->${arg}<--`);
}
@mwpastore
mwpastore / mwpastore_week2.erl
Last active March 7, 2017 03:51
FutureLearn — Functional Programming in Erlang — Week 2
-module(mwpastore_week2).
-export([
shunt/2, reverse/1,
join/2, concat/1,
member/2,
msort/1, qsort/1, isort/1,
perms/1
]).
shunt([], Ys) -> Ys;
@mwpastore
mwpastore / mwpastore_week1.erl
Created March 4, 2017 00:29
FutureLearn — Functional Programming in Erlang — Week 1
-module(mwpastore_week1).
-export([area/1, perimeter/1, enclose/1, bits/1]).
area({square, L}) ->
L * L;
area({rectangle, H, W}) ->
H * W;
area({circle, R}) ->
math:pi() * R * R;
area({triangle, A, B, C}) ->
- apt_key:
url: https://repo.varnish-cache.org/GPG-key.txt
- apt_repository:
repo: deb https://repo.varnish-cache.org/ubuntu/ {{ ansible_distribution_release }} varnish-4.1
filename: varnish-cache
- apt:
update_cache: yes
name: varnish
test.os.lower() = linux test.database_os.lower() = linux
self.results['frameworks'] != None: True
test.name: sinatra-sequel-postgres-passenger-mri
self.results['completed']: {}
================================================================================
Beginning sinatra-sequel-postgres-passenger-mri
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Starting sinatra-sequel-postgres-passenger-mri
--------------------------------------------------------------------------------
@mwpastore
mwpastore / 00README.md
Last active March 30, 2026 14:53
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM

README

This gist assumes you are migrating an existing site for www.example.com — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).

Quickstart: Use your own naked and canonical domain names instead of example.com and www.example.com and customize the Caddyfile and VCL provided in this gist to your preferences!

These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)

@mwpastore
mwpastore / .env
Last active October 1, 2016 21:36
Mailgun delivery method for Ruby Mail gem
MAILGUN_DOMAIN=sandboxwhatevs.mailgun.org
MAILGUN_API_KEY=key-whatevs

Keybase proof

I hereby claim:

  • I am mwpastore on github.
  • I am mwp (https://keybase.io/mwp) on keybase.
  • I have a public key ASB0_zpx5r3l4WAJjekRQSX-c28UMvN4twlq6XzVUd92dwo

To claim this, I am signing this object:

@mwpastore
mwpastore / ember-cli-deploy-mysql-sinatra.rb
Last active February 25, 2016 17:21
Sinatra example for ember-cli-deploy-mysql
require 'sinatra'
require 'sequel'
require 'mysql2'
configure do
# Define your database, table, and revision preview query parameter here!
set :database, Sequel.connect ENV.fetch('DATABASE_URL')
set :table, :foo_bootstrap
set :param_key, 'preview'
end