Skip to content

Instantly share code, notes, and snippets.

View thatisuday's full-sized avatar

Uday Hiwarale thatisuday

View GitHub Profile
@thatisuday
thatisuday / rust-floating-point-numbers.csv
Created October 2, 2024 05:25
Floating-Point Number Types in Rust
Data Type Bit Size Min Value Max Value
f32 32 1.17549435e-38 3.40282347e+38
f64 64 2.2250738585072014e-308 1.7976931348623157e+308
@thatisuday
thatisuday / rust-unsigned-integers.csv
Created October 2, 2024 05:23
Unsigned Integer Data Types in Rust
Data Type Bit Size Min Value Max Value
u8 8 0 255
u16 16 0 65_535
u32 32 0 4_294_967_295
u64 64 0 18_446_744_073_709_551_615
u128 128 0 340_282_366_920_938_463_463_374_607_431_768_211_455
usize Platform-dependent (32 or 64 bits) 0 Depends on architecture
@thatisuday
thatisuday / rust-signed-integers.csv
Last active October 2, 2024 05:22
Unsigned Integer Types in Rust
Data Type Bit Size Min Value Max Value
i8 8 -128 127
i16 16 -32_768 32_767
i32 32 -2_147_483_648 2_147_483_647
i64 64 -9_223_372_036_854_775_808 9_223_372_036_854_775_807
i128 128 -170_141_183_460_469_231_731_687_303_715_884_105_728 170_141_183_460_469_231_731_687_303_715_884_105_727
isize Platform-dependent (32 or 64 bits) Depends on architecture Depends on architecture
@thatisuday
thatisuday / react-v8-root.tsx
Created April 16, 2022 23:46
Creating root in React v18
// v17 and below
import ReactDOM from 'react-dom';
const container = document.getElementById('app');
ReactDOM.render(<App />, container);
// v18
import { createRoot } from 'react-dom/client';
const container = document.getElementById('app');
const root = createRoot(container);
root.render(<App />);
@thatisuday
thatisuday / try-catch-nested.js
Last active April 17, 2022 02:20
React Suspense try/catch analogy
const a = () => {throw new Error('Oops!')};
const b = () => a();
const c = () => b();
try {
try {
c();
console.log('Child worked.');
} catch (e) {
console.log("Error inside child", e?.message);
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _config() {
const data = require("./config");
@thatisuday
thatisuday / log.txt
Last active January 8, 2021 05:28
npm run pack command log
$ npm run pack
> [email protected] pack /Projects/thatisuday/electron-lessons
> electron-builder -mwl
• electron-builder version=22.9.1 os=20.1.0
• loaded configuration file=/Projects/thatisuday/electron-lessons/electron-builder.json
• Specified application directory equals to project dir — superfluous or wrong configuration appDirectory=.
• writing effective config file=out/builder-effective-config.yaml
• packaging platform=darwin arch=x64 electron=11.1.1 appOutDir=out/mac
@thatisuday
thatisuday / package.json
Last active December 29, 2021 19:01
A sample package.json file for the electron-builder
{
"name": "electron-lessons",
"version": "1.0.0",
"description": "A sample Electron (JS) project for Medium lessons.",
"main": "app/index.js",
"scripts": {
"start": "electron .",
"postinstall": "electron-builder install-app-deps",
"pack": "electron-builder -nwl"
},
@thatisuday
thatisuday / electron-builder.json
Created January 8, 2021 04:32
A simple electron-builder configuration.
{
"appId": "com.thatisuday.fileio",
"productName": "Electron File IO",
"copyright": "THATISUDAY TECH PVT. LTD.",
"directories": {
"app": ".",
"output": "out",
"buildResources": "build-res"
},
"files": [
.hello {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&__btn {
&--odd {
background-color: beige;
}