Skip to content

Instantly share code, notes, and snippets.

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

Daniel Jordan dajor

🏠
Working from home
View GitHub Profile
import pandas as pd
df = pd.read_csv("./hotels.csv")
df.head()
@dajor
dajor / function.json
Created October 2, 2018 11:14 — forked from ealsur/function.json
Azure Cosmos DB + Functions Cookbook —secure access function.json
{
"bindings": [
{
"name": "req",
"type": "httpTrigger",
"direction": "in"
},
{
"name": "$return",
"type": "http",
@dajor
dajor / project.json
Created October 2, 2018 11:15 — forked from ealsur/project.json
Azure Cosmos DB + Functions Cookbook —secure access project.json
{
"frameworks": {
"net46":{
"dependencies": {
"Microsoft.Azure.KeyVault": "2.3.2",
"Microsoft.Azure.Services.AppAuthentication": "1.1.0-preview"
}
}
}
}
@dajor
dajor / run.csx
Created October 2, 2018 11:16 — forked from ealsur/run.csx
Azure Cosmos DB + Functions Cookbook —secure access run.csx
#r "Microsoft.Azure.Documents.Client"
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;
using System.Net;
using System.Configuration;
using Microsoft.Azure.KeyVault;
using Microsoft.Azure.Services.AppAuthentication;
private static HttpClient httpClient = new HttpClient();
private static DocumentClient client = null;
import logging
import azure.functions as func
import os, io, crm, json
import pandas as pd
from sugarcrm.client import Client
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
@dajor
dajor / __init__.py
Last active October 22, 2019 08:34
Read a png or jpg from an Azure Blog Storage and decode the barcode and upload the document to SugarCRM
# Last Tested Version 1.8.1
import logging
import azure.functions as func
from azure.storage.blob import BlockBlobService
import os, io
import json
import base64
from pyzbar.pyzbar import decode
export SugarURL="*******"
export SugarUser="******"
# If your password have special character use escape
export SugarPassword="*****"
export DockerImage=dajor85570/barcodedocker:v1.8
docker build --tag $DockerImage .
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dajor
dajor / 0.pynb
Last active November 1, 2019 18:03
!apt-get update
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q http://archive.apache.org/dist/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz
!tar xf spark-2.3.1-bin-hadoop2.7.tgz
!pip install -q findspark
import sys, os, time
import aztk.spark
from aztk.error import AztkError
import datetime
#UPDATE this section to set your secrets
secrets_confg = aztk.spark.models.SecretsConfiguration(
service_principal=aztk.spark.models.ServicePrincipalConfiguration(
tenant_id="Update with AAD Directory ID",
client_id="Update with App Registration ID",