Skip to content

Instantly share code, notes, and snippets.

View Asjas's full-sized avatar
🔥

A-J Roos Asjas

🔥
  • South Africa
  • 13:45 (UTC +02:00)
  • X @_asjas
View GitHub Profile
@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]
npm set init.author.name "A-J Roos"
npm set init.author.email "asjas@hey.com"
npm set init.license "MIT"

Keybase proof

I hereby claim:

  • I am asjas on github.
  • I am asjas (https://keybase.io/asjas) on keybase.
  • I have a public key whose fingerprint is 47C2 2148 2FA1 588B AF6D E764 4315 6461 0C72 F39D

To claim this, I am signing this object:

@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 / .sr-only
Last active December 8, 2020 20:01
A CSS class for screen reader content. This will hide the HTML Element from the user but will still allow screen readers to see it.
// https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
.sr-only {
border: 0 !important;
clip: rect(1px, 1px, 1px, 1px) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
@Asjas
Asjas / v8.md
Created March 2, 2020 13:52 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • sudo nano ~/.bash_profile
  • Add export PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)
// 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 / Dockerfile
Last active September 20, 2020 15:36
Example Node.js Production Dockerfile
FROM node:10.16.2-stretch
EXPOSE 3000
ENV NODE_ENV production
# Create work environment and set up app
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
USER node
@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 / system-queries.sql
Created February 28, 2021 19:09
PostgreSQL System Table Queries
// This query returns a list of tables, in alphabetical order, with a count of the columns.
SELECT table_name
,COUNT(column_name)
FROM information_schema.columns
WHERE table_schema = 'myschema' -- put your schema here
GROUP BY table_name
ORDER BY table_name;
// This query returns a list of tables, in alphabetical order, with a count of the rows.