Skip to content

Instantly share code, notes, and snippets.

View Asjas's full-sized avatar
🔥

A-J Roos Asjas

🔥
  • South Africa
  • 08:09 (UTC +02:00)
  • X @_asjas
View GitHub Profile
@Asjas
Asjas / reset.css
Created May 19, 2021 07:09
Modern CSS Reset - Andy Bell
// https://piccalil.li/blog/a-modern-css-reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
@Asjas
Asjas / reset.css
Last active October 17, 2023 23:13
My CSS Reset
/* Box sizing rules */
html {
box-sizing: border-box;
}
/* Set core root defaults */
html:focus-within {
scroll-behavior: smooth;
}
@Asjas
Asjas / nginx.conf
Last active October 8, 2023 17:08
Nginx sample config. Includes CSP headers, caching headers, gzip and brotli compression
user www-data;
worker_processes auto;
worker_rlimit_nofile 8192;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 8000;
}
@Asjas
Asjas / index.js
Created February 16, 2021 21:04
Node.js ES modules __dirname and __filename
import { fileURLToPath } from 'url';
import { dirname } from 'path';
console.log(`import.meta.url: ${import.meta.url}`);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
console.log(`dirname: ${__dirname}`);
console.log(`filename: ${__filename}`);
@Asjas
Asjas / scss.txt
Created May 19, 2021 07:12
Pretty neat SCSS folder structure
// https://matthiasott.com/notes/how-i-structure-my-css
/scss/
├── 1-settings
│ └── _global.scss
├── 2-design-tokens
│ ├── _colors.scss
│ ├── _fonts.scss
│ ├── _media-queries.scss
│ ├── _spacing.scss
@Asjas
Asjas / .gitconfig
Last active January 24, 2023 22:54
.gitconfig
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = A-J Roos
email = asjas@hey.com
signingkey = 469CC0CAEEA7DB94
[alias]
// Use a font size that makes lowercase
letters half the specified font size
@supports (font-size-adjust: 1;) {
article {
font-size-adjust: 0.5;
}
}
// optimal line height
p {
@Asjas
Asjas / luhnAlgorithm.ts
Created July 8, 2022 18:01
Luhn Algorithm
// https://github.com/muhammadghazali/mod10
function LuhnAlgorithm(RSA_ID: string) {
let isValid = false;
let checkDigit;
let sumOfAllNumbers = 0;
let reversedIdentifier = [];
const identifierString = RSA_ID;
checkDigit = identifierString.charAt(identifierString.length - 1);
@Asjas
Asjas / app.js
Created May 21, 2022 10:07
React "as" Prop Example
const Headline = ({ as = 'h1', children }) => {
const As = as;
return <As>{children}</As>;
};
const App = () => {
return (
<>
<Headline>Hello React</Headline>
<Headline as="h2">Hello React</Headline>
npm set init.author.name "A-J Roos"
npm set init.author.email "asjas@hey.com"
npm set init.license "MIT"