Skip to content

Instantly share code, notes, and snippets.

@bholagabbar
bholagabbar / auth0_django_middleware.py
Created September 8, 2017 21:48
Auth0 Token Validation and Authorisation as Django Middleware
from django.http import JsonResponse
from jose import jwt
AUTH0_DOMAIN = {YOUR_AUTH0_DOMAIN}
API_AUDIENCE = {YOUR_API_AUDIENCE}
ALGORITHMS = ["RS256"]
"""
Cache the key available at https://{AUTH0_DOMAIN}/.well-known/jwks.json as a python dict
@bholagabbar
bholagabbar / fileParser.java
Created February 1, 2016 16:46
Redudanant Data in notification package
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.TreeSet;
import java.util.TreeMap;
import java.util.Scanner;
class TEST1 {
public static void main(String[] args) throws Exception {
System.setIn(new FileInputStream("C:\\Users\\User\\Desktop\\parseThisFile.txt"));
TreeMap<String, TreeSet<String>> dependenciesMappedToDeletedClasses = new TreeMap<String, TreeSet<String>>();
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.web.controller;
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.web.controller;
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.web.controller;