Skip to content

Instantly share code, notes, and snippets.

View stuyy's full-sized avatar

Anson stuyy

View GitHub Profile
@stuyy
stuyy / passport.js
Created September 6, 2019 23:19 — forked from manjeshpv/passport.js
Passport.js using MySQL for Authentication with Express
// config/passport.js
// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
@stuyy
stuyy / nativeJavaScript.js
Created January 20, 2019 12:02 — forked from alexhawkins/nativeJavaScript.js
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests