Skip to content

Instantly share code, notes, and snippets.

View appsol's full-sized avatar

Stuart Laverick appsol

View GitHub Profile
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@litzinger
litzinger / 0-Debugging-ExpressionEngine.md
Last active January 26, 2023 20:28
How to show errors when you get a white screen in EE. Turning up the debugging will reveal PHP errors.

Overview

Below are two techniques to help debug the WSOD (white screen of death), usually a 500 server error, in an ExpressionEngine site. The Basic-Debugging option will be suitable in most cases and is specific to ExpressionEngine. The Advanced-Debugging is generic and applicable to any PHP based software. If the basic debugging does not work, try the advanced.

If you get a WSOD you will need to first get your site to reveal an error before reporting it to EllisLab or the add-on developer. Simply reporting "I get a white screen" does not give the developer enough information to assist you. An error message on the other hand will point the developer to the source of the issue.

@wdullaer
wdullaer / install.sh
Last active July 11, 2024 08:59
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@kzar
kzar / dwarf-fortress-ubuntu-installation-instructions.sh
Last active December 8, 2022 05:08
Dwarf Fortress Linux (Ubuntu 15.04) installation instructions. (Nice graphics but no other crap!)
# Install a bunch of dependencies (Might not be everything, sorry!)
sudo apt-get install libsdl1.2debian:i386 libsdl-image1.2:i386\
libsdl-ttf2.0-0:i386 libglu1-mesa:i386 libgtk2.0-0:i386\
libopenal1:i386 libjpeg62:i386 git tar unzip bzip2
# Fetch Dwarf fortress itself (See http://www.bay12games.com/dwarves/ )
mkdir dwarf-fortress && cd dwarf-fortress
wget http://www.bay12games.com/dwarves/df_42_06_linux.tar.bz2
tar xvjf df_42_06_linux.tar.bz2