[{"data":1,"prerenderedAt":1481},["Reactive",2],{"navigation":3,"/posts/w20-2022-tips-learned-this-week":204,"/posts/w20-2022-tips-learned-this-week-surround":1454},[4,192,200],{"title":5,"_path":6,"children":7,"icon":191},"Blog","/posts",[8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188],{"title":9,"_path":10},"Testing your API with REST Client","/posts/testing-your-api-with-rest-client",{"title":12,"_path":13},"HTML templating in Xamarin","/posts/html-templating-in-xamarin",{"title":15,"_path":16},"Goodbye Azure Portal, Welcome Azure CLI","/posts/welcome-azure-cli",{"title":18,"_path":19},"Coming across Gitpod","/posts/gitpod",{"title":21,"_path":22},"Handle token retrieval while querying an API","/posts/delegating-handler",{"title":24,"_path":25},"Clean up your local git branches.","/posts/cleaning-git-branches",{"title":27,"_path":28},"Automate configuration of Teams Tab SSO with PowerShell.","/posts/teams-sso-powershell",{"title":30,"_path":31},"How to do a technology watch? - Part 1","/posts/technology-watch-part1",{"title":33,"_path":34},"How to do a technology watch? - Part 2","/posts/technology-watch-part2",{"title":36,"_path":37},"You almost no longer need Key Vault references for Azure Functions.","/posts/azure-functions-custom-configuration",{"title":39,"_path":40},"How to do a technology watch? - Part 3","/posts/technology-watch-part3",{"title":42,"_path":43},"Forget DevOps, the future is already here!","/posts/devops-future",{"title":45,"_path":46},"Week 9, 2021 - Tips I learned this week","/posts/w09-2021-tips-learned-this-week",{"title":48,"_path":49},"Week 12, 2021 - Tips I learned this week","/posts/w12-2021-tips-learned-this-week",{"title":51,"_path":52},"Week 14, 2021 - Tips I learned this week","/posts/w14-2021-tips-learned-this-week",{"title":54,"_path":55},"Once upon a time in .NET","/posts/once-upon-a-time-in-dotnet",{"title":57,"_path":58},"Install your applications with winget","/posts/winget-import",{"title":60,"_path":61},"Customize your applications when installing them with winget","/posts/winget-override",{"title":63,"_path":64},"Week 22, 2021 - Tips I learned this week","/posts/w22-2021-tips-learned-this-week",{"title":66,"_path":67},"How to connect to an Azure SQL Database from C# using Azure AD","/posts/sqlclient-active-directory-authent",{"title":69,"_path":70},"Producing packages for Windows Package Manager","/posts/wingetcreate",{"title":72,"_path":73},"4 tips about GitHub Actions environment variables and contexts","/posts/github-actions-var-and-context",{"title":75,"_path":76},"AzureWebJobsStorage, the secret you don't need in your Function App.","/posts/azure-functions-without-azurewebjobsstorage",{"title":78,"_path":79},"ASP.NET Core - Lost in configuration","/posts/lost-in-configuration",{"title":81,"_path":82},"Week 39, 2021 - Tips I learned this week","/posts/w39-2021-tips-learned-this-week",{"title":84,"_path":85},"Week 41, 2021 - Tips I learned this week","/posts/w41-2021-tips-learned-this-week",{"title":87,"_path":88},"Migrating and open-sourcing my blog","/posts/migrating-blog",{"title":90,"_path":91},"Week 45, 2021 - Tips I learned this week","/posts/w45-2021-tips-learned-this-week",{"title":93,"_path":94},"Organize your GitHub stars with Astral","/posts/astral",{"title":96,"_path":97},"Pulumi with an Azure Blob Storage backend","/posts/pulumi-azure-backend",{"title":99,"_path":100},"IaC Hot Reload with Pulumi Watch","/posts/pulumi-watch",{"title":102,"_path":103},"Week 2, 2022 - Tips I learned this week","/posts/w02-2022-tips-learned-this-week",{"title":105,"_path":106},"Week 3, 2022 - Tips I learned this week","/posts/w03-2022-tips-learned-this-week",{"title":108,"_path":109},"Week 5, 2022 - Tips I learned this week","/posts/w05-2022-tips-learned-this-week",{"title":111,"_path":112},"How to provision an Azure SQL Database with Active Directory authentication","/posts/sqldatabase-active-directory-authent",{"title":114,"_path":115},"Why will I choose Pulumi over Terraform for my next project?","/posts/pulumi-vs-terraform",{"title":117,"_path":118},"Week 19, 2022 - Tips I learned this week","/posts/w19-2022-tips-learned-this-week",{"title":120,"_path":121},"Week 20, 2022 - Tips I learned this week","/posts/w20-2022-tips-learned-this-week",{"title":123,"_path":124},"Keeping secrets secure when using API Clients","/posts/http-clients-secrets",{"title":126,"_path":127},"What made me want to be a developer?","/posts/be-a-developer",{"title":129,"_path":130},"What can we do when stuck with a programming problem?","/posts/get-unstuck",{"title":132,"_path":133},"How did I automate the setup of my developer Windows laptop?","/posts/automate-developer-machine",{"title":135,"_path":136},"Discussion about API clients","/posts/http-clients",{"title":138,"_path":139},"Week 46, 2022 - Tips I learned this week","/posts/w46-2022-tips-learned-this-week",{"title":141,"_path":142},"When Pulumi met Nuke: a .NET love story","/posts/when-pulumi-met-nuke",{"title":144,"_path":145},"A year of learning and sharing - Dev Retro 2022","/posts/2022-retro",{"title":147,"_path":148},"Perform Dynamic Execution of an npm Package","/posts/pnpm-dlx",{"title":150,"_path":151},"Manage multiple Node.js versions","/posts/pnpm-env",{"title":153,"_path":154},"Introducing the Vue.js CI/CD series","/posts/vuecicd-introduction",{"title":156,"_path":157},"Execute commands using your project dependencies","/posts/pnpm-exec",{"title":159,"_path":160},"Vue.js CI/CD: Continuous Integration","/posts/vuecicd-ci",{"title":162,"_path":163},"Who is using pnpm?","/posts/pnpm-who-is-using",{"title":165,"_path":166},"Create an Azure-Ready GitHub Repository using Pulumi","/posts/azure-ready-github-repository",{"title":168,"_path":169},"Deploying to Azure from Azure DevOps without secrets","/posts/ado-workload-identity-federation",{"title":171,"_path":172},"Effortlessly Configure GitHub Repositories for Azure Deployment via OIDC","/posts/scripting-azure-ready-github-repository",{"title":174,"_path":175},"Playing with the .NET 8 Web API template","/posts/playing-with-dotnet8",{"title":177,"_path":178},"Another year of sharing and learning - Dev Retro 2023","/posts/2023-retro",{"title":180,"_path":181},"Week 4, 2024 - Tips I learned this week","/posts/w04-2024-tips-learned-this-week",{"title":183,"_path":184},"Using dependency injection with Azure .NET SDK","/posts/azure-sdk-di",{"title":186,"_path":187},"Having Fun With IT Event Calendars","/posts/it-event-calendars",{"title":189,"_path":190},"Call your Azure AD B2C protected API with authenticated HTTP requests from your JetBrains IDE","/posts/http-clients-oauth2","i-heroicons-newspaper",{"title":193,"_path":194,"children":195,"icon":199},"Goodies","/goodies",[196],{"title":197,"_path":198},"My Git Cheat Sheet","/goodies/gitcheatsheet","i-heroicons-gift-solid",{"title":201,"_path":202,"icon":203},"About","/about","i-heroicons-user-circle-solid",{"_path":121,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":120,"description":208,"lead":208,"date":209,"image":210,"badge":212,"tags":214,"body":220,"_type":1449,"_id":1450,"_source":1451,"_file":1452,"_extension":1453},"posts",false,"","The \"this\" in TypeScript, a must-have tool for Durable Functions, and a new git alias.","2022-05-23T00:00:00.000Z",{"src":211},"/images/surface_1.jpg",{"label":213},"Tips",[215,216,217,218,219],"tips learned this week","TypeScript","git","Azure Functions","tooling",{"type":221,"children":222,"toc":1443},"root",[223,239,261,266,522,558,584,695,707,729,842,875,1281,1287,1301,1310,1322,1332,1338,1352,1397,1432,1437],{"type":224,"tag":225,"props":226,"children":228},"element","h2",{"id":227},"reminder-for-my-future-self-dont-forget-about-this-in-ts",[229,232],{"type":230,"value":231},"text","Reminder for my future self: don't forget about \"this\" in ",{"type":224,"tag":233,"props":234,"children":236},"code",{"className":235},[],[237],{"type":230,"value":238},"ts",{"type":224,"tag":240,"props":241,"children":242},"p",{},[243,245,251,253,259],{"type":230,"value":244},"Once again, I found myself forgetting that ",{"type":224,"tag":233,"props":246,"children":248},{"className":247},[],[249],{"type":230,"value":250},"this",{"type":230,"value":252}," can lose context in JavaScript/TypeScript which results in exceptions because ",{"type":224,"tag":233,"props":254,"children":256},{"className":255},[],[257],{"type":230,"value":258},"this ",{"type":230,"value":260}," is undefined. This is probably obvious for most developers but this is not a case I come across often so it's better to write it down so that I have something to refer to next time.",{"type":224,"tag":240,"props":262,"children":263},{},[264],{"type":230,"value":265},"Let's take an example:",{"type":224,"tag":267,"props":268,"children":271},"pre",{"className":269,"code":270,"language":238,"meta":207,"style":207},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","class AudioBook {\n    private isStarted = false;\n\n    constructor(public title: string) {\n    }\n    \n    play() {\n        this.isStarted = true;\n    }\n\n    stop() {\n        this.isStarted = false;\n    }\n}\n",[272],{"type":224,"tag":233,"props":273,"children":274},{"__ignoreMap":207},[275,299,330,340,384,393,403,421,448,456,464,481,505,513],{"type":224,"tag":276,"props":277,"children":280},"span",{"class":278,"line":279},"line",1,[281,287,293],{"type":224,"tag":276,"props":282,"children":284},{"style":283},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[285],{"type":230,"value":286},"class",{"type":224,"tag":276,"props":288,"children":290},{"style":289},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[291],{"type":230,"value":292}," AudioBook",{"type":224,"tag":276,"props":294,"children":296},{"style":295},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[297],{"type":230,"value":298}," {\n",{"type":224,"tag":276,"props":300,"children":302},{"class":278,"line":301},2,[303,308,314,319,325],{"type":224,"tag":276,"props":304,"children":305},{"style":283},[306],{"type":230,"value":307},"    private",{"type":224,"tag":276,"props":309,"children":311},{"style":310},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[312],{"type":230,"value":313}," isStarted",{"type":224,"tag":276,"props":315,"children":316},{"style":295},[317],{"type":230,"value":318}," =",{"type":224,"tag":276,"props":320,"children":322},{"style":321},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[323],{"type":230,"value":324}," false",{"type":224,"tag":276,"props":326,"children":327},{"style":295},[328],{"type":230,"value":329},";\n",{"type":224,"tag":276,"props":331,"children":333},{"class":278,"line":332},3,[334],{"type":224,"tag":276,"props":335,"children":337},{"emptyLinePlaceholder":336},true,[338],{"type":230,"value":339},"\n",{"type":224,"tag":276,"props":341,"children":343},{"class":278,"line":342},4,[344,349,354,359,365,370,375,380],{"type":224,"tag":276,"props":345,"children":346},{"style":283},[347],{"type":230,"value":348},"    constructor",{"type":224,"tag":276,"props":350,"children":351},{"style":295},[352],{"type":230,"value":353},"(",{"type":224,"tag":276,"props":355,"children":356},{"style":283},[357],{"type":230,"value":358},"public",{"type":224,"tag":276,"props":360,"children":362},{"style":361},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[363],{"type":230,"value":364}," title",{"type":224,"tag":276,"props":366,"children":367},{"style":295},[368],{"type":230,"value":369},":",{"type":224,"tag":276,"props":371,"children":372},{"style":289},[373],{"type":230,"value":374}," string",{"type":224,"tag":276,"props":376,"children":377},{"style":295},[378],{"type":230,"value":379},")",{"type":224,"tag":276,"props":381,"children":382},{"style":295},[383],{"type":230,"value":298},{"type":224,"tag":276,"props":385,"children":387},{"class":278,"line":386},5,[388],{"type":224,"tag":276,"props":389,"children":390},{"style":295},[391],{"type":230,"value":392},"    }\n",{"type":224,"tag":276,"props":394,"children":396},{"class":278,"line":395},6,[397],{"type":224,"tag":276,"props":398,"children":400},{"style":399},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[401],{"type":230,"value":402},"    \n",{"type":224,"tag":276,"props":404,"children":406},{"class":278,"line":405},7,[407,412,417],{"type":224,"tag":276,"props":408,"children":409},{"style":310},[410],{"type":230,"value":411},"    play",{"type":224,"tag":276,"props":413,"children":414},{"style":295},[415],{"type":230,"value":416},"()",{"type":224,"tag":276,"props":418,"children":419},{"style":295},[420],{"type":230,"value":298},{"type":224,"tag":276,"props":422,"children":424},{"class":278,"line":423},8,[425,430,435,439,444],{"type":224,"tag":276,"props":426,"children":427},{"style":295},[428],{"type":230,"value":429},"        this.",{"type":224,"tag":276,"props":431,"children":432},{"style":399},[433],{"type":230,"value":434},"isStarted",{"type":224,"tag":276,"props":436,"children":437},{"style":295},[438],{"type":230,"value":318},{"type":224,"tag":276,"props":440,"children":441},{"style":321},[442],{"type":230,"value":443}," true",{"type":224,"tag":276,"props":445,"children":446},{"style":295},[447],{"type":230,"value":329},{"type":224,"tag":276,"props":449,"children":451},{"class":278,"line":450},9,[452],{"type":224,"tag":276,"props":453,"children":454},{"style":295},[455],{"type":230,"value":392},{"type":224,"tag":276,"props":457,"children":459},{"class":278,"line":458},10,[460],{"type":224,"tag":276,"props":461,"children":462},{"emptyLinePlaceholder":336},[463],{"type":230,"value":339},{"type":224,"tag":276,"props":465,"children":467},{"class":278,"line":466},11,[468,473,477],{"type":224,"tag":276,"props":469,"children":470},{"style":310},[471],{"type":230,"value":472},"    stop",{"type":224,"tag":276,"props":474,"children":475},{"style":295},[476],{"type":230,"value":416},{"type":224,"tag":276,"props":478,"children":479},{"style":295},[480],{"type":230,"value":298},{"type":224,"tag":276,"props":482,"children":484},{"class":278,"line":483},12,[485,489,493,497,501],{"type":224,"tag":276,"props":486,"children":487},{"style":295},[488],{"type":230,"value":429},{"type":224,"tag":276,"props":490,"children":491},{"style":399},[492],{"type":230,"value":434},{"type":224,"tag":276,"props":494,"children":495},{"style":295},[496],{"type":230,"value":318},{"type":224,"tag":276,"props":498,"children":499},{"style":321},[500],{"type":230,"value":324},{"type":224,"tag":276,"props":502,"children":503},{"style":295},[504],{"type":230,"value":329},{"type":224,"tag":276,"props":506,"children":508},{"class":278,"line":507},13,[509],{"type":224,"tag":276,"props":510,"children":511},{"style":295},[512],{"type":230,"value":392},{"type":224,"tag":276,"props":514,"children":516},{"class":278,"line":515},14,[517],{"type":224,"tag":276,"props":518,"children":519},{"style":295},[520],{"type":230,"value":521},"}\n",{"type":224,"tag":240,"props":523,"children":524},{},[525,527,533,535,540,542,548,550,556],{"type":230,"value":526},"This is a class ",{"type":224,"tag":233,"props":528,"children":530},{"className":529},[],[531],{"type":230,"value":532},"AudioBook",{"type":230,"value":534}," that has a private boolean field ",{"type":224,"tag":233,"props":536,"children":538},{"className":537},[],[539],{"type":230,"value":434},{"type":230,"value":541}," that is modified by the two methods ",{"type":224,"tag":233,"props":543,"children":545},{"className":544},[],[546],{"type":230,"value":547},"play",{"type":230,"value":549}," and ",{"type":224,"tag":233,"props":551,"children":553},{"className":552},[],[554],{"type":230,"value":555},"stop",{"type":230,"value":557},".",{"type":224,"tag":240,"props":559,"children":560},{},[561,563,568,570,575,577,582],{"type":230,"value":562},"If I create an instance of ",{"type":224,"tag":233,"props":564,"children":566},{"className":565},[],[567],{"type":230,"value":532},{"type":230,"value":569}," and I want to assign the ",{"type":224,"tag":233,"props":571,"children":573},{"className":572},[],[574],{"type":230,"value":547},{"type":230,"value":576}," function to a variable, an exception will occur when the function is run because ",{"type":224,"tag":233,"props":578,"children":580},{"className":579},[],[581],{"type":230,"value":250},{"type":230,"value":583}," will be undefined.",{"type":224,"tag":267,"props":585,"children":587},{"className":269,"code":586,"language":238,"meta":207,"style":207},"const audioBook = new AudioBook(\"The Unicorn Project\");\nconst listenDevOpsBook = audioBook.play;\nlistenDevOpsBook();\n",[588],{"type":224,"tag":233,"props":589,"children":590},{"__ignoreMap":207},[591,646,679],{"type":224,"tag":276,"props":592,"children":593},{"class":278,"line":279},[594,599,604,609,614,619,623,628,634,638,642],{"type":224,"tag":276,"props":595,"children":596},{"style":283},[597],{"type":230,"value":598},"const",{"type":224,"tag":276,"props":600,"children":601},{"style":399},[602],{"type":230,"value":603}," audioBook ",{"type":224,"tag":276,"props":605,"children":606},{"style":295},[607],{"type":230,"value":608},"=",{"type":224,"tag":276,"props":610,"children":611},{"style":295},[612],{"type":230,"value":613}," new",{"type":224,"tag":276,"props":615,"children":617},{"style":616},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[618],{"type":230,"value":292},{"type":224,"tag":276,"props":620,"children":621},{"style":399},[622],{"type":230,"value":353},{"type":224,"tag":276,"props":624,"children":625},{"style":295},[626],{"type":230,"value":627},"\"",{"type":224,"tag":276,"props":629,"children":631},{"style":630},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[632],{"type":230,"value":633},"The Unicorn Project",{"type":224,"tag":276,"props":635,"children":636},{"style":295},[637],{"type":230,"value":627},{"type":224,"tag":276,"props":639,"children":640},{"style":399},[641],{"type":230,"value":379},{"type":224,"tag":276,"props":643,"children":644},{"style":295},[645],{"type":230,"value":329},{"type":224,"tag":276,"props":647,"children":648},{"class":278,"line":301},[649,653,658,662,667,671,675],{"type":224,"tag":276,"props":650,"children":651},{"style":283},[652],{"type":230,"value":598},{"type":224,"tag":276,"props":654,"children":655},{"style":399},[656],{"type":230,"value":657}," listenDevOpsBook ",{"type":224,"tag":276,"props":659,"children":660},{"style":295},[661],{"type":230,"value":608},{"type":224,"tag":276,"props":663,"children":664},{"style":399},[665],{"type":230,"value":666}," audioBook",{"type":224,"tag":276,"props":668,"children":669},{"style":295},[670],{"type":230,"value":557},{"type":224,"tag":276,"props":672,"children":673},{"style":399},[674],{"type":230,"value":547},{"type":224,"tag":276,"props":676,"children":677},{"style":295},[678],{"type":230,"value":329},{"type":224,"tag":276,"props":680,"children":681},{"class":278,"line":332},[682,687,691],{"type":224,"tag":276,"props":683,"children":684},{"style":616},[685],{"type":230,"value":686},"listenDevOpsBook",{"type":224,"tag":276,"props":688,"children":689},{"style":399},[690],{"type":230,"value":416},{"type":224,"tag":276,"props":692,"children":693},{"style":295},[694],{"type":230,"value":329},{"type":224,"tag":240,"props":696,"children":697},{},[698],{"type":224,"tag":699,"props":700,"children":706},"img",{"alt":701,"className":702,"src":705},"JavaScript Failed error in console output.",[703,704],"rounded-lg","mx-auto","/posts/images/w202022tips_this_1.png",[],{"type":224,"tag":240,"props":708,"children":709},{},[710,712,721,723,728],{"type":230,"value":711},"The solution to avoid that is to use the ",{"type":224,"tag":713,"props":714,"children":718},"a",{"href":715,"rel":716},"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind",[717],"nofollow",[719],{"type":230,"value":720},"bind",{"type":230,"value":722}," function to specify the object to use as ",{"type":224,"tag":233,"props":724,"children":726},{"className":725},[],[727],{"type":230,"value":250},{"type":230,"value":557},{"type":224,"tag":267,"props":730,"children":732},{"className":269,"code":731,"language":238,"meta":207,"style":207},"const audioBook = new AudioBook(\"The Unicorn Project\");\nconst listenDevOpsBook = audioBook.play.bind(audioBook);\nlistenDevOpsBook();\n",[733],{"type":224,"tag":233,"props":734,"children":735},{"__ignoreMap":207},[736,783,827],{"type":224,"tag":276,"props":737,"children":738},{"class":278,"line":279},[739,743,747,751,755,759,763,767,771,775,779],{"type":224,"tag":276,"props":740,"children":741},{"style":283},[742],{"type":230,"value":598},{"type":224,"tag":276,"props":744,"children":745},{"style":399},[746],{"type":230,"value":603},{"type":224,"tag":276,"props":748,"children":749},{"style":295},[750],{"type":230,"value":608},{"type":224,"tag":276,"props":752,"children":753},{"style":295},[754],{"type":230,"value":613},{"type":224,"tag":276,"props":756,"children":757},{"style":616},[758],{"type":230,"value":292},{"type":224,"tag":276,"props":760,"children":761},{"style":399},[762],{"type":230,"value":353},{"type":224,"tag":276,"props":764,"children":765},{"style":295},[766],{"type":230,"value":627},{"type":224,"tag":276,"props":768,"children":769},{"style":630},[770],{"type":230,"value":633},{"type":224,"tag":276,"props":772,"children":773},{"style":295},[774],{"type":230,"value":627},{"type":224,"tag":276,"props":776,"children":777},{"style":399},[778],{"type":230,"value":379},{"type":224,"tag":276,"props":780,"children":781},{"style":295},[782],{"type":230,"value":329},{"type":224,"tag":276,"props":784,"children":785},{"class":278,"line":301},[786,790,794,798,802,806,810,814,818,823],{"type":224,"tag":276,"props":787,"children":788},{"style":283},[789],{"type":230,"value":598},{"type":224,"tag":276,"props":791,"children":792},{"style":399},[793],{"type":230,"value":657},{"type":224,"tag":276,"props":795,"children":796},{"style":295},[797],{"type":230,"value":608},{"type":224,"tag":276,"props":799,"children":800},{"style":399},[801],{"type":230,"value":666},{"type":224,"tag":276,"props":803,"children":804},{"style":295},[805],{"type":230,"value":557},{"type":224,"tag":276,"props":807,"children":808},{"style":399},[809],{"type":230,"value":547},{"type":224,"tag":276,"props":811,"children":812},{"style":295},[813],{"type":230,"value":557},{"type":224,"tag":276,"props":815,"children":816},{"style":616},[817],{"type":230,"value":720},{"type":224,"tag":276,"props":819,"children":820},{"style":399},[821],{"type":230,"value":822},"(audioBook)",{"type":224,"tag":276,"props":824,"children":825},{"style":295},[826],{"type":230,"value":329},{"type":224,"tag":276,"props":828,"children":829},{"class":278,"line":332},[830,834,838],{"type":224,"tag":276,"props":831,"children":832},{"style":616},[833],{"type":230,"value":686},{"type":224,"tag":276,"props":835,"children":836},{"style":399},[837],{"type":230,"value":416},{"type":224,"tag":276,"props":839,"children":840},{"style":295},[841],{"type":230,"value":329},{"type":224,"tag":240,"props":843,"children":844},{},[845,847,852,854,859,861,866,868,873],{"type":230,"value":846},"To avoid having to use bind everywhere the ",{"type":224,"tag":233,"props":848,"children":850},{"className":849},[],[851],{"type":230,"value":547},{"type":230,"value":853}," or the ",{"type":224,"tag":233,"props":855,"children":857},{"className":856},[],[858],{"type":230,"value":555},{"type":230,"value":860}," methods are used, we can do the ",{"type":224,"tag":233,"props":862,"children":864},{"className":863},[],[865],{"type":230,"value":720},{"type":230,"value":867}," thing directly in the constructor of the ",{"type":224,"tag":233,"props":869,"children":871},{"className":870},[],[872],{"type":230,"value":532},{"type":230,"value":874}," class.",{"type":224,"tag":267,"props":876,"children":878},{"className":269,"code":877,"language":238,"meta":207,"style":207},"class AudioBook {\n    private isStarted = false;\n\n    constructor(public title: string) {\n        this.play = this.play.bind(this);\n        this.stop = this.stop.bind(this);\n    }\n    \n    play() {\n        this.isStarted = true;\n    }\n\n    stop() {\n        this.isStarted = false;\n    }\n}\n\nconst audioBook = new AudioBook(\"The Unicorn Project\");\nconst listenDevOpsBook = audioBook.play;\nlistenDevOpsBook();\n",[879],{"type":224,"tag":233,"props":880,"children":881},{"__ignoreMap":207},[882,897,920,927,962,1010,1057,1064,1071,1086,1109,1116,1123,1138,1161,1169,1177,1185,1233,1265],{"type":224,"tag":276,"props":883,"children":884},{"class":278,"line":279},[885,889,893],{"type":224,"tag":276,"props":886,"children":887},{"style":283},[888],{"type":230,"value":286},{"type":224,"tag":276,"props":890,"children":891},{"style":289},[892],{"type":230,"value":292},{"type":224,"tag":276,"props":894,"children":895},{"style":295},[896],{"type":230,"value":298},{"type":224,"tag":276,"props":898,"children":899},{"class":278,"line":301},[900,904,908,912,916],{"type":224,"tag":276,"props":901,"children":902},{"style":283},[903],{"type":230,"value":307},{"type":224,"tag":276,"props":905,"children":906},{"style":310},[907],{"type":230,"value":313},{"type":224,"tag":276,"props":909,"children":910},{"style":295},[911],{"type":230,"value":318},{"type":224,"tag":276,"props":913,"children":914},{"style":321},[915],{"type":230,"value":324},{"type":224,"tag":276,"props":917,"children":918},{"style":295},[919],{"type":230,"value":329},{"type":224,"tag":276,"props":921,"children":922},{"class":278,"line":332},[923],{"type":224,"tag":276,"props":924,"children":925},{"emptyLinePlaceholder":336},[926],{"type":230,"value":339},{"type":224,"tag":276,"props":928,"children":929},{"class":278,"line":342},[930,934,938,942,946,950,954,958],{"type":224,"tag":276,"props":931,"children":932},{"style":283},[933],{"type":230,"value":348},{"type":224,"tag":276,"props":935,"children":936},{"style":295},[937],{"type":230,"value":353},{"type":224,"tag":276,"props":939,"children":940},{"style":283},[941],{"type":230,"value":358},{"type":224,"tag":276,"props":943,"children":944},{"style":361},[945],{"type":230,"value":364},{"type":224,"tag":276,"props":947,"children":948},{"style":295},[949],{"type":230,"value":369},{"type":224,"tag":276,"props":951,"children":952},{"style":289},[953],{"type":230,"value":374},{"type":224,"tag":276,"props":955,"children":956},{"style":295},[957],{"type":230,"value":379},{"type":224,"tag":276,"props":959,"children":960},{"style":295},[961],{"type":230,"value":298},{"type":224,"tag":276,"props":963,"children":964},{"class":278,"line":386},[965,969,973,977,982,986,990,994,998,1002,1006],{"type":224,"tag":276,"props":966,"children":967},{"style":295},[968],{"type":230,"value":429},{"type":224,"tag":276,"props":970,"children":971},{"style":399},[972],{"type":230,"value":547},{"type":224,"tag":276,"props":974,"children":975},{"style":295},[976],{"type":230,"value":318},{"type":224,"tag":276,"props":978,"children":979},{"style":295},[980],{"type":230,"value":981}," this.",{"type":224,"tag":276,"props":983,"children":984},{"style":399},[985],{"type":230,"value":547},{"type":224,"tag":276,"props":987,"children":988},{"style":295},[989],{"type":230,"value":557},{"type":224,"tag":276,"props":991,"children":992},{"style":616},[993],{"type":230,"value":720},{"type":224,"tag":276,"props":995,"children":996},{"style":310},[997],{"type":230,"value":353},{"type":224,"tag":276,"props":999,"children":1000},{"style":295},[1001],{"type":230,"value":250},{"type":224,"tag":276,"props":1003,"children":1004},{"style":310},[1005],{"type":230,"value":379},{"type":224,"tag":276,"props":1007,"children":1008},{"style":295},[1009],{"type":230,"value":329},{"type":224,"tag":276,"props":1011,"children":1012},{"class":278,"line":395},[1013,1017,1021,1025,1029,1033,1037,1041,1045,1049,1053],{"type":224,"tag":276,"props":1014,"children":1015},{"style":295},[1016],{"type":230,"value":429},{"type":224,"tag":276,"props":1018,"children":1019},{"style":399},[1020],{"type":230,"value":555},{"type":224,"tag":276,"props":1022,"children":1023},{"style":295},[1024],{"type":230,"value":318},{"type":224,"tag":276,"props":1026,"children":1027},{"style":295},[1028],{"type":230,"value":981},{"type":224,"tag":276,"props":1030,"children":1031},{"style":399},[1032],{"type":230,"value":555},{"type":224,"tag":276,"props":1034,"children":1035},{"style":295},[1036],{"type":230,"value":557},{"type":224,"tag":276,"props":1038,"children":1039},{"style":616},[1040],{"type":230,"value":720},{"type":224,"tag":276,"props":1042,"children":1043},{"style":310},[1044],{"type":230,"value":353},{"type":224,"tag":276,"props":1046,"children":1047},{"style":295},[1048],{"type":230,"value":250},{"type":224,"tag":276,"props":1050,"children":1051},{"style":310},[1052],{"type":230,"value":379},{"type":224,"tag":276,"props":1054,"children":1055},{"style":295},[1056],{"type":230,"value":329},{"type":224,"tag":276,"props":1058,"children":1059},{"class":278,"line":405},[1060],{"type":224,"tag":276,"props":1061,"children":1062},{"style":295},[1063],{"type":230,"value":392},{"type":224,"tag":276,"props":1065,"children":1066},{"class":278,"line":423},[1067],{"type":224,"tag":276,"props":1068,"children":1069},{"style":399},[1070],{"type":230,"value":402},{"type":224,"tag":276,"props":1072,"children":1073},{"class":278,"line":450},[1074,1078,1082],{"type":224,"tag":276,"props":1075,"children":1076},{"style":310},[1077],{"type":230,"value":411},{"type":224,"tag":276,"props":1079,"children":1080},{"style":295},[1081],{"type":230,"value":416},{"type":224,"tag":276,"props":1083,"children":1084},{"style":295},[1085],{"type":230,"value":298},{"type":224,"tag":276,"props":1087,"children":1088},{"class":278,"line":458},[1089,1093,1097,1101,1105],{"type":224,"tag":276,"props":1090,"children":1091},{"style":295},[1092],{"type":230,"value":429},{"type":224,"tag":276,"props":1094,"children":1095},{"style":399},[1096],{"type":230,"value":434},{"type":224,"tag":276,"props":1098,"children":1099},{"style":295},[1100],{"type":230,"value":318},{"type":224,"tag":276,"props":1102,"children":1103},{"style":321},[1104],{"type":230,"value":443},{"type":224,"tag":276,"props":1106,"children":1107},{"style":295},[1108],{"type":230,"value":329},{"type":224,"tag":276,"props":1110,"children":1111},{"class":278,"line":466},[1112],{"type":224,"tag":276,"props":1113,"children":1114},{"style":295},[1115],{"type":230,"value":392},{"type":224,"tag":276,"props":1117,"children":1118},{"class":278,"line":483},[1119],{"type":224,"tag":276,"props":1120,"children":1121},{"emptyLinePlaceholder":336},[1122],{"type":230,"value":339},{"type":224,"tag":276,"props":1124,"children":1125},{"class":278,"line":507},[1126,1130,1134],{"type":224,"tag":276,"props":1127,"children":1128},{"style":310},[1129],{"type":230,"value":472},{"type":224,"tag":276,"props":1131,"children":1132},{"style":295},[1133],{"type":230,"value":416},{"type":224,"tag":276,"props":1135,"children":1136},{"style":295},[1137],{"type":230,"value":298},{"type":224,"tag":276,"props":1139,"children":1140},{"class":278,"line":515},[1141,1145,1149,1153,1157],{"type":224,"tag":276,"props":1142,"children":1143},{"style":295},[1144],{"type":230,"value":429},{"type":224,"tag":276,"props":1146,"children":1147},{"style":399},[1148],{"type":230,"value":434},{"type":224,"tag":276,"props":1150,"children":1151},{"style":295},[1152],{"type":230,"value":318},{"type":224,"tag":276,"props":1154,"children":1155},{"style":321},[1156],{"type":230,"value":324},{"type":224,"tag":276,"props":1158,"children":1159},{"style":295},[1160],{"type":230,"value":329},{"type":224,"tag":276,"props":1162,"children":1164},{"class":278,"line":1163},15,[1165],{"type":224,"tag":276,"props":1166,"children":1167},{"style":295},[1168],{"type":230,"value":392},{"type":224,"tag":276,"props":1170,"children":1172},{"class":278,"line":1171},16,[1173],{"type":224,"tag":276,"props":1174,"children":1175},{"style":295},[1176],{"type":230,"value":521},{"type":224,"tag":276,"props":1178,"children":1180},{"class":278,"line":1179},17,[1181],{"type":224,"tag":276,"props":1182,"children":1183},{"emptyLinePlaceholder":336},[1184],{"type":230,"value":339},{"type":224,"tag":276,"props":1186,"children":1188},{"class":278,"line":1187},18,[1189,1193,1197,1201,1205,1209,1213,1217,1221,1225,1229],{"type":224,"tag":276,"props":1190,"children":1191},{"style":283},[1192],{"type":230,"value":598},{"type":224,"tag":276,"props":1194,"children":1195},{"style":399},[1196],{"type":230,"value":603},{"type":224,"tag":276,"props":1198,"children":1199},{"style":295},[1200],{"type":230,"value":608},{"type":224,"tag":276,"props":1202,"children":1203},{"style":295},[1204],{"type":230,"value":613},{"type":224,"tag":276,"props":1206,"children":1207},{"style":616},[1208],{"type":230,"value":292},{"type":224,"tag":276,"props":1210,"children":1211},{"style":399},[1212],{"type":230,"value":353},{"type":224,"tag":276,"props":1214,"children":1215},{"style":295},[1216],{"type":230,"value":627},{"type":224,"tag":276,"props":1218,"children":1219},{"style":630},[1220],{"type":230,"value":633},{"type":224,"tag":276,"props":1222,"children":1223},{"style":295},[1224],{"type":230,"value":627},{"type":224,"tag":276,"props":1226,"children":1227},{"style":399},[1228],{"type":230,"value":379},{"type":224,"tag":276,"props":1230,"children":1231},{"style":295},[1232],{"type":230,"value":329},{"type":224,"tag":276,"props":1234,"children":1236},{"class":278,"line":1235},19,[1237,1241,1245,1249,1253,1257,1261],{"type":224,"tag":276,"props":1238,"children":1239},{"style":283},[1240],{"type":230,"value":598},{"type":224,"tag":276,"props":1242,"children":1243},{"style":399},[1244],{"type":230,"value":657},{"type":224,"tag":276,"props":1246,"children":1247},{"style":295},[1248],{"type":230,"value":608},{"type":224,"tag":276,"props":1250,"children":1251},{"style":399},[1252],{"type":230,"value":666},{"type":224,"tag":276,"props":1254,"children":1255},{"style":295},[1256],{"type":230,"value":557},{"type":224,"tag":276,"props":1258,"children":1259},{"style":399},[1260],{"type":230,"value":547},{"type":224,"tag":276,"props":1262,"children":1263},{"style":295},[1264],{"type":230,"value":329},{"type":224,"tag":276,"props":1266,"children":1268},{"class":278,"line":1267},20,[1269,1273,1277],{"type":224,"tag":276,"props":1270,"children":1271},{"style":616},[1272],{"type":230,"value":686},{"type":224,"tag":276,"props":1274,"children":1275},{"style":399},[1276],{"type":230,"value":416},{"type":224,"tag":276,"props":1278,"children":1279},{"style":295},[1280],{"type":230,"value":329},{"type":224,"tag":225,"props":1282,"children":1284},{"id":1283},"tool-of-the-week-durable-functions-monitor",[1285],{"type":230,"value":1286},"Tool of the week: Durable Functions Monitor ⚡",{"type":224,"tag":240,"props":1288,"children":1289},{},[1290,1292,1299],{"type":230,"value":1291},"If you are an Azure developer, you are probably already familiar with Azure Functions which is one of the solutions to do serverless in Azure. And, you may also have used Durable Functions to build serverless workflows. If I quote ",{"type":224,"tag":713,"props":1293,"children":1296},{"href":1294,"rel":1295},"https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp",[717],[1297],{"type":230,"value":1298},"Microsoft documentation",{"type":230,"value":1300},": \"Durable Functions is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment.\" In concrete terms, if you are developing multiple Azure Functions and you want to orchestrate their execution while maintaining a state, Durable Functions are what you need. I like this technology a lot ❤️. When used correctly and for the right purpose, it can solve many issues you would face to implementing manually a workflow. Enough talk, let's go back to the tool of the week!",{"type":224,"tag":240,"props":1302,"children":1303},{},[1304],{"type":224,"tag":699,"props":1305,"children":1309},{"alt":1306,"className":1307,"src":1308},"GitHub README of the Durable Functions Monitor project.",[703,704],"/posts/images/w202022tips_durablemonitor_1.png",[],{"type":224,"tag":240,"props":1311,"children":1312},{},[1313,1320],{"type":224,"tag":713,"props":1314,"children":1317},{"href":1315,"rel":1316},"https://github.com/microsoft/DurableFunctionsMonitor",[717],[1318],{"type":230,"value":1319},"Durable Functions Monitor",{"type":230,"value":1321}," is a UI tool that allows you to monitor, manage and debug your Azure Durable Functions. That's something very valuable because the tooling in Azure Portal is very poor for Durable Functions. Moreover, because a workflow can last for a long time and is often composed of many Azure Functions, it can be quite hard to understand at what stage the workflow is and what functions have already been executed 🤔. Durable Functions can help you with that and offers many other interesting features (functions graph, sequence diagram...). I heard about it a while ago but did not take the time to try it until recently and honestly it's too bad because it's a must-have to work with Azure Durable Functions 🚀!",{"type":224,"tag":1323,"props":1324,"children":1326},"callout",{"icon":1325},"i-heroicons-light-bulb",[1327],{"type":224,"tag":240,"props":1328,"children":1329},{},[1330],{"type":230,"value":1331},"It's worth noting that Durable Functions Monitor can be used as a vscode extension, as a Standalone service, or directly in your Function App.",{"type":224,"tag":225,"props":1333,"children":1335},{"id":1334},"git-tip-of-the-week-alias-to-force-push-commits",[1336],{"type":230,"value":1337},"Git tip of the week: alias to force push commits",{"type":224,"tag":240,"props":1339,"children":1340},{},[1341,1343,1350],{"type":230,"value":1342},"I often force push changes on my git branches. Indeed, I try to keep a clean and easy to read the history on my branches by using the ",{"type":224,"tag":713,"props":1344,"children":1347},{"href":1345,"rel":1346},"https://www.techwatching.dev/gitcheatsheet#when-you-want-to-have-a-clean-commit-history-on-your-branch-before-creating-your-pull-request",[717],[1348],{"type":230,"value":1349},"interactive rebase command",{"type":230,"value":1351}," so that it's easier for my colleagues to review my Pull Requests and I can use a rebase merging strategy instead of squashing my changes in a big commit when completing them.",{"type":224,"tag":240,"props":1353,"children":1354},{},[1355,1357,1363,1365,1371,1373,1379,1381,1388,1390,1396],{"type":230,"value":1356},"Before, I was using the ",{"type":224,"tag":233,"props":1358,"children":1360},{"className":1359},[],[1361],{"type":230,"value":1362},"git push --force",{"type":230,"value":1364}," command but reading a few articles on the topic convinced me that I should use the ",{"type":224,"tag":233,"props":1366,"children":1368},{"className":1367},[],[1369],{"type":230,"value":1370},"git push --force-with-lease",{"type":230,"value":1372}," command instead to avoid crushing commits colleagues could have done on my branch (even if there is little risk as I only rewrite the history of already pushed changes when working alone on a branch). You can read more about ",{"type":224,"tag":233,"props":1374,"children":1376},{"className":1375},[],[1377],{"type":230,"value":1378},"--force-with-lease",{"type":230,"value":1380}," on the git ",{"type":224,"tag":713,"props":1382,"children":1385},{"href":1383,"rel":1384},"https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaseltrefnamegt",[717],[1386],{"type":230,"value":1387},"documentation",{"type":230,"value":1389},". The only problem with this command is that it's a bit long to write so here is an alias to add to your ",{"type":224,"tag":233,"props":1391,"children":1393},{"className":1392},[],[1394],{"type":230,"value":1395},".gitconfig",{"type":230,"value":369},{"type":224,"tag":267,"props":1398,"children":1402},{"className":1399,"code":1400,"language":1401,"meta":207,"style":207},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[alias]\n    pf = push origin --force-with-lease\n","yaml",[1403],{"type":224,"tag":233,"props":1404,"children":1405},{"__ignoreMap":207},[1406,1424],{"type":224,"tag":276,"props":1407,"children":1408},{"class":278,"line":279},[1409,1414,1419],{"type":224,"tag":276,"props":1410,"children":1411},{"style":295},[1412],{"type":230,"value":1413},"[",{"type":224,"tag":276,"props":1415,"children":1416},{"style":630},[1417],{"type":230,"value":1418},"alias",{"type":224,"tag":276,"props":1420,"children":1421},{"style":295},[1422],{"type":230,"value":1423},"]\n",{"type":224,"tag":276,"props":1425,"children":1426},{"class":278,"line":301},[1427],{"type":224,"tag":276,"props":1428,"children":1429},{"style":630},[1430],{"type":230,"value":1431},"    pf = push origin --force-with-lease\n",{"type":224,"tag":240,"props":1433,"children":1434},{},[1435],{"type":230,"value":1436},"And that's it for this week, happy learning!",{"type":224,"tag":1438,"props":1439,"children":1440},"style",{},[1441],{"type":230,"value":1442},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":207,"searchDepth":301,"depth":301,"links":1444},[1445,1447,1448],{"id":227,"depth":301,"text":1446},"Reminder for my future self: don't forget about \"this\" in ts",{"id":1283,"depth":301,"text":1286},{"id":1334,"depth":301,"text":1337},"markdown","content:1.posts:38.w20-2022-tips-learned-this-week.md","content","1.posts/38.w20-2022-tips-learned-this-week.md","md",[1455,1470],{"_path":124,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":123,"description":1456,"lead":1457,"date":1458,"image":1459,"badge":1461,"tags":1463,"_type":1449,"_id":1468,"_source":1451,"_file":1469,"_extension":1453},"When using some API Clients (like REST Client or the HTTP Client of JetBrains' IDEs), environment variables are stored in JSON files that can contain secrets. To share these files within a team, developers tend to send them by email or by messaging applications, which is not very convenient nor secure 🔐. I thought it would be a good idea to store these secrets directly in an Azure Key Vault and automate the generation of a JSON file containing the secrets using Azure CLI and Nushell.","Playing with Azure CLI and Nushell to generate a secret environment file to send HTTP requests","2022-08-01T00:00:00.000Z",{"src":1460},"/images/padlock_1.jpg",{"label":1462},"Tooling",[219,1464,1465,1466,1467],"HTTP","nushell","Azure CLI","Azure Key Vault","content:1.posts:39.http-clients-secrets.md","1.posts/39.http-clients-secrets.md",{"_path":118,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":117,"description":1471,"lead":1471,"date":1472,"image":1473,"badge":1474,"tags":1475,"_type":1449,"_id":1479,"_source":1451,"_file":1480,"_extension":1453},"Git commands in vscode, a nice tool for Vue developers and a must-have Visual Studio extension.","2022-05-14T00:00:00.000Z",{"src":211},{"label":213},[215,1476,217,1477,1478,219],"vscode","Vue.js","Visual Studio","content:1.posts:37.w19-2022-tips-learned-this-week.md","1.posts/37.w19-2022-tips-learned-this-week.md",1716749601564]