mirror of
https://github.com/jimeh/heartb.it.git
synced 2026-02-19 04:46:40 +00:00
initial import
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
21
Cakefile
Normal file
21
Cakefile
Normal file
@@ -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
|
||||
35
app.bak.js
Normal file
35
app.bak.js
Normal file
@@ -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);
|
||||
36
app.js
Normal file
36
app.js
Normal file
@@ -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);
|
||||
10
package.json
Normal file
10
package.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
29
public/css/style.css
Normal file
29
public/css/style.css
Normal file
@@ -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;
|
||||
}
|
||||
BIN
public/images/heartb.it.png
Normal file
BIN
public/images/heartb.it.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
7
routes/index.bak.js
Normal file
7
routes/index.bak.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* GET home page.
|
||||
*/
|
||||
|
||||
exports.index = function(req, res){
|
||||
res.render('index', { title: 'Express' })
|
||||
};
|
||||
35
src/app.coffee
Normal file
35
src/app.coffee
Normal file
@@ -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
|
||||
6
views/ga.coffee
Normal file
6
views/ga.coffee
Normal file
@@ -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) {}
|
||||
'''
|
||||
5
views/index.coffee
Normal file
5
views/index.coffee
Normal file
@@ -0,0 +1,5 @@
|
||||
div id: 'logo'
|
||||
div id: 'contact', ->
|
||||
script '''
|
||||
document.write("<n uers=\\"znvygb:pbagnpg\100urnego\056vg\\">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);}));
|
||||
'''
|
||||
11
views/layout.coffee
Normal file
11
views/layout.coffee
Normal file
@@ -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'
|
||||
Reference in New Issue
Block a user