Skip to content

Instantly share code, notes, and snippets.

@Geeber
Forked from malarkey/Contract Killer 3.md
Last active January 4, 2016 14:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Geeber/8638257 to your computer and use it in GitHub Desktop.
Save Geeber/8638257 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'json'
CONTRACT_TEMPLATE = "contract_template.md"
vars_file = ARGV.shift
markup_file = ARGV.shift
html_file = ARGV.shift
template_lines = File.readlines(CONTRACT_TEMPLATE)
var_map = JSON.parse(File.read(vars_file))
puts var_map.inspect
def substitute(input, map)
# Extract the first substitution block, if any.
var_name = input.slice(/\{% ([A-Za-z_-]+) %\}/, 1)
# Return the original string if there isn't at least one substitution block.
if var_name.nil?
input
else
puts "substituting for variable '#{var_name}'"
var_value = map[var_name]
if var_value.kind_of?(Array)
substitution = (var_value.map() {|l| "* <u>#{l}</u>\n"}).join()
else
substitution = "<u>" + var_value + "</u>"
end
new_input = input.sub("{% #{var_name} %\}", substitution)
substitute(new_input, map)
end
end
substituted_lines = []
template_lines.each do |line|
substituted_lines << substitute(line, var_map)
end
File.write(markup_file, substituted_lines.join())
html = <<END
<html>
<head>
<title>Freelance Developer Agreement between #{var_map["my-name"]} and #{var_map["client-name"]}</title>
<style>
@media all {
.page-break { display: none; }
}
@media print {
.page-break { display: block; page-break-before: always; }
}
.title {
text-align: center
}
</style>
</head>
<body>
END
html << `perl Markdown_1.0.1/markdown.pl #{markup_file}`
html << <<END
</body>
</html>
END
File.write(html_file, html)

Freelance Developer Agreement

Between me ({% my-name %}) and you ({% client-name %})

Summary:

We'd all like to live in a world where contracts aren't needed and everyone trusts everyone, but we don't. This document attempts to prevent either of us from treating each other unfairly, and to minimize the risk of unpleasant surprises for everyone.

So in short:

You ({% client-name %}), located at {% client-address %} are hiring me ({% my-name %}) to {% project-summary %}. This work will be performed at an hourly rate of ${% hourly-rate %}/hour.

What do both parties agree to do?

You:

  • You have the authority to enter into this contract on behalf of yourself, your company or your organization.
  • You'll endeaver to give me everything I need to complete my assigned tasks, including replying to questions and providing feedback and approval in a timely manner.
  • You understand that failure to do so may impact my ability to complete my tasks on schedule.

Me:

  • I have the experience and ability to do everything we've agreed upon.
  • I am available to work on your project(s) for (at least) the time commitment described below.
  • I'll endeavour to meet any deadlines we set, and report to you as early as possible if I expect to miss one.
  • I understand that failure to meet deadlines may negatively impact your business and may be grounds for terminating this contract.

Details

Services

My work will consist of one or more of the following services, at your direction:

{% services-list %}

I will always keep you informed of both what I'm currently working on and what I'm planning to work on next. At any time you are welcome (and encouraged) to inform me if you would prefer that I re-prioritize my work (or shift to entirely different tasks). Ultimately you are responsible for choosing how I spend my time.

Work relationship

I am performing work on your behalf as a freelance developer. I will work at the time, place, and in the manner of my choosing. I am not an employee of your organization. Glad that's clear. (These things matter to lawyers, apparently.)

Time commitment

I commit to a minimum of {% min-hours %} hours of work on your project(s), to be completed no later than {% min-hours-date %}, unless agreed otherwise in writing.

To avoid surprising you with sudden expenses, I will never bill you for more than {% max-weekly-hours %} hours of work in a given week, unless agreed otherwise in writing.

Additional projects

After the initial time commitment has been met, and if we both agree to it, I may continue to perform the same or additional services on your behalf. We may either negotiate a new time commitment, or extend the contract on a week-by-week basis without any specific commitment. In either case I will continue to provide invoices for hours worked, and you will continue to pay me on schedule.

Termination

This contract may be terminated at any time by either party, for any reason, by providing {% termination-notice-period %} written notice.

I want you to be happy with my work, but if you're not, you are welcome to end this engagement with no penalty. If you terminate the contract, you owe me only for the hours which I've worked up to that point, plus any additional "hand-off" work we agree upon.

I recognize that you are hiring me to perform a complete project end-to-end, and if I leave in the middle you will incur additional costs. If I terminate the contract prior to fulfilling the agreed-upon time commitment, then I will refund you {% early-termination-refund-percent %}% of your total payments to me, calculated based on my hours worked to that point plus any additional "hand-off" work we agree upon.

Technical support

If, following termination of this contract by either party, you require technical support (additional documentation or testing, diagnosing bugs, adding features, etc.) then you may request that work as a new project. I will do my best to make time for this, but please understand that I have other clients and cannot commit to be available for unscheduled work.

Payments

I will provide you with {% invoice-frequency %} invoices detailing my hours worked. Payment is due within {% invoice-deadline %} of receipt of the invoice. Please pay me on time so I can eat!

Legal stuff

Confidentiality

I will assume that all non-public materials that you provide to me are confidential (unless explicitly stated otherwise) and I will not disclose them without your permission.

Liability

I can't guarantee that my work will be error-free and so I can't be liable to you or any third-party for damages, including lost profits, lost savings or other incidental, consequential or special damages, even if you've advised me of them.

Ownership

You guarantee that all elements of text, images or other artwork you may provide to me are either owned by your good selves, or that you've permission to use them. I don't want to get sued.

You will own full rights over any code, documentation, or inventions that I produce as a direct part of completing my assigned tasks. There may be pieces of my work that I would like to release to the public domain to (a) enhance the greater good and/or (b) build my reputation as a developer. In such a case I will ask for your written permission to do so, which you may of course refuse.

But where's all the horrible small print?

If any provision of this contract shall be unlawful, void, or for any reason unenforceable, then that provision shall be deemed severable from this contract and shall not affect the validity and enforceability of any remaining provisions.

Just like a parking ticket, you can't transfer this contract to anyone else without my permission. This contract stays in place and need not be renewed. If for some reason one part of this contract becomes invalid or unenforceable, the remaining parts of it remain in place.

Although the language is simple, the intentions are serious and this contract is a legal document under exclusive jurisdiction of {% jurisdiction %}.

 

The dotted line

Signed by {% my-name %}:

                                                                                    

Date:                                  


Signed on behalf of {% client-name %}:                                                                                       (Sign)                                                                                       (Print)                                                                                       (Title)

Date:                                  

Everyone should sign above and keep a copy for their records.



Adapted from [Contract Killer](http://stuffandnonsense.co.uk/projects/contract-killer/) by [Stuff & Nonsense](http://stuffandnonsense.co.uk/)
{
"my-name":"[my name]",
"client-name":"[client name]",
"client-address":"[client address]",
"project-summary":"[project summary]",
"hourly-rate":"[rate]",
"max-weekly-hours":"40",
"invoice-frequency":"weekly",
"invoice-deadline":"2 weeks",
"termination-notice-period":"5 days'",
"early-termination-refund-percent":"20",
"min-hours":"[min hours]",
"min-hours-date":"[date]",
"services-list":[
"[services]"
],
"jurisdiction":"[jurisdiction]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment