Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦
#StandWithUkraine

Dmitry Kudryavtsev skwee357

🇺🇦
#StandWithUkraine
View GitHub Profile
View Rust Native vs Wasm Benchmark
+---------------------+----------------+----------------+----------------+----------------+
| Runtime | 30th Fibonacci | 44th Fibonacci | 45th Fibonacci | 46th Fibonacci |
+---------------------+----------------+----------------+----------------+----------------+
| JavaScript (NodeJS) | 165.2ms | 5.846s | 9.358s | 15.038s |
| Native Rust | 161.5ms | 2.271s | 3.578s | 5.721s |
| Rust WASM | 163ms | 3.286s | 5.207s | 8.317s |
+---------------------+----------------+----------------+----------------+----------------+
View render.rs
let mut encoder = self.device.create_command_encoder(&wgpu::CommandEncoderDescriptor {
label: Some("sk:graphics:encoder")
});
let render_pipeline_layout = self.device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
bind_group_layouts: &[]
});
let vertex_shader_module = self.device.create_shader_module(
&wgpu::read_spirv(std::io::Cursor::new(SHADER_VERT)).expect("Failed to read vertex shader")
@skwee357
skwee357 / index.d.ts
Created Jul 1, 2018
@slack/interactive-messages Typings
View index.d.ts
import * as http from "http";
export interface MessageAdapterOptions {
syncResponseTimeout: number;
lateResponseFallbackEnabled: boolean;
}
export interface ActionMatchingConstraints {
callbackId?: string | RegExp;
type?: "select" | "button" | "dialog_submission";
View middleware.js
var Joi = require('joi'),
util = require('util'),
_ = require('lodash');
var BadRequestError = function (errors) {
Error.captureStackTrace(this, this.constructor);
this.name = 'BadRequestError';
this.message = 'Bad Request Error';
this.errors = errors;
};