Skip to content

Instantly share code, notes, and snippets.

View abierhaus's full-sized avatar

Alex abierhaus

View GitHub Profile
# 'Allow scripts to access the OAuth token' was selected in pipeline. Add the following YAML to any steps requiring access:
# env:
# MY_ACCESS_TOKEN: $(System.AccessToken)
# Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location
schedules:
- cron: 0 6 * * *
branches:
include:
- refs/heads/master
always: true
@abierhaus
abierhaus / Startup.cs
Created March 11, 2021 08:35
Use Secrets
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment()) app.UseDeveloperExceptionPage();
app.UseRouting();
//Get User Secrets here
var username = Configuration["YourService:Username"];
var password = Configuration["YourService:Password"];
@abierhaus
abierhaus / Startup.cs
Created March 11, 2021 08:34
Consturctor Configration
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
@abierhaus
abierhaus / secrets.json
Created March 11, 2021 08:26
Example for a secrets.json
{
"YourService": {
"Username": "myusername",
"Password": "C0mpLicated!!!1"
}
}
@abierhaus
abierhaus / gist:820162b1258826ff8ec6029f07bde170
Created March 5, 2021 10:01
Get NuGet Vulnerable packages
dotnet list package --vulnerable
"Salesforce": {
"Username": "", //User name from API User
"Password": "", //Password from API User
"Token": "", //Token from /lightning/settings/personal/ResetApiToken/home
"ClientId": "", // Consumer Key from the connected app
"ClientSecret": "", // Consumer Secret from the connected app
"LoginEndpoint": "https://login.salesforce.com/services/oauth2/token", //OAuth URL
"ApiEndpoint": "/services/data/v51.0/" //API Endpoint with Version
},
@abierhaus
abierhaus / Postcode to ISO 3166-2:DE json
Last active May 7, 2018 11:57
German Postcode to ISO 3166-2:DE State/ Deutsche Postleitzahlen zu Bundesländer
[
{
"Postcode": "01067",
"State": "DE-SN"
},
{
"Postcode": "01069",
"State": "DE-SN"
},
{
@abierhaus
abierhaus / RandomWordGenerator.cs
Created May 5, 2016 16:26
C# Generator that creates a random Word + Number combination from a dictionary
/// <summary>
/// Class RandomWordGenerator.
/// </summary>
public static class RandomWordGenerator
{
/// <summary>
/// Creates the random word number combination.
/// </summary>
/// <returns>System.String.</returns>