Skip to content

Instantly share code, notes, and snippets.

Avatar

Nigel Earle NigelEarle

  • NWRE Development
  • San Diego, CA
View GitHub Profile
@NigelEarle
NigelEarle / express-fb-oauth.js
Last active Feb 18, 2017
Express fb oauth example using the passport.js library.
View express-fb-oauth.js
const express = require('express');
const passport = require('passport');
const Strategy = require('passport-facebook').Strategy;
const CLIENT_ID = process.env.CLIENT_ID || require('./config/facebook.json').ClientId;
const CLIENT_SECRET = process.env.CLIENT_SECRET || require('./config/facebook.json').ClientSecret;
const PORT = process.env.PORT || 3000;
const app = express();
@NigelEarle
NigelEarle / gulpfile.example.js
Last active Jun 29, 2016
Boilerplate gulp file compile js and sass, running node server along with livereload.
View gulpfile.example.js
const gulp = require('gulp'),
uglify = require('gulp-uglify'),
pump = require('pump'),
sass = require('gulp-sass'),
nodemon = require('gulp-nodemon'),
livereload = require('gulp-livereload');
gulp.task('serve', function(){
nodemon({
script: 'server.js',
@NigelEarle
NigelEarle / regex.md
Last active Jun 18, 2021
A Guide To Regex in JS
View regex.md

What is a Regular Expression?

A regular expression is a sequence of characters that forms a search pattern. The search pattern can be used for text search and text replace operations.

When you search for data in a text, you can use this search pattern to describe what you are searching for. A regular expression can be a single character, or a more complicated pattern. Regular expressions can be used to perform all types of text search and text replace operations.

String Modifiers