Skip to content

Instantly share code, notes, and snippets.

View dwayne's full-sized avatar

Dwayne Crooks dwayne

View GitHub Profile
@dwayne
dwayne / ch1.md
Last active January 2, 2024 13:22
My notes from the book "Crafting Rails 4 Applications by José Valim"

Chapter 1 - Creating Our Own Renderer

Rails provides an API that we can use to create our own renderers. In this chapter we explore the API as we modify the render() method to accept :pdf as an option and return a PDF created with Prawn.

To create a new plugin just run the following:

$ rails plugin new my_plugin

TODO Complete notes

@dwayne
dwayne / steps.md
Last active November 9, 2017 15:33
How to setup the SeeingIsBelieving Plugin for Sublime Text 2 on Ubuntu 13.04

Firstly, you've got to see it to believe it. Then, when you're all excited follow the steps below to set it up as a plugin for Sublime Text 2 on Ubuntu 13.04.

Using Git

  1. $ rvm 2.0.0@sublime-text-2 --create
  2. $ gem install seeing_is_believing
  3. $ cd ~/.config/sublime_text_2/Packages
  4. $ git clone git://github.com/JoshCheek/sublime-text-2-seeing-is-believing.git SeeingIsBelieving

Fix Settings (I use RVM)

@dwayne
dwayne / horizontal-list-span-width.scss
Last active May 19, 2021 03:01
How to make a horizontal list span the width of its container element
// Thanks to CSS Tricks for the inspiration: http://css-tricks.com/equidistant-objects-with-css/
@mixin horizontal-list-span-width {
margin: 0;
padding: 0;
list-style-type: none;
text-align: justify;
&:after {
@dwayne
dwayne / steps.md
Last active March 9, 2020 10:01
How to install Ruby on Rails + MySQL + Apache with Passenger on Ubuntu

Introduction

This guide currently uses Ruby 1.9.3, Rails 3.2 and Ubuntu 13.04 (Raring Ringtail). I started off with a fresh install of Ubuntu on a virtual machine.

Step 1: Install Ruby

  1. Install RVM. See http://rvm.io/rvm/install for all the details.

     $ sudo apt-get install curl
    

$ \curl -L https://get.rvm.io | bash -s stable

@dwayne
dwayne / web-performance.md
Last active December 23, 2015 06:29
Web Performance Resources

Web Performance

@dwayne
dwayne / ch1.md
Last active December 2, 2024 19:32
My notes from the book "Eloquent Ruby by Russ Olsen"

Chapter 1

Every programming community quickly converges on a style, an accepted set of idioms. Programming is all about communication and knowing those idioms are key to being a successful programmer in that community.

Ruby style of programming:

  • Code should be crystal clear, it should shout its intent
  • Good code is also concise

Ruby indentation convention:

@dwayne
dwayne / prance.sh
Created September 10, 2013 23:22 — forked from sj26/prance.sh
echo "\e[1m\e[34m ,%%%, \e[0m"
echo "\e[1m\e[34m ,%%%` %==-- \e[0m"
echo "\e[1m\e[34m ,%%`( '| \e[0m"
echo "\e[1m\e[34m ,%%@ /\_/ \e[0m"
echo "\e[1m\e[34m ,%.-\"\"\"--%%% \"@@__ \e[0m"
echo "\e[1m\e[34m %%/ |__`\ \e[0m"
echo "\e[1m\e[34m .%'\ | \ / // \e[0m"
echo "\e[1m\e[34m ,%' > .'----\ | [/ \e[0m"
echo "\e[1m\e[34m < <<` || \e[0m"
echo "\e[1m\e[34m `\\\ || \e[0m"
@dwayne
dwayne / ch0.md
Last active August 9, 2020 07:57
My notes from the book "Working with TCP Sockets by Jesse Storimer"

Chapter 0

Network programming is ultimately about sharing and communication.

Audience: Ruby devs on Unix or Unix-like systems.

Uses Ruby 1.9.

Part 1 - Introduction to the primitives of Socket programming

@dwayne
dwayne / README.md
Created June 23, 2013 10:40 — forked from eric1234/README.md
A better way of doing layouts in PHP

Usage

Creating a Layout File

Create a file called layout.php. Where you want the content to appear add <?php echo $content ?>. Here is an example:

<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">