Skip to content

Instantly share code, notes, and snippets.

View stevedep's full-sized avatar

Steve de Peijper stevedep

View GitHub Profile
let
Source = Web.BrowserContents("https://www.autowereld.nl/info/mitsubishi/outlander/", [WaitFor = [Timeout = #duration(0,0,0,10)]]),
HtmlTable = Html.Table( Source, {{"Link", "a", each [Attributes][href]}}, [RowSelector=".item.model"]),
#"Replaced Value" = Table.ReplaceValue(HtmlTable,"/info/","https://www.autowereld.nl/info/",Replacer.ReplaceText,{"Link"}),
//Example = #"Replaced Value"[Link]{0},
fnGetDetails = (url) =>
let
OpenUrl = Web.BrowserContents(url),
HtmlTableDetails = Html.Table( OpenUrl, {{"Model", ".type"}, {"Price", ".price"}, {"Transmission", ".transmission"}, {"From", ".from"}, {"Until", ".until"}}, [RowSelector="a.item"])
let
Source = Json.Document(File.Contents("C:\Users\username\Downloads\eneco.json")),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"data"}, {"data"}),
#"Expanded data" = Table.ExpandRecordColumn(#"Expanded Column1", "data", {"metadata", "usages"}, {"data.metadata", "data.usages"}),
#"Expanded data.metadata" = Table.ExpandRecordColumn(#"Expanded data", "data.metadata", {"interval", "aggregation"}, {"data.metadata.interval", "data.metadata.aggregation"}),
#"Expanded data.usages" = Table.ExpandListColumn(#"Expanded data.metadata", "data.usages"),
#"Expanded data.usages1" = Table.ExpandRecordColumn(#"Expanded data.usages", "data.usages", {"period", "entries", "summary"}, {"data.usages.period", "data.usages.entries", "data.usages.summary"}),
#"Expanded data.usages.period" = Table.ExpandRecordColumn(#"Expanded data.usages1", "data.usages.period
Sub check_availability()
Dim myOlApp As New Outlook.Application
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set objApp = CreateObject("Outlook.Application")
'Set objItem = Outlook.Application.ActiveExplorer.Selection.Item(1)
Set objItem = objApp.ActiveInspector.CurrentItem
'Set objAttendees = Outlook.Application.ActiveExplorer.Selection.Item(1).Recipients
Set objAttendees = objItem.Recipients
Dim oCurrentUser As Recipient
Dim FreeBusy(20, 2) As String
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
from datetime import datetime
@stevedep
stevedep / visual.ts
Created October 9, 2022 06:21
for Loop
for (var i = 0; i < kpiVals.length; i++)
{
let selectionId: ISelectionId = this.host.createSelectionIdBuilder()
.withCategory(categorical.categories[kpiId], i)
.createSelectionId();
this.kpiDataPoints.push({
kpivalue : <string>kpiVals[i],
colour : (category.objects) ? category.objects[i] ? String(<Fill>(category.objects[i].colorSelector.fill['solid']['color'])) : "#FF0000" : "#FF0000", //objects is initially not present
highlight: (measurevals.highlights) ? (measurevals.highlights[i]) ? "Y" : "N" : "N",
@stevedep
stevedep / visual.ts
Created October 9, 2022 06:19
interface
interface kpiDataPoint {
index: number,
kpivalue: string,
selectionId: ISelectionId,
colour: string,
selector: any,
highlight: string
}
"dataViewMappings": [
{
"categorical": {
"categories": {
"select": [
{ "bind": {"to" : "kpi" }},
{ "bind": {"to" : "description" }},
{ "bind": {"to" : "tooltip" }}
]
},
@stevedep
stevedep / dataRoles
Last active October 9, 2022 05:29
dataRoles
"dataRoles": [
{
"displayName": "KPI",
"name": "kpi",
"kind": "Grouping"
},
{
"displayName": "Description",
"name": "description",
"kind": "Grouping"