Skip to content

Instantly share code, notes, and snippets.


Chris Malven cmalven

View GitHub Profile
cmalven / index.html
Last active Nov 7, 2020
Shortest (useful) HTML5 Document
View index.html
<!-- -->
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<p>I'm the content</p>
cmalven /
Last active Aug 12, 2020
Integrating Craft with Fastly

Running a Craft site on Fastly

Fastly is essentially Varnish as a service. Similarly to how Heroku drastically simplifies the running of a web server, Fastly simplifies full-page caching of websites with running with dynamic content.

How Fastly Works

In a nutshell:

  • Every time there is a request for your website, it is routed through Fastly instead of directly to your backend.
  • If Fastly has an existing cache for the requested URL, it serves the cached page and your backend isn't touched at all.

Cooking Ratios

All ratios should be measure by weight using a kitchen scale.


  • Bread = 5 parts flour : 3 parts water (plus yeast and salt)
  • Pasta Dough = 3 parts flour : 2 parts egg
  • Pie Dough = 3 parts flour : 2 parts fat : 1 part water
  • Biscuit = 3 parts flour : 1 part fat : 2 parts liquid

New Computer Setup

Last tested using Mac OS X 10.8 Mountain Lion

Setup Dropbox

Copy Dropbox folder from previous drive to user folder

cmalven / craft-localization-nginx
Last active Oct 22, 2019
nginx config for Craft CMS localization
View craft-localization-nginx
server {
listen 80;
root /home/forge/;
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript image/svg+xml text/xml text/css;
cmalven /
Last active Oct 3, 2018
Cheat Sheet: Layouts and Rendering in Rails
cmalven / notes-7-min-with-react.js
Created Feb 6, 2015
Notes on "7 Minutes with React"
View notes-7-min-with-react.js
// React JS Notes
// All of the following uses JSX compiling, without JSX the HTML-style syntax isn't possible.
// See this as a reference:,js,output
// The basic unit of React is a "component", created like so...
var React = require('react');
var Component = React.createClass({
render: function() {
cmalven / module.js
Created Jul 18, 2014
Browserify Shim with GSAP
View module.js
TimelineLite = require('timelineLite')
myTimeline = new TimelineLite;
// Console outputs "Uncaught TypeError: undefined is not a function"
View programming_elixir_notes.ex
# Programming Elixir
## Value Types
# Integers
# Floating Point
cmalven /
Created Aug 7, 2015
Installing Mongo PHP extension for MAMP on Mac OS X

Open your .bashrc or .zshrc file and add:

# Mamp PHP Path
export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH

The version number here should correspond to the version you're using in MAMP.

Next, open /Applications/MAMP/bin/php/php5.6.10 and add a folder called include and within that a folder called php

You can’t perform that action at this time.