Skip to content

Instantly share code, notes, and snippets.

Avatar

Raj rajrao

View GitHub Profile
@rajrao
rajrao / OdataQueryD365FinanceAndOperationsTest.cs
Last active Sep 14, 2020
Shows how to perform authentication and retrieval of data from D365 Finance and Operations using OData and the Service to service calls using client credentials
View OdataQueryD365FinanceAndOperationsTest.cs
//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}";
@rajrao
rajrao / lz77.cs
Created Jul 4, 2020 — forked from mjs3339/lz77.cs
C# Implementation LZ77 Compression Algorithm
View lz77.cs
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];
@rajrao
rajrao / button.py
Created Aug 1, 2016 — forked from ecaron/button.py
Python script for listening to Raspberry Pi button push
View button.py
import requests
import time
import RPi.GPIO as GPIO
url = 'http://nightlight/' # I map this to my internal DNS hosting the node app
gpio_pin=18 # The GPIO pin the button is attached to
longpress_threshold=5 # If button is held this length of time, tells system to leave light on
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
You can’t perform that action at this time.