5 Commits

1160 changed files with 164 additions and 348 deletions
Split View
  1. +3
    -0
      .gitignore
  2. +5
    -5
      Dockerfile
  3. +0
    -80
      admin/admin.js
  4. +0
    -71
      admin/analytics.js
  5. +1
    -1
      admin/posts.js
  6. +4
    -5
      blog/renderBlogPost.js
  7. +0
    -1
      blogContent/posts/data-science/html/gans-in-pytorch.html
  8. +0
    -1
      blogContent/posts/open-source/html/teaching-ssh-through-a-ctf.html
  9. +3
    -13
      config.json
  10. +0
    -0
      content/downloads/1.jpg
  11. +0
    -0
      content/downloads/Cube-Field-youtube-demo.zip
  12. +0
    -0
      content/downloads/Extreme-vb-pong.zip
  13. +0
    -0
      content/downloads/Zombie-Game-Youtube-Demo.zip
  14. +0
    -0
      content/downloads/ZombieGameYoutube.zip
  15. +0
    -0
      content/headerImages/2018GitHubActivity.png
  16. +0
    -0
      content/headerImages/8-bit.png
  17. +0
    -0
      content/headerImages/ConstantTimeComplexity.png
  18. +0
    -0
      content/headerImages/NFA.svg
  19. +0
    -0
      content/headerImages/asteroids.png
  20. +0
    -0
      content/headerImages/aux_banner.jpg
  21. +0
    -0
      content/headerImages/badDrawingRSS.png
  22. +0
    -0
      content/headerImages/bi.jpg
  23. +0
    -0
      content/headerImages/burnout.png
  24. +0
    -0
      content/headerImages/commarch.png
  25. +0
    -0
      content/headerImages/computer.jpg
  26. +0
    -0
      content/headerImages/covid.jpg
  27. +0
    -0
      content/headerImages/cuda-performance.png
  28. +0
    -0
      content/headerImages/cv1.png
  29. +0
    -0
      content/headerImages/deltaDamBridge.jpg
  30. +0
    -0
      content/headerImages/filterBank.png
  31. +0
    -0
      content/headerImages/floppy2.jpg
  32. +0
    -0
      content/headerImages/functionalDivide.png
  33. +0
    -0
      content/headerImages/gan.png
  34. +0
    -0
      content/headerImages/gitHubGraphs.png
  35. +0
    -0
      content/headerImages/github2019.png
  36. +0
    -0
      content/headerImages/gremlinConsole.png
  37. +0
    -0
      content/headerImages/hillClimbing.png
  38. +0
    -0
      content/headerImages/jupyter.png
  39. +0
    -0
      content/headerImages/kml-header.jpg
  40. +0
    -0
      content/headerImages/lsv.png
  41. +0
    -0
      content/headerImages/magicLights.jpg
  42. +0
    -0
      content/headerImages/mason.jpg
  43. +0
    -0
      content/headerImages/maxCPU.png
  44. +0
    -0
      content/headerImages/minecraft.png
  45. +0
    -0
      content/headerImages/oh-my-zsh.png
  46. +0
    -0
      content/headerImages/oneWeekHeartRateGraph.png
  47. +0
    -0
      content/headerImages/playTimes.png
  48. +0
    -0
      content/headerImages/porkChops.png
  49. +0
    -0
      content/headerImages/prismJS.png
  50. +0
    -0
      content/headerImages/profileImages.png
  51. +0
    -0
      content/headerImages/quadTree.png
  52. +0
    -0
      content/headerImages/quadtree-diptych.jpg
  53. +0
    -0
      content/headerImages/restingHeartRate.svg
  54. +0
    -0
      content/headerImages/rit1.jpg
  55. +0
    -0
      content/headerImages/rit2.jpg
  56. +0
    -0
      content/headerImages/shock-treatment.png
  57. +0
    -0
      content/headerImages/spaghetti.jpg
  58. +0
    -0
      content/headerImages/sshchallenge.png
  59. +0
    -0
      content/headerImages/steamGraphWebBanner.png
  60. +0
    -0
      content/headerImages/steamGraphs2.png
  61. +0
    -0
      content/headerImages/video-backlog.PNG
  62. +0
    -0
      content/headerImages/vimConfiguration.png
  63. +0
    -0
      content/headerImages/word-embeddings-part-2.jpg
  64. +0
    -0
      content/headerImages/word-embeddings.png
  65. +0
    -0
      content/headerImages/wordpress_banner.jpg
  66. +0
    -0
      content/photos/2019/1.jpg
  67. +0
    -0
      content/photos/2019/10/1.jpg
  68. +0
    -0
      content/photos/2019/10/chimney-bluffs/1.jpg
  69. +0
    -0
      content/photos/2019/10/chimney-bluffs/20191019_143518.jpg
  70. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06387.jpg
  71. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06398.jpg
  72. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06535.jpg
  73. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06588.jpg
  74. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06594.jpg
  75. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06697.jpg
  76. +0
    -0
      content/photos/2019/10/chimney-bluffs/DSC06719.jpg
  77. +0
    -0
      content/photos/2019/10/chimney-bluffs/post.md
  78. +0
    -0
      content/photos/2019/10/dir.md
  79. +0
    -0
      content/photos/2019/10/east-lake-ontario-marshes/1.jpg
  80. +0
    -0
      content/photos/2019/10/east-lake-ontario-marshes/2.jpg
  81. +0
    -0
      content/photos/2019/10/east-lake-ontario-marshes/DSC06347.jpg
  82. +0
    -0
      content/photos/2019/10/east-lake-ontario-marshes/DSC06359.jpg
  83. +0
    -0
      content/photos/2019/10/east-lake-ontario-marshes/DSC06363.jpg
  84. +0
    -0
      content/photos/2019/10/east-lake-ontario-marshes/post.md
  85. +0
    -0
      content/photos/2019/10/fort-ontario/1.jpg
  86. +0
    -0
      content/photos/2019/10/fort-ontario/DSC06234.jpg
  87. +0
    -0
      content/photos/2019/10/fort-ontario/DSC06243.jpg
  88. +0
    -0
      content/photos/2019/10/fort-ontario/DSC06275.jpg
  89. +0
    -0
      content/photos/2019/10/fort-ontario/DSC06280.jpg
  90. +0
    -0
      content/photos/2019/10/fort-ontario/post.md
  91. +0
    -0
      content/photos/2019/10/future-is-open/1.jpg
  92. +0
    -0
      content/photos/2019/10/future-is-open/IMG_20191026_115124.jpg
  93. +0
    -0
      content/photos/2019/10/future-is-open/IMG_20191026_140252.jpg
  94. +0
    -0
      content/photos/2019/10/future-is-open/MVIMG_20191026_105455.jpg
  95. +0
    -0
      content/photos/2019/10/future-is-open/MVIMG_20191026_133712.jpg
  96. +0
    -0
      content/photos/2019/10/future-is-open/post.md
  97. +0
    -0
      content/photos/2019/10/green-lake/1.jpg
  98. +0
    -0
      content/photos/2019/10/green-lake/DSC06177.jpg
  99. +0
    -0
      content/photos/2019/10/green-lake/DSC06185.jpg
  100. +0
    -0
      content/photos/2019/10/green-lake/DSC06195.jpg

+ 3
- 0
.gitignore View File

@ -1,4 +1,7 @@
*.iml
.idea
.vscode
node_modules
package-lock.json
sitemap.txt
blog.db

+ 5
- 5
Dockerfile View File

@ -5,17 +5,17 @@ FROM node:buster-slim
WORKDIR /src/
# installs node dependencies
ADD package.json package.json
RUN npm install
# installs pandoc for markdown to html
# need git so admin page can pull blog updates
RUN apt-get update && \
apt-get install sqlite3 -y && \
apt-get install pandoc -y && \
apt-get install git -y
# installs node dependencies
ADD package.json package.json
RUN npm install
# exposes port application runs on
EXPOSE 8000

+ 0
- 80
admin/admin.js View File

@ -1,80 +0,0 @@
/**
* Determines what template and controls that will be
* displayed based on the url such as
* /
* /blog
* /downloads
*
* For each controls it calls that "pages" associated javascript file
* which fetches the template, deals with post data and gathers context
* for the template engine.
*/
//file IO
const utils = require('../utils/utils.js');
module.exports=
{
/**
*
* @param request -- used to get post data
* @param clientAddress -- used to see if user is banned for login
* @param templateContext -- used by whiskers for information to plug
* in the template
* @param filename -- specific admin page requested
* @returns {Promise} resolves once everything has been added to the template context
*/
main: function(request, clientAddress, templateContext, filename)
{
return new Promise(function(resolve, reject)
{
//if logged in
if(request.session && request.session.user)
{
templateContext.loggedIn = true;
utils.getPostData(request).then(function (postData)
{
var page = "./adminHome.js";
if(filename.includes('/downloads'))
{
page = "./adminDownloads.js";
}
else if(filename.includes("/posts"))
{
page = "./posts.js";
}
else if(filename.includes("/users"))
{
page = "./users.js";
}
else if(filename.includes("/analytics"))
{
page = "./analytics.js"
}
require(page).main(postData, templateContext).then(function(template)
{
templateContext.adminPage = template;
resolve();
}).catch(function(error)
{
console.log(error);
});
});
}
else
{
require("./login.js").main(request, clientAddress, templateContext)
.then(function()
{
resolve();
}).catch(function(err)
{
console.log(err);
reject(err);
})
}
});
}
};

+ 0
- 71
admin/analytics.js View File

@ -1,71 +0,0 @@
/** Whiskers template file */
const TEMPLATE_FILE = "admin/analytics.html";
const includes = require('../includes/includes.js');
//updates db
const sql = require('../utils/sql');
const generateData = function(templateContext)
{
return new Promise(function(resolve, reject)
{
var data = [];
sql.getTraffic().then(function(traffic)
{
var start = traffic[0].date;
var currentMonth = new Date(start.getUTCFullYear(), start.getMonth(), 1, 0,0,0);
templateContext.start = JSON.stringify(currentMonth);
var monthCount = 0;
for(var i = 0; i < traffic.length; i++)
{
var currentDate = traffic[i].date;
if(currentMonth.getMonth() != currentDate.getMonth())
{
var foo = new Object();
foo.x = currentMonth;
foo.y = monthCount;
data.push(foo);
monthCount = 0;
currentMonth = new Date(currentDate.getUTCFullYear(), currentDate.getMonth(), 1, 0,0,0);
}
monthCount = monthCount + 1;
}
templateContext.finish = JSON.stringify(currentMonth);
templateContext.dataset = JSON.stringify(data);
resolve();
});
});
};
module.exports=
{
/**
* Fetches context information for the admin blog page and handles post
* data sent regarding editing blog.
*
* @param templateContext json object used as the template context
* @returns {Promise} renders the template used for this page
*/
main: function(templateContext)
{
return new Promise(function(resolve, reject)
{
Promise.all([includes.fetchTemplate(TEMPLATE_FILE), generateData(templateContext)]).then(function(template)
{
templateContext.adminPage = template[0];
resolve();
}).catch(function(error)
{
console.log("error in add admin blog.js");
reject(error);
});
});
}
};

+ 1
- 1
admin/posts.js View File

@ -32,7 +32,7 @@ const processPostData = function(postData, renderContext)
renderContext.editPost = true;
sql.getPostById(postParsed.edit_post).then(function(post)
{
post.published = post.published.toISOString().split('T')[0];
post.published = new Date(post.published).toDateString();
renderContext.post = post;
resolve();
});

+ 4
- 5
blog/renderBlogPost.js View File

@ -47,8 +47,7 @@ module.exports=
{
if(post.picture_url !== "n/a")
post.hasPicture = true;
post.published = post.published.toDateString();
post.published = new Date(post.published).toDateString();
return;
},
@ -91,11 +90,11 @@ module.exports=
{
return new Promise(function(resolve, reject)
{
const pathName = "blogContent/posts/" + categoryURL + "/"
const pathName = "content/posts/" + categoryURL + "/"
+ postURL + ".md";
var markDown = utils.getFileContents(pathName).toString();
markDown = markDown.split("(media/").join("(" + "../blogContent/posts/"
markDown = markDown.split("(media/").join("(" + "../content/posts/"
+ categoryURL + "/media/");
module.exports.convertToHTML(markDown, blocks).then(function(result)
@ -142,7 +141,7 @@ module.exports=
var regExp = /\<customHTML .*?>/;
while (result.search(regExp) != -1)
{
const pathName = "blogContent/posts/" + categoryURL + "/html/"
const pathName = "content/posts/" + categoryURL + "/html/"
+ postURL + ".html";
var htmlContent = utils.getFileContents(pathName).toString();

+ 0
- 1
blogContent/posts/data-science/html/gans-in-pytorch.html View File

@ -1 +0,0 @@
<embed src="https://jrtechs.net/blogContent/posts/data-science/html/CV_Final_Project_Final.pdf" type="application/pdf" width="100%" height="500px">

+ 0
- 1
blogContent/posts/open-source/html/teaching-ssh-through-a-ctf.html View File

@ -1 +0,0 @@
<embed src="https://jrtechs.net/blogContent/posts/open-source/html/everything-ssh.pdf" type="application/pdf" width="100%" height="500px">

+ 3
- 13
config.json View File

@ -1,16 +1,6 @@
{
"PORT": 8000,
"SESSION_SECRET": "random-data-to-seed-session-data",
"SQL_HOST": "localhost",
"SQL_DATABASE": "jrtechs_blog",
"SQL_USER": "root",
"SQL_PASSWORD": "password",
"CAPTCHA_SECRET": "captcha-secret",
"GMAIL_ACCOUNT": "email@gmail.com",
"EMAIL_PASSWORD": "email-password",
"DESTINATION_EMAIL": "destination email address"
"CACHE": false,
"ADMIN_CHECK": true,
"SESSION_SECRET": "random-data-to-seed-session-data"
}

blogContent/downloads/1.jpg → content/downloads/1.jpg View File


blogContent/downloads/Cube-Field-youtube-demo.zip → content/downloads/Cube-Field-youtube-demo.zip View File


blogContent/downloads/Extreme-vb-pong.zip → content/downloads/Extreme-vb-pong.zip View File


blogContent/downloads/Zombie-Game-Youtube-Demo.zip → content/downloads/Zombie-Game-Youtube-Demo.zip View File


blogContent/downloads/ZombieGameYoutube.zip → content/downloads/ZombieGameYoutube.zip View File


blogContent/headerImages/2018GitHubActivity.png → content/headerImages/2018GitHubActivity.png View File


blogContent/headerImages/8-bit.png → content/headerImages/8-bit.png View File


blogContent/headerImages/ConstantTimeComplexity.png → content/headerImages/ConstantTimeComplexity.png View File


blogContent/headerImages/NFA.svg → content/headerImages/NFA.svg View File


blogContent/headerImages/asteroids.png → content/headerImages/asteroids.png View File


blogContent/headerImages/aux_banner.jpg → content/headerImages/aux_banner.jpg View File


blogContent/headerImages/badDrawingRSS.png → content/headerImages/badDrawingRSS.png View File


blogContent/headerImages/bi.jpg → content/headerImages/bi.jpg View File


blogContent/headerImages/burnout.png → content/headerImages/burnout.png View File


blogContent/headerImages/commarch.png → content/headerImages/commarch.png View File


blogContent/headerImages/computer.jpg → content/headerImages/computer.jpg View File


blogContent/headerImages/covid.jpg → content/headerImages/covid.jpg View File


blogContent/headerImages/cuda-performance.png → content/headerImages/cuda-performance.png View File


blogContent/headerImages/cv1.png → content/headerImages/cv1.png View File


blogContent/headerImages/deltaDamBridge.jpg → content/headerImages/deltaDamBridge.jpg View File


blogContent/headerImages/filterBank.png → content/headerImages/filterBank.png View File


blogContent/headerImages/floppy2.jpg → content/headerImages/floppy2.jpg View File


blogContent/headerImages/functionalDivide.png → content/headerImages/functionalDivide.png View File


blogContent/headerImages/gan.png → content/headerImages/gan.png View File


blogContent/headerImages/gitHubGraphs.png → content/headerImages/gitHubGraphs.png View File


blogContent/headerImages/github2019.png → content/headerImages/github2019.png View File


blogContent/headerImages/gremlinConsole.png → content/headerImages/gremlinConsole.png View File


blogContent/headerImages/hillClimbing.png → content/headerImages/hillClimbing.png View File


blogContent/headerImages/jupyter.png → content/headerImages/jupyter.png View File


blogContent/headerImages/kml-header.jpg → content/headerImages/kml-header.jpg View File


blogContent/headerImages/lsv.png → content/headerImages/lsv.png View File


blogContent/headerImages/magicLights.jpg → content/headerImages/magicLights.jpg View File


blogContent/headerImages/mason.jpg → content/headerImages/mason.jpg View File


blogContent/headerImages/maxCPU.png → content/headerImages/maxCPU.png View File


blogContent/headerImages/minecraft.png → content/headerImages/minecraft.png View File


blogContent/headerImages/oh-my-zsh.png → content/headerImages/oh-my-zsh.png View File


blogContent/headerImages/oneWeekHeartRateGraph.png → content/headerImages/oneWeekHeartRateGraph.png View File


blogContent/headerImages/playTimes.png → content/headerImages/playTimes.png View File


blogContent/headerImages/porkChops.png → content/headerImages/porkChops.png View File


blogContent/headerImages/prismJS.png → content/headerImages/prismJS.png View File


blogContent/headerImages/profileImages.png → content/headerImages/profileImages.png View File


blogContent/headerImages/quadTree.png → content/headerImages/quadTree.png View File


blogContent/headerImages/quadtree-diptych.jpg → content/headerImages/quadtree-diptych.jpg View File


blogContent/headerImages/restingHeartRate.svg → content/headerImages/restingHeartRate.svg View File


blogContent/headerImages/rit1.jpg → content/headerImages/rit1.jpg View File


blogContent/headerImages/rit2.jpg → content/headerImages/rit2.jpg View File


blogContent/headerImages/shock-treatment.png → content/headerImages/shock-treatment.png View File


blogContent/headerImages/spaghetti.jpg → content/headerImages/spaghetti.jpg View File


blogContent/headerImages/sshchallenge.png → content/headerImages/sshchallenge.png View File


blogContent/headerImages/steamGraphWebBanner.png → content/headerImages/steamGraphWebBanner.png View File


blogContent/headerImages/steamGraphs2.png → content/headerImages/steamGraphs2.png View File


blogContent/headerImages/video-backlog.PNG → content/headerImages/video-backlog.PNG View File


blogContent/headerImages/vimConfiguration.png → content/headerImages/vimConfiguration.png View File


blogContent/headerImages/word-embeddings-part-2.jpg → content/headerImages/word-embeddings-part-2.jpg View File


blogContent/headerImages/word-embeddings.png → content/headerImages/word-embeddings.png View File


blogContent/headerImages/wordpress_banner.jpg → content/headerImages/wordpress_banner.jpg View File


blogContent/photos/2019/1.jpg → content/photos/2019/1.jpg View File


blogContent/photos/2019/10/1.jpg → content/photos/2019/10/1.jpg View File


blogContent/photos/2019/10/chimney-bluffs/1.jpg → content/photos/2019/10/chimney-bluffs/1.jpg View File


blogContent/photos/2019/10/chimney-bluffs/20191019_143518.jpg → content/photos/2019/10/chimney-bluffs/20191019_143518.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06387.jpg → content/photos/2019/10/chimney-bluffs/DSC06387.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06398.jpg → content/photos/2019/10/chimney-bluffs/DSC06398.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06535.jpg → content/photos/2019/10/chimney-bluffs/DSC06535.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06588.jpg → content/photos/2019/10/chimney-bluffs/DSC06588.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06594.jpg → content/photos/2019/10/chimney-bluffs/DSC06594.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06697.jpg → content/photos/2019/10/chimney-bluffs/DSC06697.jpg View File


blogContent/photos/2019/10/chimney-bluffs/DSC06719.jpg → content/photos/2019/10/chimney-bluffs/DSC06719.jpg View File


blogContent/photos/2019/10/chimney-bluffs/post.md → content/photos/2019/10/chimney-bluffs/post.md View File


blogContent/photos/2019/10/dir.md → content/photos/2019/10/dir.md View File


blogContent/photos/2019/10/east-lake-ontario-marshes/1.jpg → content/photos/2019/10/east-lake-ontario-marshes/1.jpg View File


blogContent/photos/2019/10/east-lake-ontario-marshes/2.jpg → content/photos/2019/10/east-lake-ontario-marshes/2.jpg View File


blogContent/photos/2019/10/east-lake-ontario-marshes/DSC06347.jpg → content/photos/2019/10/east-lake-ontario-marshes/DSC06347.jpg View File


blogContent/photos/2019/10/east-lake-ontario-marshes/DSC06359.jpg → content/photos/2019/10/east-lake-ontario-marshes/DSC06359.jpg View File


blogContent/photos/2019/10/east-lake-ontario-marshes/DSC06363.jpg → content/photos/2019/10/east-lake-ontario-marshes/DSC06363.jpg View File


blogContent/photos/2019/10/east-lake-ontario-marshes/post.md → content/photos/2019/10/east-lake-ontario-marshes/post.md View File


blogContent/photos/2019/10/fort-ontario/1.jpg → content/photos/2019/10/fort-ontario/1.jpg View File


blogContent/photos/2019/10/fort-ontario/DSC06234.jpg → content/photos/2019/10/fort-ontario/DSC06234.jpg View File


blogContent/photos/2019/10/fort-ontario/DSC06243.jpg → content/photos/2019/10/fort-ontario/DSC06243.jpg View File


blogContent/photos/2019/10/fort-ontario/DSC06275.jpg → content/photos/2019/10/fort-ontario/DSC06275.jpg View File


blogContent/photos/2019/10/fort-ontario/DSC06280.jpg → content/photos/2019/10/fort-ontario/DSC06280.jpg View File


blogContent/photos/2019/10/fort-ontario/post.md → content/photos/2019/10/fort-ontario/post.md View File


blogContent/photos/2019/10/future-is-open/1.jpg → content/photos/2019/10/future-is-open/1.jpg View File


blogContent/photos/2019/10/future-is-open/IMG_20191026_115124.jpg → content/photos/2019/10/future-is-open/IMG_20191026_115124.jpg View File


blogContent/photos/2019/10/future-is-open/IMG_20191026_140252.jpg → content/photos/2019/10/future-is-open/IMG_20191026_140252.jpg View File


blogContent/photos/2019/10/future-is-open/MVIMG_20191026_105455.jpg → content/photos/2019/10/future-is-open/MVIMG_20191026_105455.jpg View File


blogContent/photos/2019/10/future-is-open/MVIMG_20191026_133712.jpg → content/photos/2019/10/future-is-open/MVIMG_20191026_133712.jpg View File


blogContent/photos/2019/10/future-is-open/post.md → content/photos/2019/10/future-is-open/post.md View File


blogContent/photos/2019/10/green-lake/1.jpg → content/photos/2019/10/green-lake/1.jpg View File


blogContent/photos/2019/10/green-lake/DSC06177.jpg → content/photos/2019/10/green-lake/DSC06177.jpg View File


blogContent/photos/2019/10/green-lake/DSC06185.jpg → content/photos/2019/10/green-lake/DSC06185.jpg View File


blogContent/photos/2019/10/green-lake/DSC06195.jpg → content/photos/2019/10/green-lake/DSC06195.jpg View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save