Skip to content

Instantly share code, notes, and snippets.

View zacharyhill's full-sized avatar

Zachary Hill zacharyhill

View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>hello phaser!</title>
<script src="./node_modules/phaser-ce/build/phaser.min.js"></script>
</head>
<body>
<script type="text/javascript">
$ openssl s_client -connect 127.0.0.1:465
CONNECTED(00000003)
140640946747032:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 305 bytes
---
$ openssl s_client -connect 127.0.0.1:465 -starttls smtp
CONNECTED(00000003)
depth=0 CN = zhillb.xyz
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = zhillb.xyz
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
module.exports = {
foo: 'bar',
num: 22,
items: [
'item1', 'item2', 'item3'
],
};
function every(array, callbackFunction) {
var doesEveryElementMatch = true;
array.forEach(function(element) {
doesEveryElementMatch = callbackFunction(element);
});
return doesEveryElementMatch;
}
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
var Bucket;
function bucketNameIsUndefined() {
if (!Bucket) {
return true;
const defaults = {
Bucket: '',
DB: 'Mail',
Save: {
headers: false,
subject: true,
from: true,
to: true,
cc: true,
bcc: true,
const fs = require('fs');
module.exports.getFiles = function() {
return new Promise((resolve, reject) => {
fs.readFile('/home/usr', (err, data) => {
if (err) {
reject(err);
}
else {
resolve(data);
const bucket = require('./bucket');
const configure = require('./config');
const db = require('./db');
const parse = require('./parseMail');
let config;
const processNewMail = function(optionalCallback) {
if (config.Bucket === '') {
throw new Error('Bucket name must be set!');
@zacharyhill
zacharyhill / login.js
Created January 22, 2018 22:58
Login Controller for Express Route
const bcrypt = require('bcrypt');
// const jwt = require('jsonwebtoken');
const User = require('../models/user');
async function authenticateUser(username, password) {
const users = await User.find({ username });
if (users.length) {
const user = users[0];
const samePassword = await checkPassword(password, user.password);
return samePassword;