Skip to content

Instantly share code, notes, and snippets.

@memetical
memetical / Person2.rb
Created October 31, 2012 23:30 — forked from anonymous/Person2
rubyEx2
class Person
attr_accessor :name, :hobbies
def initialize(params)
params.each_key {|key|
begin
self.send("#{key}=".to_sym, params[key])
rescue
raise UnknownAttributeError
end
@memetical
memetical / ex3.rb
Created October 31, 2012 18:53 — forked from anonymous/ex3
exercise3
# Exercise: write a proc that provides content for the following html template:
def template
template =<<DELIM
<html>
<head>
#{yield :header}
</head>
<body>
#{yield}
<hr>
@memetical
memetical / latex.template
Created February 12, 2012 23:27 — forked from michaelt/latex.template
Simple Pandoc default.latex with comments
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.