Skip to content

Instantly share code, notes, and snippets.

View bvenkatr's full-sized avatar
🏠
Working from home

Venkat bvenkatr

🏠
Working from home
View GitHub Profile
@bvenkatr
bvenkatr / app.js
Created August 29, 2021 09:16 — forked from fuxingloh/app.js
How to use express.js and passport.js with G Suite SAML Apps SSO
const express = require('express')
const SamlStrategy = require('passport-saml').Strategy
const passport = require('passport')
const cookieSession = require('cookie-session')
const cookieParser = require('cookie-parser')
// Create express instance
const app = express()
@bvenkatr
bvenkatr / postman-pre-request.js
Created January 13, 2021 10:38 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@bvenkatr
bvenkatr / delete_git_submodule.md
Created December 11, 2020 17:24 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule

Third Party Authentication Features in Open edX: Technical Knowledge Transfer

Part 1: Background / Notes

  • Open edX has full, integrated support for three different types of third party auth provider:
    1. OAuth based providers (OAuth2 and the older OAuth v1). Google, Facebook, LinkedIn, and Azure Active Directory are available by default. Any other OAuth backends supported by python-social-auth v0.2.12 can be enabled by changing a configuration setting. Contributed by Google (John Cox).
    2. SAML / Shibboleth. SAML is an SSO standard mostly used by universities and corporations. Shibboleth is the name of a particular implementation of SAML, commonly used by higher ed. institutions.
    3. LTI. Users can use Learning Tools Interoperability® (LTI®) to authenticate. Support for this was contributed by UBC.
  • The Open edX platform also includes limited support for the following SSO providers.
  1. [
@bvenkatr
bvenkatr / http_get.go
Created January 2, 2020 17:16 — forked from hidva/http_get.go
golang wget
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"time"
@bvenkatr
bvenkatr / post-merge
Created February 7, 2019 07:31 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@bvenkatr
bvenkatr / .babelrc
Created March 13, 2017 09:36 — forked from thejmazz/.babelrc
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@bvenkatr
bvenkatr / jsbin.yecewaj.js
Created February 25, 2017 06:51 — forked from nsisodiya/jsbin.yecewaj.js
Promise Based processing with Array. sequentialProcess and parallelProcess
//Author - Narendra Sisodiya - http://narendrasisodiya.com
//WHeN to use ? when async result from One Element is needed in another.
var sequentialProcess = function(arr, callback){
var pp = Promise.resolve();
arr.forEach(function(v, i, A){
pp = pp.then(function(){
return callback(v, i, A);
});
@bvenkatr
bvenkatr / app.coffee
Last active August 29, 2015 14:12 — forked from csexton/app.coffee
app = angular.module('angularjs-starter', [])
app.controller 'MainCtrl', ($scope) ->
$scope.name = 'World'
angular.bootstrap(document, ['angularjs-starter'])
// this script will copy all AQL user functions from the _system database of an ArangoDB server
// into all other databases of the server. Database names and authentication credentials must
// be specified in the script in the "databases" variable
//
// invoke the script from ArangoShell like this:
// require("internal").load("copy-aqlfunctions.js");
(function () {
var db = require("org/arangodb").db;
var print = require("internal").print;