From aeb73eaf4b377a55b5850b051a906d26f1bc8b43 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 26 Jun 2011 14:50:51 -0400 Subject: new templates --- code/templates/Makefile_cpp | 28 +++++++++++++++++++ code/templates/gitignore | 8 ++++++ code/templates/script.py | 67 +++++++++++++++++++++++++++++++++++++++++++++ code/templates/single.html | 49 +++++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 code/templates/Makefile_cpp create mode 100644 code/templates/gitignore create mode 100755 code/templates/script.py create mode 100644 code/templates/single.html 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) + +### +# + 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 + +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 @@ + + +[[[title]]] + + + + +

+[[[title]]]

+ +[[[sec1]]] - +[[[sec2]]] +Last updated [[[when]]] by [[[who]]] +
+

+ +

Section One

+ +
    +
  • lorem
      +
    • one +
    • two +
    +
  • ipsum
      +
    • three +
    • four +
    +
+ +

Section Two

+ +

+Something: definition lorem ipsum lorem ipsum lorem ipsum lorem ipsum +lorem ipsum lorem ipsum lorem ipsum + +

+Something: definition lorem ipsum lorem ipsum lorem ipsum lorem ipsum +lorem ipsum lorem ipsum lorem ipsum + + + -- cgit v1.2.3