Skip to content

Instantly share code, notes, and snippets.

View NazCodeland's full-sized avatar

Nazar NazCodeland

View GitHub Profile
@NazCodeland
NazCodeland / css-units.css
Last active February 11, 2025 14:16
css units
{
"absolute": ["px", "deg", "in", "cm", "mm", "pt", "pc", "ex"],
"relative": ["rem", "em", "%", "ch"],
"viewport": {
"inline": ["vi", "dvi", "svi", "lvi", "vw", "dvw", "svw", "lvw"],
"block": ["vb", "dvb", "svb", "lvb", "vh", "dvh", "svh", "lvh"],
"size": ["vmin", "dvmin", "svmin", "lvmin", "vmax", "dvmax", "svmax", "lvmax"]
},
"container": ["cqi", "cqw", "cqb","cqh", "cqmin", "cqmax"]
}
@NazCodeland
NazCodeland / pwsh.ps1
Created November 12, 2024 16:28
Helpful Powershell Snippets
Get-ChildItem -Path "C:\Program Files" -Recurse -Filter "*Bit*" | Select-Object FullName
@NazCodeland
NazCodeland / performance_factors.md
Created October 28, 2024 12:36
The scope of factors to keep an eye on when assessing and optimizing performance
  1. Network Latency: Speed of data travel between client and server.
  2. Server Load: Concurrent users and requests.
  3. Bandwidth: Data transfer rate.
  4. Code Efficiency: Optimization of application code.
  5. Database Performance: Query efficiency and load.
  6. Disk I/O: Speed of disk read/write operations.
  7. Memory Usage: RAM consumption.
  8. CPU Load: Processing power for requests.
  9. Concurrency Handling: Managing multiple operations.
  10. Caching: Reducing load times with caches.
@NazCodeland
NazCodeland / eslintrc.json
Last active September 14, 2024 04:05
eslint-airbnb-config-rules-Chase
// .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
extends: [
'airbnb', // Airbnb base configuration
'airbnb/hooks', // Airbnb hooks configuration (for React Hooks)
@NazCodeland
NazCodeland / font-face.css
Created June 28, 2024 20:50
css font-face
@font-face {
font-family: 'Alkes';
src: url('./lib/styles/fonts/Alkes-Regular.woff') format('woff'),
url('./lib/styles/fonts/Alkes-Regular.woff') format('woff');
}
@NazCodeland
NazCodeland / endpoint.ts
Last active June 23, 2024 23:54
Handling multiple GET requests within one endpoint in SvelteKit
// CREDIT: https://github.com/karimfromjordan
// https://kit.svelte.dev/docs/routing#server-fallback-method-handler
export async function fallback({ url, request }) {
if (request.method === 'GET' && url.pathame === '/api/x') {
// ...
}
if (request.method === 'GET' && url.pathame === '/api/y') {
// ...
}
if (request.method === 'GET' && url.pathame === '/api/z') {
@NazCodeland
NazCodeland / bun_code_format_on_push.yaml
Last active June 10, 2024 13:44
This GitHub Actions workflow uses bun to automatically format your codebase whenever a push is made to the repository.
name: Code Format
on: [push]
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
{
"compilerOptions": {
// Enable latest features
"lib": [
"ESNext"
],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
@NazCodeland
NazCodeland / prettierrc.json
Last active November 5, 2024 05:27
prettierrc
{
"endOfLine": "lf",
"printWidth": 80,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"plugins": [
"prettier-plugin-tailwindcss",
"prettier-plugin-classnames",
"prettier-plugin-merge"
@NazCodeland
NazCodeland / previousMousePosition.au3
Last active May 4, 2024 19:52
Mouse Cursor Position Switcher: This AutoIt script is designed to switch the mouse cursor position between two locations.
; Mouse Cursor Position Switcher: This AutoIt script is designed to switch the
; mouse cursor position between two locations. It reads the previously stored
; coordinates from a text file, moves the mouse cursor to these coordinates,
; and then updates the file with the current coordinates. This allows the mouse
; cursor to effectively ‘switch’ between two positions.
#include <File.au3>
; Get the current coordinates
$currentCoords = MouseGetPos()