Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Malven cmalven

View GitHub Profile
@cmalven
cmalven / index.html
Last active Nov 7, 2020
Shortest (useful) HTML5 Document
View index.html
<!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ -->
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
</head>
<body>
<p>I'm the content</p>
@cmalven
cmalven / craft-fastly.md
Last active Aug 12, 2020
Integrating Craft with Fastly
View craft-fastly.md

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.
View cooking-ratios.md

Cooking Ratios

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

Doughs

  • 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
View cmal-fresh-mac-setup.md

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
cmalven / craft-localization-nginx
Last active Oct 22, 2019
nginx config for Craft CMS localization
View craft-localization-nginx
server {
listen 80;
server_name site.production.designcompany.com;
root /home/forge/site.production.designcompany.com/public;
# 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
cmalven / cheatsheet-layout-rendering-rails.md
Last active Oct 3, 2018
Cheat Sheet: Layouts and Rendering in Rails
View cheatsheet-layout-rendering-rails.md
@cmalven
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: http://jsbin.com/falicahequ/1/edit?html,js,output
// The basic unit of React is a "component", created like so...
var React = require('react');
var Component = React.createClass({
render: function() {
@cmalven
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
6
1_000_000
# Floating Point
@cmalven
cmalven / install_php_mongo_mamp_os_x.md
Created Aug 7, 2015
Installing Mongo PHP extension for MAMP on Mac OS X
View install_php_mongo_mamp_os_x.md

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.