Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View NigelEarle's full-sized avatar

Nigel Earle NigelEarle

  • NWRE Development
  • San Diego, CA
View GitHub Profile
@NigelEarle
NigelEarle / express-fb-oauth.js
Last active February 18, 2017 22:25
Express fb oauth example using the passport.js library.
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 June 29, 2016 23:19
Boilerplate gulp file compile js and sass, running node server along with livereload.
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 August 6, 2023 11:27
A Guide To Regex in JS

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