summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--code/templates/Makefile_cpp28
-rw-r--r--code/templates/gitignore8
-rwxr-xr-xcode/templates/script.py67
-rw-r--r--code/templates/single.html49
4 files changed, 152 insertions, 0 deletions
diff --git a/code/templates/Makefile_cpp b/code/templates/Makefile_cpp
new file mode 100644
index 0000000..2edcbbf
--- /dev/null
+++ b/code/templates/Makefile_cpp
@@ -0,0 +1,28 @@
+# C++ template Makefile for small projects with gmake
+#
+# Chose a program name (PROGRAM) and add all the .cpp files (not .h) to #
+# CXX_SRCS. Run `make depends` and paste # the output of that command at the
+# bottom and then run `make` to generate an executable.
+#
+# From http://homepages.gac.edu/~mc38/2001J/documentation/gmake.html
+PROGRAM = rename_me
+LOADLIBES =
+CXX_SRCS = main.cpp
+CXX = g++
+CXXFLAGS = -g -Wall -fno-builtins
+CC = gcc
+LDFLAGS = -g
+OBJS = $(CXX_SRCS:.cpp=.o)
+
+$(PROGRAM) : $(OBJS)
+ $(CXX) $(LDFLAGS) $(OBJS) $(LOADLIBES) -o $(PROGRAM)
+
+clean:
+ /bin/rm -qf *.o $(PROGRAM) *~
+
+depend:
+ $(CXX) -MM $(CXX_SRCS)
+
+###
+# <DEPENDENCIES ON .h FILES GO HERE>
+
diff --git a/code/templates/gitignore b/code/templates/gitignore
new file mode 100644
index 0000000..f466019
--- /dev/null
+++ b/code/templates/gitignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.pyc
+*~
+*.swp
+.*
+*.tmp
+*.old
diff --git a/code/templates/script.py b/code/templates/script.py
new file mode 100755
index 0000000..dccf20e
--- /dev/null
+++ b/code/templates/script.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+"""
+SYNOPSIS
+
+ TODO helloworld [-h,--help] [-v,--verbose] [--version]
+
+DESCRIPTION
+
+ TODO This describes how to use this script. This docstring
+ will be printed by the script if there is an error or
+ if the user requests help (-h or --help).
+
+EXAMPLES
+
+ TODO: Show some examples of how to use this script.
+
+EXIT STATUS
+
+ TODO: List exit codes
+
+AUTHOR
+
+ TODO: Name <name@example.org>
+
+LICENSE
+
+ This script is in the public domain, free from copyrights or restrictions.
+
+VERSION
+
+ $Id$
+"""
+
+import sys, os, traceback, optparse
+import time
+import re
+#from pexpect import run, spawn
+
+def main ():
+
+ global options, args
+ # TODO: Do something more interesting here...
+ print 'Hello world!'
+
+if __name__ == '__main__':
+ try:
+ start_time = time.time()
+ parser = optparse.OptionParser(formatter=optparse.TitledHelpFormatter(), usage=globals()['__doc__'], version='$Id$')
+ parser.add_option ('-v', '--verbose', action='store_true', default=False, help='verbose output')
+ (options, args) = parser.parse_args()
+ #if len(args) < 1:
+ # parser.error ('missing argument')
+ if options.verbose: print time.asctime()
+ main()
+ if options.verbose: print time.asctime()
+ if options.verbose: print 'TOTAL TIME IN MINUTES:',
+ if options.verbose: print (time.time() - start_time) / 60.0
+ sys.exit(0)
+ except KeyboardInterrupt, e: # Ctrl-C
+ raise e
+ except SystemExit, e: # sys.exit()
+ raise e
+ except Exception, e:
+ print 'ERROR, UNEXPECTED EXCEPTION'
+ print str(e)
+ traceback.print_exc()
+ os._exit(1)
diff --git a/code/templates/single.html b/code/templates/single.html
new file mode 100644
index 0000000..9feb00e
--- /dev/null
+++ b/code/templates/single.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head><title>[[[title]]]</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+<style type="text/css">
+.error {padding: 15px; background-color: yellow; border: 4px solid orange; color:red;}
+table {border: 1px solid black; border-collapse: collapse; border-spacing:2px;}
+th, td {border-width: 1px; border-style: inset; border-color: gray; padding: 2px;}
+dt {font-weight: bold;}
+.code {color: white; background-color: black; border: 3px gray solid;
+ width: 640px; padding: 3px; margin-left: 10px;}
+</style>
+</head>
+<body style="margin: 25px; font-family: helvetica;">
+<a name="top"><h1 style="border-bottom: 2px solid; margin-bottom: 2px;">
+[[[title]]]</h1></a>
+<i style="font-size:smaller;">
+<a href="#sec1">[[[sec1]]]</a> -
+<a href="#sec2">[[[sec2]]]</a>
+Last updated [[[when]]] by [[[who]]]
+</i><br>
+<p>
+
+<a name="sec1"><h2>Section One</h2></a>
+
+<ul>
+ <li>lorem<ul>
+ <li>one
+ <li>two
+ </ul>
+ <li>ipsum<ul>
+ <li>three
+ <li>four
+ </ul>
+</ul>
+
+<a name="sec2"><h2>Section Two</h2>
+
+<p>
+<b>Something:</b> definition lorem ipsum lorem ipsum lorem ipsum lorem ipsum
+lorem ipsum lorem ipsum lorem ipsum
+
+<p>
+<b>Something:</b> definition lorem ipsum lorem ipsum lorem ipsum lorem ipsum
+lorem ipsum lorem ipsum lorem ipsum
+
+</body></html>
+