Skip to content

Instantly share code, notes, and snippets.

View blehr's full-sized avatar

Brandon Lehr blehr

View GitHub Profile
@blehr
blehr / .block
Last active August 6, 2017 03:00
names
license: mit
const { checkToken } = require("../services/token-validator");
// create the router
const apiRouter = express.Router();
// tell the router to use checkToken function
apiRouter.use(checkToken);
// create routes
const routes = () => {
const User = require("../models/users.js");
const google = require("googleapis");
const OAuth2 = google.auth.OAuth2;
const auth = require("./auth");
const moment = require("moment");
// create auth client
const oauth2Client = new OAuth2(
auth.googleAuth.clientID,
auth.googleAuth.clientSecret,
passport.use(new GoogleStrategy({
clientID: configAuth.googleAuth.clientID,
clientSecret: configAuth.googleAuth.clientSecret,
callbackURL: configAuth.googleAuth.callbackURL,
passReqToCallback: true
},
function(req, accessToken, refreshToken, params, profile, done) {
/*
params = {
access_token: 'Long_string',
@blehr
blehr / nav-tabs.js
Last active September 20, 2018 12:18
How to get the bootstrap active class on a links containing <li> when using nav-tabs
/*********************************
* nav-tabs.js
* *******************************/
import React from 'react';
import Tab from './tab';
const NavTab = () => {
return (
<nav>
@blehr
blehr / google_ad.js
Last active June 22, 2016 19:01
GoogleAd React Component
import React, { Component, PropTypes } from 'react';
export default class GoogleAd extends Component {
static propTypes = {
client: PropTypes.string,
slot: PropTypes.string,
format: PropTypes.string,
wrapperDivStyle: PropTypes.object
}