Skip to content

Instantly share code, notes, and snippets.

@jpallen
jpallen / foo.txt
Created June 25, 2015 13:27
Test gist
Hello world 2
\documentclass{my_cv}
\begin{document}
\section{Education}
\subsection{University of Nowhere}
\section{Work}
\subsection{ABC Limited.}
\LoadClass{article}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{my_cv}[2011/03/26 My custom CV class]
\RequirePackage{titlesec}
\titleformat{\section} % Customise the \section command
{\Large\scshape\raggedright} % Make the \section headers large (\Large),
% small capitals (\scshape) and left aligned (\raggedright)
{}{0em} % Can be used to give a prefix to all sections, like 'Section ...'
{} % Can be used to insert code before the heading
[\titlerule] % Inserts a horizontal line after the heading
\titleformat{\subsection}
{\large\scshape\raggedright}
{}{0em}
{}
\newcommand{\datedsection}[2]{%
\section[#1]{#1 \hfill #2}%
}
\newcommand{\datedsubsection}[2]{%
\subsection[#1]{#1 \hfill #2}%
}
\documentclass{my_cv}
\begin{document}
\section{Education}
\datedsubsection{University of Nowhere}{2004--2008}
I attended the University of Nowhere from 2004 to 2008.
\section{Work}
\datedsubsection{ABC Limited.}{2008--Now}
@jpallen
jpallen / gist:2762417
Created May 21, 2012 13:49
Add a .findOrBuild() method to Backbone Models
// Finding and creating models
// ===========================
//
// We might need to get a reference to a model from anywhere in our code
// and we want to make sure that these references all point to the same model.
// Otherwise updates to one copy of the model won't affect another.
//
// The methods here let you get models through a wrapper that will either
// create the model if it doesn't exist anywhere, or return a reference to
// the existing model. E.g.