I have summarized and compiled a list of React.JS best practices from various sources across the internet.
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
"use strict"; | |
// Defines a grammar for basic arithmetic | |
function CreateArithmeticGrammar(myna) | |
{ | |
// Setup a shorthand for the Myna parsing library object | |
let m = myna; | |
// Construct a grammar | |
let g = new function() |
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
"use strict"; | |
function EvalArithmetic(exprNode) | |
{ | |
switch (exprNode.rule.name) | |
{ | |
case "expr": | |
{ | |
return EvalArithmetic(exprNode.children[0]); | |
} |
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 byte[] NaivePack(IList<byte[]> buffers) | |
{ | |
using (var stream = new MemoryStream()) | |
using (var bw = new BinaryWriter(stream)) | |
{ | |
bw.Write(buffers.Count); | |
foreach (var b in buffers) | |
{ | |
bw.Write(b.Length); | |
bw.Write(b); |
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.Diagnostics; | |
using Vim.Logger; | |
namespace Vim.DotNetUtilities | |
{ | |
/// <summary> | |
/// This interface is different from the IProgress<T> class in the system library | |
/// https://docs.microsoft.com/en-us/dotnet/api/system.iprogress-1?view=netframework-4.8 | |
/// It was designed to simplify the use case of percentage reporting where the number of steps |
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
/* | |
Ara 3d Array Library | |
Copyright 2018, Ara 3D, Inc. | |
Usage licensed under terms of MIT Licenese | |
*/ | |
#pragma once | |
namespace ara3d | |
{ | |
// Iterator for accessing of items at fixed byte offsets in memory |
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
/* | |
Ara 3d Array Operations Library | |
Copyright 2018, Ara 3D | |
Usage permitted under terms of MIT Licenese | |
This is a header-only library of generic algorithms that operate on random-access indexable containers such as | |
std::vector, std::array, and std::valarray from the STL, and raw C arrays. | |
It also works on ara3d::array, ara3d::func_array, and so forth. | |
This enhances algorithms found in the | |
STL library with algorithms designed specifically for arrays (like slicing, selecting, and striding). |
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
#pragma once | |
/* | |
This is a C++14 wrapper around a number of STL algorithms that operate directly on an STL random access container, valarrays, | |
Boost range, or even a C style array. It also works of course on the various Ara 3D array classes. | |
The underlying container is only required to supply an implementation of standalone | |
begin/end functions or begin/end member functions. | |
The goal is to facilitate using the STL algorithms library by reducing the amount of boilerplate |
A C++11 header-only library of array containers, views, and iterators that provide a standard interface to different layouts of data in memory, as well as to computed data.
This is a single header file with no other dependencies (including STL) which means it is portable, fast to compile, and easy to include in different projects.
Unlike std::array
the size of ara3d::array
is specified in the constructor. It is rare in practice that array sizes are known at compile time. The ara3d::array_view
is similar to stl::span
but permits writing of data elements. If read-only semantics are desired then the ara3d::const_array_view
structure can be used.
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using UnityEngine; | |
public static class VimApi | |
{ | |
/// <summary> | |
/// Represents a node in a VIM scene and provides access to useful information about the object associated with that node. |
OlderNewer