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 async Task<string> GetShortUrl(string longUrl, string customBitLink) | |
{ | |
var shortContent = $"{{\"long_url\":\"{longUrl}\",\"group_guid\":\"groupGuid\",\"domain\":\"domain.com\"}}"; | |
var shortenUrlRequest = new HttpRequestMessage(HttpMethod.Post, ShortenUrl) | |
{ | |
Content = new StringContent(shortContent, Encoding.UTF8, "application/json") | |
}; | |
shortenUrlRequest.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _appSettings.BitlyApiToken); |
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 class AuthKeyFilter : ActionFilterAttribute | |
{ | |
private readonly IdentityDbContext _context; | |
private readonly ILogger<AuthKeyFilter> _logger; | |
public AuthKeyFilter(IdentityDbContext context, ILogger<AuthKeyFilter> logger) | |
{ | |
_context = context; | |
_logger = logger; | |
} |
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
var apiAuthKey = Guid.NewGuid().ToString("N"); | |
var user = new ApplicationUser | |
{ | |
ApiAuthKey = apiAuthKey, | |
}; |
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 class ApplicationUser : IdentityUser | |
{ | |
[Column(TypeName = "varchar(50)")] | |
[StringLength(50)] | |
public string ApiAuthKey { get; set; } | |
} |
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
using OptimizeSetWaitRequest = Kraken.Model.Azure.OptimizeSetWaitRequest; | |
using DataStore = Kraken.Model.Azure.DataStore; | |
namespace CreateMedia | |
{ | |
public class HttpCreate | |
{ | |
private static readonly string BlobStorageConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage"); | |
private static readonly string KrakenApiKey = Environment.GetEnvironmentVariable("KrakenApiKey"); | |
private static readonly string KrakenApiSecret = Environment.GetEnvironmentVariable("KrakenApiSecret"); |
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 class Program | |
{ | |
public static async Task Main(string[] args) | |
{ | |
await CreateHostBuilder(args).Build().RunAsync(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) | |
{ | |
return Host.CreateDefaultBuilder(args) |
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
function Get-UrlStatusCode([string] $Url) { | |
try { | |
(Invoke-WebRequest -Uri $Url -UseBasicParsing -DisableKeepAlive).StatusCode | |
} | |
catch [Net.WebException] { | |
[int]$_.Exception.Response.StatusCode | |
} | |
} | |
$username = ""; |
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
/* =========================================== * | |
* DARK CYAN THEME | |
* Version: 1.0.0 | |
* Author: AJ Tatum | |
* Website: ajt.io | |
* Tweets @ajtatum | |
* =========================================== */ | |
.headerDesktop-container { | |
background-color: #025a6c; |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
^SPACE:: Winset, Alwaysontop, , A |
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
{"lastUpload":"2021-08-30T02:26:20.541Z","extensionVersion":"v3.4.3"} |