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
$response = Invoke-WebRequest -Uri "https://#FILL_TARGET_HERE#" -Method Options -Headers @{ | |
"Origin" = "https://#FILL_ORIGIN_HERE#" | |
"Access-Control-Request-Method" = "GET" | |
"Access-Control-Request-Headers" = "Authorization" | |
"Accept" = "application/json" | |
} -UseBasicParsing | |
$color = "Red" | |
$headers = $response.Headers | ConvertTo-Json | |
if ($headers -match "Access-Control-Allow-Origin") { |
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
$token = $args[0] | |
$original_dir = Get-Location | |
Set-Location .. | |
(Get-Content "$original_dir\event.json" -Raw) -replace "#TOKEN#", $token | Set-Content "$original_dir\event.tmp.json" | |
serverless invoke --function validateToken --path "$original_dir\event.tmp.json" --config .\serverless.yml --log | |
Remove-Item "$original_dir\event.tmp.json" |
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
# by parameter | |
# bucketName=$1 | |
# fixed value | |
bucketName=cw.sa-east-1.syn-results | |
# Create the bucket | |
aws s3api create-bucket --bucket ${bucketName} --region your-region | |
# Enable server-side encryption |
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
CloudWatchSyntheticsRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: ${self:service}-${self:provider.region}-ExecutionRole | |
Description: CloudWatch Synthetics lambda execution role for running canaries | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: Allow | |
Principal: |
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 System; | |
using System.Threading; | |
using System.Runtime.InteropServices; | |
// reference http://eddiejackson.net/lab/2020/03/02/c-prevent-sleep-on-windows-v2/ | |
namespace SleepControl | |
{ | |
class Program |
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 System; | |
using System.Runtime.InteropServices; | |
namespace DisableSleepMode | |
{ | |
class Program | |
{ | |
// Sleep Control | |
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] | |
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags); |
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
# escape=` | |
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS builder | |
WORKDIR /app | |
COPY API1/. . | |
RUN nuget restore -PackagesDirectory ../packages | |
# RUN msbuild API1.csproj /p:OutputPath=c:\out ` | |
# /t:restore | |
RUN msbuild API1.csproj /p:Configuration=Debug ` | |
/p:DeployOnBuild=True ` | |
/p:DeployDefaultTarget=WebPublish ` |
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
try | |
{ | |
var provider = new ServiceCollection() | |
.AddMemoryCache() | |
.BuildServiceProvider(); | |
//And now? | |
var cache = provider.GetService<IMemoryCache>(); | |
using (var entry = cache.CreateEntry("item2")) |
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
div#gwt-debug-NoteView-root, | |
div#gwt-debug-NoteTitleView-container, | |
img.en-media | |
{ | |
filter: invert(.9) | |
} | |
body, | |
div#gwt-debug-sidebar, | |
div#gwt-debug-NotebookHeader-container | |
{ |
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
<!-- More read here: https://msdn.microsoft.com/en-us/library/ms366724.aspx --> | |
<!-- First, we extend the "BuildDependsOn" property with our custom target for applying the transform. | |
This is a cleaner/safer alternative to overloading the "AfterBuild" target: --> | |
<PropertyGroup> | |
<BuildDependsOn> | |
$(BuildDependsOn); | |
_VisualStudioApplyTransform; | |
</BuildDependsOn> | |
</PropertyGroup> |
NewerOlder