This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto detect text files and perform LF normalization | |
* text=auto | |
# Custom for Visual Studio | |
*.cs diff=csharp | |
*.sln merge=union | |
*.csproj merge=union | |
*.vbproj merge=union | |
*.fsproj merge=union | |
*.dbproj merge=union |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from "node-fetch"; | |
// env vars | |
const apiUser = "apiuser"; | |
const apiPass = "pass"; | |
const baseUrl = "https://example.org/jsonapi"; | |
const auth = "Basic " + Buffer.from(`${apiUser}:${apiPass}`).toString("base64"); | |
/* This snippet: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -m -nd --ftp-user=srkirkland@ucdavis.edu "ftp://ftp.box.com/file*.jpg" --ask-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SPConfig xmlns="urn:mace:shibboleth:2.0:native:sp:config" | |
xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config" | |
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" | |
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" | |
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | |
clockSkew="180"> | |
<!-- | |
The InProcess section contains settings affecting web server modules. | |
Required for IIS, but can be removed when using other web servers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just an example of running an ssh command on a remote server. | |
PK file needs to come from somewhere -- I think ideally Secret Vault but also base64 encoded secret would be a good choice. | |
Library used is https://www.nuget.org/packages/SSH.NET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/ | |
$subscription = "[Your Subscription Name]" | |
$service = "[Your Azure Service Name]" | |
$slot = "staging" #staging or production | |
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg" | |
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg" | |
$timeStampFormat = "g" | |
$deploymentLabel = "ContinuousDeploy to $service v%build.number%" | |
Write-Output "Running Azure Imports" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import pandas as pd | |
import os | |
import re | |
homepath=r"C:\Users\postit\Downloads\testing" | |
output_path = os.path.join(homepath,"features") | |
arcpy.env.workspace = output_path | |
if not os.path.exists(output_path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CacheFactory | |
{ | |
/// <summary> | |
/// This is a thread-safe, lazy singleton. See http://www.yoda.arachsys.com/csharp/singleton.html | |
/// for more details about its implementation. | |
/// </summary> | |
public static DataCacheFactory Instance | |
{ | |
get { return Nested.CacheFactory; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.AddCookie(cookies => | |
{ | |
cookies.Events.OnRedirectToAccessDenied = ctx => | |
{ | |
if (ctx.Request.Path.StartsWithSegments("/api")) | |
{ | |
ctx.Response.StatusCode = (int)HttpStatusCode.Forbidden; | |
return Task.CompletedTask; | |
} | |
return cookies.Events.OnRedirectToAccessDenied(ctx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- GZip static file content. Overrides the server default which only compresses static files over 2700 bytes --> | |
<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024"> | |
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> | |
<staticTypes> | |
<add mimeType="text/*" enabled="true" /> | |
<add mimeType="message/*" enabled="true" /> | |
<add mimeType="application/javascript" enabled="true" /> | |
<add mimeType="application/json" enabled="true" /> | |
<add mimeType="*/*" enabled="false" /> | |
</staticTypes> |
NewerOlder