View jwtRS256.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
View scrap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
var request = require('request'); | |
var cheerio = require('cheerio'); | |
var iconv = require('iconv-lite'); | |
var moment = require('moment'); | |
var headers = { | |
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' | |
}; |
View authRouting.run.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// module is your angular module | |
module.run(authRouting); | |
/* @ngInject */ | |
function authRouting($state, $rootScope, $urlRouter, Auth) { | |
$rootScope.$on('$stateChangeStart', function(event, toState) { | |
var requireAuth; | |
if (toState.data) { | |
requireAuth = toState.data.requireAuth; // PROPERTY TO SET FOR ROUTE ACCESS RESTRICTION |
View authInterceptorConfig.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// module is your angular module | |
module.config(authInterceptorConfig); | |
/* @ngInject*/ | |
function authInterceptorConfig($httpProvider) { | |
$httpProvider.interceptors.push('authInterceptor'); | |
} | |
module.factory('authInterceptor', authInterceptor); |
View module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MyModule is a module that works on Browser, Node.js, Web Workers, ... | |
*/ | |
(function(global) { | |
'use strict'; | |
// Define your MyModule here | |
global.MyModule = (global.module || {}).exports = MyModule; |