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.IO; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using UnityEngine; | |
using static System.Text.Encoding; | |
namespace DefaultNamespace | |
{ |
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
// source https://github.com/apollographql/apollo-client/blob/master/src/react/hooks/utils/useDeepMemo.ts | |
import { useRef } from 'react'; | |
import { equal } from '@wry/equality'; | |
/** | |
* Memoize a result using deep equality. This hook has two advantages over | |
* React.useMemo: it uses deep equality to compare memo keys, and it guarantees | |
* that the memo function will only be called if the keys are unequal. | |
* React.useMemo cannot be relied on to do this, since it is only a performance |
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
export function transform(o: any, fn: (obj: any, prop: string, value: any) => any) { | |
if (o && typeof o === 'object') { | |
Object.keys(o).forEach((k, i) => { | |
o[k] = fn.apply(this, [o, k, o[k]]) | |
if (o[k] && typeof o[k] === 'object') { | |
return transform(o[k], fn) | |
} | |
return o[k] | |
}) | |
return o |
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.ServiceModel; | |
using Microsoft.Crm.Sdk.Messages; | |
using Microsoft.Xrm.Sdk; | |
using Microsoft.Xrm.Sdk.Query; | |
namespace QuotationCalculateSum | |
{ | |
public class CalculatorPlugin : IPlugin | |
{ |
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
import { ApolloServer, gql } from 'apollo-server-azure-functions' | |
import * as mongoose from 'mongoose' | |
import { schema } from './model' | |
mongoose.connect(process.env.COSMOSDB_CONNSTR, { | |
useUnifiedTopology: true, | |
useNewUrlParser: true, | |
auth: { | |
user: process.env.COSMODDB_USER, | |
password: process.env.COSMOSDB_PASSWORD, |
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
FROM mcr.microsoft.com/azure-functions/base | |
RUN apt-get update && \ | |
apt-get install -y gnupg && \ | |
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ | |
apt-get update && \ | |
apt-get install -y nodejs | |
ENV AzureWebJobsScriptRoot=/home/site/wwwroot |