Skip to content

Instantly share code, notes, and snippets.

@cmalven
cmalven / index.html
Last active April 10, 2024 01:23
Shortest (useful) HTML5 Document
<!-- 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 / cooking-ratios.md
Created January 6, 2015 00:42
Cooking Ratios

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
@cmalven
cmalven / craft-fastly.md
Last active August 12, 2020 22:59
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.
@cmalven
cmalven / cmal-fresh-mac-setup.md
Last active November 17, 2019 19:03
Fresh Mac Setup

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 October 22, 2019 12:59
nginx config for Craft CMS localization
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 October 3, 2018 19:07
Cheat Sheet: Layouts and Rendering in Rails
@cmalven
cmalven / notes-7-min-with-react.js
Created February 6, 2015 19:50
Notes on "7 Minutes with React"
// 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 July 18, 2014 18:21
Browserify Shim with GSAP
TimelineLite = require('timelineLite')
...
myTimeline = new TimelineLite;
// Console outputs "Uncaught TypeError: undefined is not a function"
@cmalven
cmalven / programming_elixir_notes.ex
Created June 25, 2016 13:28
Programming Elixir Notes
# Programming Elixir
## Value Types
# Integers
6
1_000_000
# Floating Point
@cmalven
cmalven / install_php_mongo_mamp_os_x.md
Created August 7, 2015 15:07
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