Hello World
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 Lz77 | |
{ | |
private const int RingBufferSize = 4096; | |
private const int UpperMatchLength = 18; | |
private const int LowerMatchLength = 2; | |
private const int None = RingBufferSize; | |
private static readonly int[] Parent = new int[RingBufferSize + 1]; | |
private static readonly int[] LeftChild = new int[RingBufferSize + 1]; | |
private static readonly int[] RightChild = new int[RingBufferSize + 257]; | |
private static readonly ushort[] Buffer = new ushort[RingBufferSize + UpperMatchLength - 1]; |
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 details at: https://blog.aggregatedintelligence.com/2020/09/d365-finance-and-operations-odata-query.html | |
var baseUrl = "https://myDomain.sandbox.operations.dynamics.com"; //a trailing slash here will cause a "No P3P Policy defined" error | |
var tenantId = "TENANTID AS A GUID HERE"; | |
string applicationId = "APPLICATION GUID HERE"; | |
string clientSecret = "CLIENT SECRET HERE"; | |
string api = "data/"; | |
var authorityUrl = $"https://login.windows.net/{tenantId}"; |
The following JSON goes into the user settings.json file for VSCode.
For more information see: https://blog.aggregatedintelligence.com/2021/11/gitlens-remote-provider-settings-for.html
"gitlens.remotes": [{
"regex": "https:\\/\\/(git-codecommit\\.us-west-2\\.amazonaws\\.com)\\/v1/repos\\/(.+)",
"type": "Custom",
"name": "AWS Code Commit",
"protocol": "https",
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
//Add the following launch configuration to launch.json. I create | |
//a specific launch.json in my workspace folder as this setting | |
//will likely be different for each workspace folder. | |
//change the "startupFileNameHere" to point to your startup file. | |
"configurations": [ | |
{ | |
"name": "Python: Run Startup File", | |
"type": "python", | |
"request": "launch", |
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
//validates a cloud formation template in VsCode. | |
//add this to a file named tasks.json in the .vscode folder. | |
//to run: Terminal >> Run Task... | |
{ | |
"version": "2.0.0", | |
"tasks":[ | |
{ | |
"label":"aws cf validate-template", | |
"type":"shell", | |
"presentation": { |
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
#based on: https://www.therealomar.com/articles/2019-06/Git-the-most-edited-files-in-a-project | |
git log --pretty=format: --name-only --since=1.years.ago | | |
Where-Object { ![string]::IsNullOrEmpty($_) } | | |
Group-Object | | |
Sort-Object -Property Count -Descending | | |
Select-Object -Property Count, Name -First 10 |
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
#This code is an example of how to use text based mapper class names to query the airflow db. | |
import inspect | |
import re | |
from airflow.models.base import Base | |
from airflow import DAG, settings | |
from airflow.operators.python import PythonOperator | |
from airflow.utils.dates import days_ago |
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
#BAD | |
import os | |
class SlackLogger: | |
def post message(self, message): | |
print("I'm posting to Slack: (message)") | |
#in your code e.g. Celery jobs | |
''' | |
if os.getenv("APP_ENVIRONMENT") == "production": |
OlderNewer