Skip to content

Instantly share code, notes, and snippets.

View deldersveld's full-sized avatar

David Eldersveld deldersveld

View GitHub Profile
Login-AzureRmAccount
$containerName = <<string containing container name>>
$storageContext = New-AzureStorageContext -ConnectionString <<connection string to storage account>>
$localDestinationPath = <<string containing file system path.>>
$blobPrefix = <<string containing prefix to search. wildcard character not needed after prefix.>>
#List
#Get-AzureStorageBlob -Context $storageContext -Container $containerName -Prefix $blobPrefix
@deldersveld
deldersveld / RemoveAzureBlobContainerByPrefix.ps1
Created January 3, 2018 17:03
Remove all blob containers and child blobs based on the specified container name prefix
Login-AzureRmAccount
$containerPrefix = <<string containing prefix to search. wildcard character not needed after prefix.>>
$storageContext = New-AzureStorageContext -ConnectionString <<connection string to storage account>>
Get-AzureStorageContainer -context $storageContext -prefix $containerPrefix | ForEach-Object {Remove-AzureStorageContainer -context $storageContext -Container $_.Name -Force}
@deldersveld
deldersveld / PowerBI-PercentOfGrandTotal
Created October 15, 2016 11:39
Some DAX snippets for % of Grand Total
//Single measure version
% of Total = DIVIDE(SUM('Sales'[Revenue]), CALCULATE(SUM('Sales'[Revenue]), ALLSELECTED('Product'[Category])))
//As traced in Power BI Quick Calc "% of Grand Total"
EVALUATE
TOPN(
1001,
SUMMARIZECOLUMNS(
'Product'[Category],
"M0", CALCULATE(
/*
double #map required for map to appear in FF,Edge,IE (and I have no idea why)
final map should appear as fixed 60% width
fixed for scrolling story pane
top 55px because it covers up the Export button in DevTools...
*/
#map {
position:absolute;
top:20px;
bottom:0;
@deldersveld
deldersveld / PowerBI-CustomHTMLTooltip
Last active March 7, 2017 18:14
Use this code in a Power BI calculated column to enhance the default tooltip in the ArcGIS Maps for Power BI visual
HTML Tooltip = "<img src='https://www.blue-granite.com/hs-fs/hub/257922/file-2333776730-png/IMG_2015/Blue-Granite-Logo.png' width='200px' /><br>" &
"<br>Reported: <em>" & Table1[OutageReported] & "</em>" &
"<br>Restoration Est: <em>" & Table1[RestorationEstimate] & "</em>" &
"<br><br><table bordercolor='#FFFFFF' cellspacing='8'><tr>" &
"<th style='color:#01B8AA;'>Customers Affected</th><th style='color:#01B8AA;'>Status</th></tr><tr>" &
"<td style='color:#" & IF(Table1[Number of Customers Affected] > 50,"DD0000","FFFFFF") & ";'>" & Table1[Number of Customers Affected] & "</td>" &
"<td>" & Table1[Status] & "</td></tr></table>"
@deldersveld
deldersveld / R-Syuzhet-Sentiment-for-Power-BI.R
Last active September 23, 2016 13:23
R script that compares sentence/phrase sentiment using various lexicons from the Syuzhet package. Script is geared toward Microsoft Power BI with the "dataset" data frame, but it can easily be adapted for any data frame.
bing.sentiment <- syuzhet::get_sentiment(as.vector(dataset$Text), method="bing")
afinn.sentiment <- syuzhet::get_sentiment(as.vector(dataset$Text), method="afinn")
nrc.sentiment <- syuzhet::get_sentiment(as.vector(dataset$Text), method="nrc")
raw <- cbind(bing.sentiment, afinn.sentiment, nrc.sentiment)
scaled <- scale(raw, center=TRUE)
colnames(scaled) <- c("bing.scaled", "afinn.scaled", "nrc.scaled")
sentiment.output <- cbind(dataset, raw, scaled)
@deldersveld
deldersveld / README.md
Last active May 3, 2016 13:46
stats tests
@deldersveld
deldersveld / README.md
Created March 11, 2016 02:19
fresh block