The sources of the project follows this structure:
/src
/app
/{domain}
/actions.ts
/actions.spec.ts
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb <A-S-G> | |
$SelectAll <M-A> | |
$Undo <M-Z> |
static void gi_on_gpu(u8* in_bitmap, int w, int h) { | |
#define num_cascades 7 | |
static bool initialized; | |
static gpu_bindgroup_t texture_bindgroup[2]; | |
static gpu_bindgroup_t cascade_uniform_bindgroup[num_cascades]; | |
static gpu_bindgroup_t render_uniform_bindgroup; | |
static gpu_buffer_t vertex_buffer; | |
static gpu_buffer_t uniform_buffer; | |
static gpu_pipeline_t pipeline; |
const DependencyChecker = struct { | |
/// map(module_name -> set(module_hash)) | |
package_name_to_hashes: std.StringHashMap(std.StringHashMap(bool)), | |
const Self = @This(); | |
const dependencies = @import("root").dependencies; | |
fn check_transitive_dependency(self: *Self, comptime module_name: []const u8, comptime module_hash: []const u8, comptime level: comptime_int) void { | |
const package = @field(dependencies.packages, module_hash); |
const BITS = 32 | |
export function queryBit(data: Uint32Array, index: number) { | |
const mask = 1 << (index % BITS) | |
return (data[(index / BITS) | 0] & mask) != 0 | |
} | |
export function turnOnBit(data: Uint32Array, index: number) { | |
const mask = 1 << (index % BITS) | |
return (data[(index / BITS) | 0] |= mask) | |
} |
Use cases: | |
- Edition mode, needs component schemas and IDs | |
``` | |
entity0: { | |
position: { x y z } | |
} | |
``` | |
- If the devs define the component number, libraries may have conflicting numbers | |
export function asnEcdsaSignatureParser(signature: Uint8Array): { | |
r: BigNumber | |
s: BigNumber | |
} { | |
// 30 — type tag indicating SEQUENCE | |
// 46 — length in octets of value that follows | |
// 02 — type tag indicating INTEGER | |
// 21 — length in octets of value that follows | |
// 00 b15232269023d8c65689f816996f6af874b484347f1e7a537df1230cb1b12d76 R |
import { ILoggerComponent, IMetricsComponent } from '@well-known-components/interfaces' | |
import { validateMetricsDeclaration } from '@well-known-components/metrics' | |
import PQueue from 'p-queue' | |
export type ISequecuentialJobExecutorComponent = { | |
/** | |
* Runs sequential jobs with a max concurrency of 1 per jobName. | |
*/ | |
run<T>(jobName: string, fn: () => Promise<T>): Promise<T> | |
} |
Decentraland run scenes inside a WebWorker, in an ES5 context including Fetch + WebSockets + dcl
object.
Every generated scene should run by itself. That is, a piece of code that can be evaluated by an eval
in a proper context. You can compile scenes using Webpack, esbuild, or the Decentraland CLI.
The scenes will interact with the renderer using the dcl
object.
%dw 2.0 | |
output application/json | |
import some from dw::core::Arrays | |
fun isPrime(num: Number): Boolean = do { | |
// try primes <= 16 | |
if (num <= 16) | |
(num == 2) or (num == 3) or (num == 5) or (num == 7) or (num == 11) or (num == 13) | |
else if ( // cull multiples of 2, 3, 5 or 7 |