This file contains hidden or 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
/** | |
* 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 file contains hidden or 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
/** | |
* 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 file contains hidden or 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
/** | |
* 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 file contains hidden or 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
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 file contains hidden or 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
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 |
This file contains hidden or 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
import seccure | |
# Using ECC Encryption Decrpytion | |
private_key = '123tadfg1wt1qdg123512er2'.encode('utf-8') | |
public_key = 'BCGB&[gT#hf6?b*63nSaX+L-0'.encode('utf-8') | |
message = 'This is a secret message'.encode('utf-8') | |
print(str(message), '\n') |
This file contains hidden or 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
import os | |
from tempfile import mkstemp | |
from shutil import move | |
from os import fdopen, remove | |
import re | |
return_pattern = re.compile(r'return json\.dumps.*') | |
import_pattern = re.compile(r'from flask import.*') |
This file contains hidden or 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
type CreateSurveyResponseInput { | |
survey_id: String!, | |
customer_id: String!, | |
responses: [SurveyQuestionResponseInput]!, | |
order_id: String | |
} |
This file contains hidden or 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
from time import sleep | |
from json import dumps | |
from kafka import KafkaProducer | |
# Create a producer to write data to kafka | |
producer = KafkaProducer(bootstrap_servers=['localhost:9092'], | |
value_serializer=lambda x: dumps(x).encode('utf-8')) | |
# Write data via the producer | |
for e in range(10): |
This file contains hidden or 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
from kafka import KafkaConsumer | |
from json import loads | |
# Create a consumer to read data from kafka | |
consumer = KafkaConsumer( | |
'numtest', | |
bootstrap_servers=['localhost:9092'], | |
# Read from the start of the topic; Default is latest | |
auto_offset_reset='earliest' | |
) |
OlderNewer