From 788d133ab093dc5d2d1ddde8da830cd85e5b4daf Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 24 Dec 2011 17:23:40 +0000 Subject: [PATCH] initial import --- .gitignore | 2 ++ Cakefile | 21 +++++++++++++++++++++ app.bak.js | 35 +++++++++++++++++++++++++++++++++++ app.js | 36 ++++++++++++++++++++++++++++++++++++ package.json | 10 ++++++++++ public/css/style.css | 29 +++++++++++++++++++++++++++++ public/images/heartb.it.png | Bin 0 -> 3353 bytes routes/index.bak.js | 7 +++++++ src/app.coffee | 35 +++++++++++++++++++++++++++++++++++ views/ga.coffee | 6 ++++++ views/index.coffee | 5 +++++ views/layout.coffee | 11 +++++++++++ 12 files changed, 197 insertions(+) create mode 100644 .gitignore create mode 100644 Cakefile create mode 100644 app.bak.js create mode 100644 app.js create mode 100644 package.json create mode 100644 public/css/style.css create mode 100644 public/images/heartb.it.png create mode 100644 routes/index.bak.js create mode 100644 src/app.coffee create mode 100644 views/ga.coffee create mode 100644 views/index.coffee create mode 100644 views/layout.coffee diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9daa824 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules diff --git a/Cakefile b/Cakefile new file mode 100644 index 0000000..37592b7 --- /dev/null +++ b/Cakefile @@ -0,0 +1,21 @@ +fs = require 'fs' +{print} = require 'sys' +{spawn, exec} = require 'child_process' + +build = (watch, callback) -> + if typeof watch is 'function' + callback = watch + watch = false + options = ['-c', '-o', '.', 'src'] + options.unshift '-w' if watch + + coffee = spawn 'coffee', options + coffee.stdout.on 'data', (data) -> print data.toString() + coffee.stderr.on 'data', (data) -> print data.toString() + coffee.on 'exit', (status) -> callback?() if status is 0 + +task 'build', 'Compile CoffeeScript source files', -> + build() + +task 'watch', 'Recompile CoffeeScript source files when modified', -> + build true diff --git a/app.bak.js b/app.bak.js new file mode 100644 index 0000000..7574676 --- /dev/null +++ b/app.bak.js @@ -0,0 +1,35 @@ + +/** + * Module dependencies. + */ + +var express = require('express') + , routes = require('./routes') + +var app = module.exports = express.createServer(); + +// Configuration + +app.configure(function(){ + app.set('views', __dirname + '/views'); + app.set('view engine', 'jade'); + app.use(express.bodyParser()); + app.use(express.methodOverride()); + app.use(app.router); + app.use(express.static(__dirname + '/public')); +}); + +app.configure('development', function(){ + app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); +}); + +app.configure('production', function(){ + app.use(express.errorHandler()); +}); + +// Routes + +app.get('/', routes.index); + +app.listen(3000); +console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); diff --git a/app.js b/app.js new file mode 100644 index 0000000..3503b9c --- /dev/null +++ b/app.js @@ -0,0 +1,36 @@ +(function() { + var app, express; + + express = require('express'); + + app = module.exports = express.createServer(); + + app.configure(function() { + app.set('views', __dirname + '/views'); + app.set('view engine', 'coffee'); + app.register('.coffee', require('coffeekup').adapters.express); + app.use(express.bodyParser()); + app.use(express.methodOverride()); + return app.use(express.static(__dirname + '/public')); + }); + + app.configure('development', function() { + return app.use(express.errorHandler({ + dumpExceptions: true, + showStack: true + })); + }); + + app.configure('production', function() { + return app.use(express.errorHandler); + }); + + app.get('/', function(req, res) { + return res.render('index'); + }); + + app.listen(3000); + + console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); + +}).call(this); diff --git a/package.json b/package.json new file mode 100644 index 0000000..f213a53 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "api.jimeh.me", + "version": "0.0.1", + "private": true, + "dependencies": { + "express": "2.5.0", + "coffee-script": ">= 0.0.0", + "coffeekup": ">= 0.0.0" + } +} diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..ca26ec8 --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,29 @@ +body { + font-family: helvetica, arial, sans-serif; + padding: 0; + margin: 0; +} + +#logo { + background: url("../images/heartb.it.png") center center no-repeat; + position: absolute; + top: 50%; + left: 50%; + margin: -15px 0px 0px -75px; + height: 30px; + width: 150px; +} + +#contact { + font-size: 12px; + position: absolute; + right: 8px; + bottom: 5px; +} + #contact a { + color: #aaa; + text-decoration: none; + } + #contact a:hover { + text-decoration: underline; + } \ No newline at end of file diff --git a/public/images/heartb.it.png b/public/images/heartb.it.png new file mode 100644 index 0000000000000000000000000000000000000000..f12f26727317174d5d43b20ea34dd5ba88081f80 GIT binary patch literal 3353 zcmV+!4d(KRP)uDUBVU7l2H&x54De9-^{m1<8|K9uF`&*!zlc}2f6=S5B z0pTZESy{t|4NFK!XlrYG^wH>scH-m>*ngt<7FE;SixDvL=UYMyVRVF0EENn056R5T zyl0k@l9E}oW1{ACFH175juB`GN>BO`;RX*=r~Koto2W3}O5=Zw2A z@KF{Dg*J`e3yR1#%@JUoR)Dr$2&Sc_<>cg~r>6t%2TbUEL;nZ9NHl%4eESQmE!QOA zi=VQq)7sj~HJY27yMK!f7>)zf!@vJ^kt`oC3im_Dk92snP}HU|fWqG&{vF%Tb!;Bk zzK1Rp`JIwF3-}}w2`@)#YU-fM8cg+V0wXQ-kf0&nXrzBnnXZ7Ofo0LxnwWOI07sEP zPb|tG@%88lO=L`WRi?Y`CY4^m2oMhm41xp>;??y|8{)5k0Aux(psA`Rrcn()2N~+l zJ!7;4OawWVnH-W#htbx>y5oFi)M~XwMMXe2Zr!>?lBA!XUsP1o)TvX0f`VN3t*)+y zzSE~q4+#meS}#GIJ9iF7v&6#l=g(sp)|DGaMn+;bzg)NNII*vc(UDfC;ISe2YvZKv z#tX!#%LPG}YTS9&@O24Y)nv67Zn${flhTz_(6FH{tY3VK$p4i*SwmO<2ANZr(2qj? zgfEH4UwK+67dz@s9KEVp_MLQ1g7m$~olDXf4gWl2{O$s`BvHcS9{I1cn)}POEAttc z!p!E4|GsFHxK$o zL`0O9mUhKiN=nL(9Xq-zuUogyrh9B`EcW26NvJcm9gDv;wP?_AU(wVMG{_4a3mBFB zrItEdr(1i3Jbv9Rdnw}O<}6jc*`j%K4^>iU=31emaU+F8-53o)SKcRoxDK009K0<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&kywM@6x5^?w5}yXF}ky{oqI+UBsBcTtRi;_bU4M&>n1ox4dfwk}9cV z?I%Xvvy$2Jg8e9pLORc8^bEtA&~X}oc*^?Qge@&CJT)~M4QD)=OePkKe|IK?ECLM} zWU6Zwph7g*tJmWgcKpI6jt=c-U8&)9`Ou$IR#wJk_b#QfvXX1~`ucK-eBUP(k9rWI z*;*QT^jhzSAZY3WnnRFtr#Nh-Z@Us>P7itI7hShZ@^jT<+dITwOR zNl7sp+0-a9GIH9qX}zgNJ-G63kD(x}!f&(Uu^&Z5maDoEargF`?Z zsBi*h=-#n3+n8G}niA570S}AxhxC*zsdZ9x?JirkYzYkwt*NP*GG)rjl`DbWK+Y#H zSEcXVxs#chId0szyu3V4dG+emJh@MIf$_PmoB-dTNV5hO*YUjlhbXV!g3wN{|kFl3W(pCD;PaBU`viD7IbOiFy4=5i->yz`b92`+foyh; zN3X&MvPSkL7er`k)^bD%2^i#-oh)7uN#s?SS&hkI35o6*LS-9fn(Esi3TWTS)q_|ro}uEq5y@bPMrb^<>%)EJH2_+7R159!5cSj1b1qAQd?V_o}RvI z*DlU-kYjL{y&{navPQdW^YZfAvuDrZ#f!O%UxUF=Ute#j*r6NNtP{nKU@xzEyuZcL zMI9-5H5T!9Si3^QeDS3*XoxpEpq^r@Vrqj>CPpLt@I_zq+UC`QrYgT=GLrD@ZU0IPSd!otD;7Kw?8$;rupJWo$g*xdN|cmM}?1rIg` zXvW3GrKP29-@ZL2#_Ih9wOU?)uGvnUh_I5%K*Z*Ol{ j#=?aQKmPdR{|GPuFV-v%{+^xK00000NkvXXu0mjf+`xAj literal 0 HcmV?d00001 diff --git a/routes/index.bak.js b/routes/index.bak.js new file mode 100644 index 0000000..1dfd01d --- /dev/null +++ b/routes/index.bak.js @@ -0,0 +1,7 @@ +/* + * GET home page. + */ + +exports.index = function(req, res){ + res.render('index', { title: 'Express' }) +}; \ No newline at end of file diff --git a/src/app.coffee b/src/app.coffee new file mode 100644 index 0000000..ae4074d --- /dev/null +++ b/src/app.coffee @@ -0,0 +1,35 @@ +# Module Dependencies + +express = require 'express' +# routes = require './routes' + +app = module.exports = express.createServer() + + +# Configuration +app.configure -> + app.set 'views', __dirname + '/views' + app.set 'view engine', 'coffee' + app.register '.coffee', require('coffeekup').adapters.express + app.use express.bodyParser() + app.use express.methodOverride() + # app.use app.router + app.use express.static(__dirname + '/public') + +app.configure 'development', -> + app.use express.errorHandler(dumpExceptions: true, showStack: true) + +app.configure 'production', -> + app.use express.errorHandler + + +# Routes +app.get '/', (req, res) -> + res.render 'index' + + +# Set port and start server. +app.listen 3000 + +console.log "Express server listening on port %d in %s mode", + app.address().port, app.settings.env diff --git a/views/ga.coffee b/views/ga.coffee new file mode 100644 index 0000000..54b135d --- /dev/null +++ b/views/ga.coffee @@ -0,0 +1,6 @@ +script ''' + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +''' +script ''' + try {var pageTracker = _gat._getTracker("UA-354018-12");pageTracker._trackPageview();} catch(err) {} +''' \ No newline at end of file diff --git a/views/index.coffee b/views/index.coffee new file mode 100644 index 0000000..dbbb622 --- /dev/null +++ b/views/index.coffee @@ -0,0 +1,5 @@ +div id: 'logo' +div id: 'contact', -> + script ''' + document.write("pbagnpg\100urnego\056vg<\057n>".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);})); + ''' \ No newline at end of file diff --git a/views/layout.coffee b/views/layout.coffee new file mode 100644 index 0000000..d2e2674 --- /dev/null +++ b/views/layout.coffee @@ -0,0 +1,11 @@ +doctype 5 +html -> + head -> + meta charset: 'utf-8' + + title 'heartb.it' + link rel: 'stylesheet', href: 'css/style.css' + + body -> + @body + partial 'ga'