convert to static

This commit is contained in:
Tommy Parnell
2015-08-19 00:51:53 -04:00
parent 51027512bc
commit 084923a027
39 changed files with 41417 additions and 224 deletions

View File

@@ -1,4 +1,4 @@
{
"directory": "public/components",
"directory": "components",
"json": "bower.json"
}

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ public/dist
public/components
.idea/
.settings/
components/

10
app.js
View File

@@ -1,10 +0,0 @@
var express = require('express'),
config = require('./config/config');
var app = express();
require('./config/express')(app, config);
app.listen(process.env.PORT || config.port);

View File

@@ -1,48 +0,0 @@
var express = require('express'),
router = express.Router(),
UntappdClient = require("node-untappd"),
moment = require("moment"),
_ = require("underscore"),
cache = require('memory-cache');
module.exports = function (app) {
app.use('/', router);
};
router.get('/', function (req, res, next) {
if(process.env.untappdkey == undefined
|| process.env.untappdkey == null
|| process.env.untappdsecret == undefined
|| process.env.untappdsecret == null ){
return res.render('index',{});
}
var cacheCheck = cache.get('checkin');
if(cacheCheck != null){
return res.render('index', {beer:cacheCheck});
}
var untappd = new UntappdClient(false);
untappd.setClientId(process.env.untappdkey);
untappd.setClientSecret(process.env.untappdsecret);
untappd.userFeed(function(err,obj){
if((err != undefined && err != null) || obj.response.checkins.items.length < 1){
return res.render('index', {});
}
var validCheckin = null;
obj.response.checkins.items.forEach(function(checkin){
console.log(checkin);
if(validCheckin == null){
var checkinTime = moment.utc(checkin.created_at);
var now = moment.utc().add(-3, 'hours');
if(checkinTime > now){
validCheckin = checkin.beer.beer_name;
}
}
});
cache.put('checkin', validCheckin, 600000)
res.render('index', {beer: validCheckin})
},"tparnell");
});

View File

View File

@@ -1,31 +0,0 @@
var path = require('path'),
rootPath = path.normalize(__dirname + '/..'),
env = process.env.NODE_ENV || 'development';
var config = {
development: {
root: rootPath,
app: {
name: 'about.tommyparnell'
},
port: 3000,
},
test: {
root: rootPath,
app: {
name: 'about.tommyparnell'
},
port: 3000,
},
production: {
root: rootPath,
app: {
name: 'about.tommyparnell'
},
port: 3000,
}
};
module.exports = config[env];

View File

@@ -1,37 +0,0 @@
var express = require('express');
var glob = require('glob');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var compress = require('compression');
var methodOverride = require('method-override');
var vash = require('vash');
module.exports = function(app, config) {
app.set('views', config.root + '/app/views');
app.set('view engine', 'vash');
var env = process.env.NODE_ENV || 'development';
app.locals.ENV = env;
app.locals.ENV_DEVELOPMENT = env == 'development';
// app.use(favicon(config.root + '/public/img/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(cookieParser());
app.use(compress());
app.use(express.static(config.root + '/public'));
app.use(methodOverride());
var controllers = glob.sync(config.root + '/app/controllers/*.js');
controllers.forEach(function (controller) {
require(controller)(app);
});
};

41356
css/bundle.css Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -108,7 +108,7 @@ IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
:: 4. Install gulp
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
pushd "%DEPLOYMENT_TARGET%"
call :ExecuteCmd !NPM_CMD! install gulp gulp-cache-bust gulp-concat-css gulp-uglify
call :ExecuteCmd !NPM_CMD! install gulp gulp-cache-bust gulp-concat-css gulp-uglify html-minifier
call .\node_modules\.bin\gulp publish
IF !ERRORLEVEL! NEQ 0 goto error
popd

View File

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 280 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -5,28 +5,43 @@ var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
uglify = require('gulp-uglify'),
cachebust = require('gulp-cache-bust'),
minifyCss = require('gulp-minify-css');
minifyCss = require('gulp-minify-css'),
minify = require('html-minifier').minify,
fs = require("fs");
gulp.task('watch', function() {
gulp.watch('./public/css/*.less', ['less']);
gulp.watch('./public/css/*.css', ['combineCss']);
gulp.watch('./css/*.less', ['less']);
gulp.watch('./css/*.css');
});
gulp.task('combineCss', function(){
return gulp.src('./public/css/*.css')
return gulp.src('./css/*.css')
.pipe(concatCss("bundle.css"))
.pipe(gulp.dest('public/css'));
.pipe(gulp.dest('css'));
});
gulp.task('minifyHtml',function(){
var fileContent=fs.readFileSync("index.html", "utf8");
var fileContent2 = minify(fileContent, {
removeComments: true,
removeCommentsFromCDATA: false,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true
});
fs.writeFileSync('index.html', fileContent2, {});
});
gulp.task('minfiyCss', function(){
return gulp.src('public/css/*.css')
return gulp.src('css/*.css')
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest('public/css'));
.pipe(gulp.dest('css'));
});
gulp.task('develop', function () {
@@ -42,23 +57,24 @@ gulp.task('develop', function () {
});
gulp.task('minifyJs', function() {
return gulp.src('public/js/*.js')
return gulp.src('js/*.js')
.pipe(uglify())
.pipe(gulp.dest('public/js'));
.pipe(gulp.dest('js'));
});
gulp.task('cachebust', function(){
return gulp.src('app/views/index.vash')
return gulp.src('index.html')
.pipe(cachebust({
type: 'timestamp'
}))
.pipe(gulp.dest('./app/views'));
.pipe(gulp.dest('.'));
});
gulp.task('publish', [
'combineCss',
'minifyHtml',
'minifyJs',
'cachebust'
]);

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -2,33 +2,33 @@
<html lang="en">
<head>
<title>Tommy James Parnell</title>
@*Meta*@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Tommy James Parnell Web Applications Developer">
<meta name="author" content="Tommy James Parnell">
<link rel="shortcut icon" href="/img/favicon.ico">
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,300italic,400italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="/components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/components/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="/components/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/bundle.css" />
<link rel="stylesheet" href="/css/bundle.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/octicons/2.0.2/octicons.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="google-site-verification" content="G4psmFLJd9nwPIr3OFJoSdrwqodMweq1oipofawZIdc"/>
<meta name="google-site-verification" content="G4psmFLJd9nwPIr3OFJoSdrwqodMweq1oipofawZIdc">
<script async type="text/javascript" src="/js/GAnalytics.min.js"></script>
</head>
<body>
<header class="header">
<div class="container" id="standardContainer">
<span class="profile-outer"><img class="profile-image img-responsive pull-left" src="/img/sqprofile.jpg" alt="Tommy Parnell" /></span>
<span class="profile-outer"><img class="profile-image img-responsive pull-left" src="/img/sqprofile.jpg" alt="Tommy Parnell"></span>
<div class="profile-content pull-left">
<h1 class="name">Tommy Parnell</h1>
<h2 class="desc">Web Applications Developer</h2>
@@ -39,10 +39,6 @@
</ul>
</div>
<div class="pull-right-md btn-toolbar">
@if (model.beer != undefined && model.beer != null)
{
<a class="btn btn-warning" href="https://untappd.com/user/tparnell"><i class="fa fa-beer"></i>drinking: @model.beer</a>
}
<a class="btn btn-cta-primary" href="mailto:tparnell8@gmail.com" target="_blank"><i class="fa fa-paper-plane"></i> Contact Me</a>
</div>
</div>
@@ -68,8 +64,8 @@
<div class="item">
<h3 class="title">Software Engineer <span class="place"><a href="http://vistaprint.com">Vistaprint.com</a></span> <span class="year">(2015 - Present)</span></h3>
<p>
Software engineer for vistaprint's gallery, and keyword search platform <br/>
<em>Javascript, C#, Ruby, Bower, Grunt, Rake, MVC 6, SQLServer, Backbone.js, React.js, Jenkins, AWS, ElasticBeanstalk</em> <br/>
Software engineer for vistaprint's gallery, and keyword search platform <br>
<em>Javascript, C#, Ruby, Bower, Grunt, Rake, MVC 6, SQLServer, Backbone.js, React.js, Jenkins, AWS, ElasticBeanstalk</em> <br>
</p>
<p><a class="more-link" href="http://vistaprint.com/gallery.aspx?pg=161" target="_blank"><i class="fa fa-external-link"></i> See Gallery Live</a></p>
@@ -78,8 +74,8 @@
<h3 class="title">Lead Systems Administrator <span class="place"><a href="http://vistaprint.com">Vistaprint.com</a></span> <span class="year">(2011 - 2015)</span></h3>
<p>Devops Engineer, Technical lead for our Monitoring team</p>
<p>
Monitoring the health of and providing support for Vistaprint's globally-distributed production infrastructure. <br/>
Creating, implementing, and maintaining tools, automation, and applications to support infrastructure and other internal teams. <br/>
Monitoring the health of and providing support for Vistaprint's globally-distributed production infrastructure. <br>
Creating, implementing, and maintaining tools, automation, and applications to support infrastructure and other internal teams. <br>
<em>C#, SQL, IIS, SCOM, Nagios, PowerShell, Windows.</em>
</p>
</div>
@@ -96,11 +92,9 @@
<p class="summary">A provider to allow C# devs to use the Untappd API</p>
<div class="featured-image">
<a href="https://github.com/tparnell8/Untappd.Net/" target="_blank">
<img class="img-responsive center-block project-image" src="/img/Untappd2.jpg" alt="Untappd Logo" />
<img class="img-responsive center-block project-image" src="/img/Untappd2.jpg" alt="Untappd Logo">
</a>
@*<div class="ribbon">
<div class="text">Fork us on Github</div>
</div>*@
</div>
<div class="desc text-left">
@@ -110,32 +104,11 @@
</div>
<a class="btn btn-cta-secondary" href="https://github.com/tparnell8/Untappd.Net/" target="_blank"><i class="fa fa-github"></i> Project on github</a>
</div>
@*<div class="item featured text-center">
<h3 class="title"><a href="https://github.com/owin-middleware/OwinOAuthProviders/pull/47" target="_blank">Twitch OAuth Provider C#</a></h3>
<p class="summary">A provider to allow C# devs to log people in with twitch</p>
<div class="featured-image">
<a href="https://github.com/owin-middleware/OwinOAuthProviders/pull/47" target="_blank">
<img class="img-responsive project-image" src="http://s.jtvnw.net/jtv_user_pictures/hosted_images/Twitch_BlackLogoURL.png" alt="Twitch Logo" />
</a>
@*<div class="ribbon">
<div class="text">App</div>
</div>
</div>
<div class="desc text-left">
<p>I am a huge fan of OAuth. Simply speaking it is the mechanism that allows websites to have <i>Login with facebook</i> style buttons. Recently I was working on a project where I wanted to log someone in with <a href="http://twitch.tv" target="blank">Twitch</a>.
Unfortunately looking through the Internet I was unable to find a .NET implementation.
</p>
<p>
I came across a cool <a href="https://github.com/owin-middleware/OwinOAuthProviders">OWIN Oauth provider</a>, but unfortunately they did not have an implementation for twitch. So I did the grunt work, and submitted <a href="https://github.com/owin-middleware/OwinOAuthProviders/pull/47">a pull request</a>.
</p>
</div>
<a class="btn btn-cta-secondary" href="https://github.com/owin-middleware/OwinOAuthProviders/pull/47" target="_blank"><i class="fa fa-code-fork"></i> View Pull Request</a>
</div>*@
</div>
</div>
</section>
@*Blog Posts*@
<aside class="blog section">
<div class="section-inner">
<h2 class="heading">Latest Blog Posts</h2>
@@ -144,7 +117,7 @@
</div>
</div>
</aside>
@*Github Feed*@
<section class="github section visible-md visible-lg">
<div class="section-inner">
<div id="feed" class="ghfeed feed">
@@ -256,7 +229,7 @@
<blockquote class="quote">
<p><i class="fa fa-quote-left"></i>Tommy has been instrumental at increasing our web presence, but much more than that, he has increased the technological knowledge of our internal staff. Empowering our employees with the tools to edit our website on the fly, and the knowledge to identify improvement areas that can be resolved with proper IT infrastructure. He has also been monumental at creating new internal software, which has exponentially increased our competitive advantage against other companies in our space.</p>
</blockquote>
<p class="source"><span class="name">Richard Warren</span><br /><span class="title">Founder Mold Assessing and Remediation Services, LLC</span></p>
<p class="source"><span class="name">Richard Warren</span><br><span class="title">Founder Mold Assessing and Remediation Services, LLC</span></p>
</div>
<p><a class="more-link" href="https://www.linkedin.com/pub/tommy-parnell/24/722/63a"><i class="fa fa-external-link"></i>More on Linkedin</a></p>
@@ -286,11 +259,11 @@
<ul class="list-unstyled">
<li class="item">
<span class="title"><strong>English:</strong></span>
<span class="level">Native Speaker <br class="visible-xs" /><i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> </span>
<span class="level">Native Speaker <br class="visible-xs"><i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> </span>
</li>
<li class="item">
<span class="title"><strong>Sign Language (US):</strong></span>
<span class="level">Somewhat Proficient <br class="visible-sm visible-xs" /><i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star-half"></i></span>
<span class="level">Somewhat Proficient <br class="visible-sm visible-xs"><i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star-half"></i></span>
</li>
</ul>
</div>

View File

@@ -3,22 +3,10 @@
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app.js"
"start": ""
},
"dependencies": {
"body-parser": "~1.12.0",
"compression": "~1.4.1",
"cookie-parser": "~1.3.3",
"express": "~4.12.0",
"glob": "~5.0.3",
"memory-cache": "^0.1.4",
"method-override": "~2.3.0",
"moment": "^2.10.3",
"morgan": "~1.5.0",
"node-untappd": "^0.3.1",
"serve-favicon": "~2.2.0",
"underscore": "^1.8.3",
"vash": "^0.9.2"
"html-minifier": "^0.7.2"
},
"devDependencies": {
"gulp": "~3.8.10",

View File

@@ -11,28 +11,13 @@
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
<webSocket enabled="false" />
<handlers>
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
<add name="iisnode" path="app.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- Do not interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^app.js\/debug[\/]?" />
</rule>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="app.js"/>
</rule>
</rules>
</rewrite>