Skip to content

Instantly share code, notes, and snippets.

View danparker276's full-sized avatar

Dan danparker276

  • Los Angeles
View GitHub Profile
@danparker276
danparker276 / updatecachec.ps
Created October 8, 2020 22:49
Powershell Add Cache-Control to Azure Storage Index.html for Static Website on JAM stack for example
#I run this on azure devops after I deploy my javascript app (react, vue...) to an azure storage website
#Make sure your index.html calls your compiled javascript file that has a unique or build name and you won't need
#your customers to have to hard refresh their browsers to get updates.
#Note this assumes a common Azure Static website deploy, I haven't found good docs on how to do this
az storage blob update --account-name <storageAccount> --account-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQ== --container-name "`$web" --name "index.html" --content-cache-control "max-age=100"
@danparker276
danparker276 / ApplyAzureSettings.ps1
Created November 11, 2018 18:04
Azure Powershell copy but not replace app settings and connection strings for WebApps and Azure Functions
#For copying Azure WebApp or Azure Functions application settings and connection strings
#This will copy from Web App, but not replace, because things like Insights, storage and existing settings
#you probably want to keep at times. Most samples I found were only complete replacements which I didn't want
#Make sure you're logged in
try{
$acct = Get-AzureRmSubscription
}
catch{
Login-AzureRmAccount
@danparker276
danparker276 / Expo_Push_Notifications_Helper.cs
Created August 17, 2018 22:38 — forked from rbravo/Expo_Push_Notifications_Helper.cs
Expo.io Push Notifications Send Through C#
public class ExpoPushHelper
{
public class MyWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request = base.GetWebRequest(address) as HttpWebRequest;
request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
return request;
}