Skip to content

Instantly share code, notes, and snippets.

@dzsquared
dzsquared / gpc.sh
Last active December 12, 2022 01:39
shell script for gpc command to git clone and open in code a repository
# 1 input argument, the git url
giturl=$1
# parse the url for the org name
org=$(echo $giturl | cut -d'/' -f4)
# check for the repo folder in ~/CodeRepos/$org
repo=$(echo $giturl | cut -d'/' -f5 | cut -d'.' -f1)
githuburl="https://api.github.com/repos/$org/$repo"
workflow ResourceCleaner
{
Param
(
[Parameter(Mandatory=$true)]
[String]
$TargetTagName,
[Parameter(Mandatory=$true)]
[String]
$SubscriptionName
#include <AZ3166WiFi.h>
#include "MQTTClient.h"
#include "MQTTNetwork.h"
#include "Telemetry.h"
#include "Sensor.h"
int status = WL_IDLE_STATUS;
int arrivedcount = 0;
bool hasWifi = false;
# for more info:
# https://www.drewsk.tech/2019/12/24/save-on-your-powerbi-embedded-capacity/
workflow pbi-embedded-suspend-resume
{
Param
(
[Parameter(Mandatory=$true)]
[String]
$AzureResourceGroup,
@dzsquared
dzsquared / SLtestdbs.sql
Created July 5, 2019 15:43
script for duplicating Dynamics SL production databases into test databases
BACKUP DATABASE IECISAPP --YOUR PRODUCTION DB HERE, takes ~5min for 8GB
TO DISK = 'V:\backups_temp\DYNSL\applicationdb.bak'
WITH COPY_ONLY, INIT, SKIP;
GO
BACKUP DATABASE IECISSYS --YOUR SYSTEM DB HERE, takes <30 seconds for 50MB
TO DISK = 'V:\backups_temp\DYNSL\systemdb.bak'
WITH COPY_ONLY, INIT, SKIP;
GO
{"Name":"Sample JSON Query","ConfigurationID":"3f6d943d-6078-4a27-a308-2ac798f2298a","searchItems":[],"queryItems":[],"listItems":[],"messageItems":[{"Index":1,"Level":0,"Parameters":{"Name":"OnRender","RenderType":"0","skipDebug":"False","includeSearch":"False","includeExport":"False","includeImport":"False"},"ActionType":"Action-Region","ChildActions":[{"Index":2,"Level":0,"Parameters":{"LeftCondition":"1","RightCondition":"0","Operator":"=","IsAdvanced":"False"},"ActionType":"Condition-If","ChildActions":[{"Index":3,"Level":0,"Parameters":{"Value":"If you have an API request to make, log the result to an action variable"},"ActionType":"Action-Comment","ChildActions":[]},{"Index":4,"Level":0,"Parameters":{"URL":"https://rest.avatax.com/api/v2/transactions/create","Querystring":"","Data":"[taxreq,A]","Headers":"Authorization:Basic xxxxxxxxxxxxxxxxxxxxxxx","ContentType":"application/json","Method":"post","VariableType":"&lt;Action&gt;","VariableName":"taxresp","InputFormat":"text","XPath":"","AuthenticationTy
@dzsquared
dzsquared / ajax-with-promise.ts
Created July 24, 2018 15:12 — forked from floriankraft/ajax-with-promise.ts
HTTP Request with Promises in Typescript
getRequest(url: string): Promise<any> {
return new Promise<any>(
function (resolve, reject) {
const request = new XMLHttpRequest();
request.onload = function () {
if (this.status === 200) {
resolve(this.response);
} else {
reject(new Error(this.statusText));
}
{
"id": -1,
"code": "cd005847-70a1-42f9-8746-933c22a3c33a",
"companyId": -1,
"date": "2016-10-12T00:00:00",
"taxDate": "2016-10-12T00:00:00",
"status": "Temporary",
"type": "SalesOrder",
"reconciled": false,
"totalAmount": 5,
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
string S = Console.ReadLine();
int thenumber;
try {
public static Node insert(Node head,int data)
{
//Complete this method
if(head == null)
return new Node( data);
else if(head.next == null){
head.next = new Node(data);
}
else{
insert(head.next,data);