Skip to content

Instantly share code, notes, and snippets.

View devzom's full-sized avatar
:octocat:
Coding for life and fun

Jakub Zomerfeld devzom

:octocat:
Coding for life and fun
View GitHub Profile
@devzom
devzom / generate-seo-robots-agents-sitemap.js
Last active January 19, 2022 09:08
JS: Nuxt: Generate sitemap UserAgent based on provided array
/*
* @created: 18/12/2021
* @author Jakub [dev.zomerfeld@gmail.com]
* @summary Utils funtion to generate an array of
* UserAgents provided in structured schema
* to use with Robots Nuxt module https://github.com/nuxt-community/robots-module
*/
const agentsArray = [
'Abonti',
@devzom
devzom / compareEnvs.js
Created January 14, 2022 13:10
javascript: Function to compare different .env files
/*
* Created: 14/1/2022 by Jakub Zomerfeld / dev.zomerfeld@gmail.com
*/
const fs = require('fs')
const path = require('path')
const dotenv = require('dotenv')
/**
*
@devzom
devzom / add-ssh-on-ubuntu.txt
Created December 20, 2021 10:33
SSH: How to use existing SSH key on my newly installed Ubuntu
cp /path/to/my/key/id_rsa ~/.ssh/id_rsa
cp /path/to/my/key/id_rsa.pub ~/.ssh/id_rsa.pub
# change permissions on file
sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa.pub
# start the ssh-agent in the background
eval $(ssh-agent -s)
# make ssh agent to actually use copied key
ssh-add ~/.ssh/id_rsa
@devzom
devzom / MacOs-Laravel-var_www-symlink-permissions.txt
Created September 25, 2021 13:50
MacOS BigSur add permission to /var/www folder to use with Laravel symlink
@devzom
devzom / ssh_multikeys.md
Last active September 25, 2021 07:40 — forked from jmcaldera/ssh_multikeys.md
Multiple SSH Keys macOS

Multiple SSH Keys on same client

Check if you have existing keys by opening the terminal and entering: ssh-add -l OR ls -al ~/.ssh and check for any file called (usually) id_rsa or similar

Identify the host you're using your current key for. You probably added this key to, for example your github or gitlab account. We will use this later on.

If you don't have a config file on ~/.ssh folder, you will need to create one. We'll get back to this later.

function loadScript(src) {
return new Promise(function(resolve, reject) {
let script = document.createElement('script');
script.src = src;
script.onload = () => resolve(script);
script.onerror = () => reject(new Error("Script load error: " + src));
document.head.append(script);
});
@devzom
devzom / Bug-Magnet.json
Last active March 10, 2021 12:46
// Bug Magnet exploratory testing plugin Chrome/Firefox configuration for additional menu
{
"Polish numbers": {
"Correct": "504324123",
"Correct +": "+48 722 833 444",
"Incorrect": "23232323",
"Zeros":"000 000 000",
"Zero +":"000 444 222"
}
}
@devzom
devzom / nuxt-axios-cache.js
Created December 2, 2020 12:27 — forked from Tuarisa/nuxt-axios-cache.js
Nuxt axios cache plugin
import hash from 'object-hash'
import sizeof from 'object-sizeof'
import lruCache from 'lru-cache'
const cacheEnabled = true
const cacheMaxAge = 30 * 60 * 1000
const cacheMaxSize = 128 * 1000 * 1000
const getCacheKey = obj => hash(obj)
@devzom
devzom / webpack-image-iterrate.js
Last active December 1, 2020 10:43
webpack: itterate image files inside a assets folder (ex. Vue)
/*
#You can utilize webpack's require.context() to list files in a given directory at compile time.
# https://webpack.js.org/guides/dependency-management/
*/
const illustrations = require.context(
'@/assets/illustrations',
true,
/^.*\.jpg$/
)
@devzom
devzom / debug.css
Last active November 17, 2020 14:59
CSS: debugging -> debug attribute for html element with overlays
/*! debug.css | MIT License |
Jakub Zomerfeld
/* Instruction:
just add an 'debug' attribute to main html element ex.
<div id="#app" debug>
</div>
*/
[debug], [debug] *:not(g):not(path) {
color: hsla(210, 100%, 100%, 0.9) !important;