Skip to content

Instantly share code, notes, and snippets.

View NazCodeland's full-sized avatar

Nazar NazCodeland

View GitHub Profile
@NazCodeland
NazCodeland / sharp-corner.css
Last active February 4, 2023 00:34
making a sharp corner effect in CSS using the ::before pseudo element
<!-- html code -->
<div></div>
/* css code */
div {
position: relative;
height: 50vh;;
background-color: #64953D;
}
@NazCodeland
NazCodeland / tailwind plugin example
Last active April 21, 2024 22:46
simple tailwind plugin
import plugin from 'tailwindcss/plugin';
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {}
},
plugins: [
plugin(function ({ addUtilities, addComponents, e, config, theme }) {
@NazCodeland
NazCodeland / nextMonitor.au3
Created April 15, 2024 14:19
Captures the current mouse position, reads a target position from a file, moves the mouse to the target position without delay.
#include <File.au3>
; Get the current coordinates
$currentCoords = MouseGetPos()
; The x and y coordinates should be saved on one line separated by a comma. Example: 200,400
$newCoordsString = FileRead("./coordinates.txt")
; Close the file after reading
FileClose("./coordinates.txt")
@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()
@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"
{
"compilerOptions": {
// Enable latest features
"lib": [
"ESNext"
],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
@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
@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 / 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 / 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)