Skip to content

Instantly share code, notes, and snippets.

View productdevbook's full-sized avatar
🖥️
Coding

Mehmet productdevbook

🖥️
Coding
View GitHub Profile
@productdevbook
productdevbook / perf-diagnostics.css
Created January 15, 2021 18:45 — forked from tkadlec/perf-diagnostics.css
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
<template>
<button
class="focus:outline-none inline-flex relative items-center font-medium transition duration-150 ease-in-out border"
:disabled="disabled"
:class="[colorObj, curserObj, centerObj, sizeObj, textObj]"
v-bind="$attrs"
v-on="$listeners"
>
<template v-if="loading">
<svg
@productdevbook
productdevbook / jwtRS256.sh
Created June 22, 2021 08:58 — forked from Holger-Will/jwtRS256.sh
generate public private key pair (RSA RS256) for use with koa-jwt jasonwebtoken etc.
# generate private key
openssl genrsa -out private.pem 2048
# extatract public key from it
openssl rsa -in private.pem -pubout > public.pem
@productdevbook
productdevbook / filterArray.js
Created July 7, 2021 03:54 — forked from jherax/filterArray.js
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {

Increasing the amount of inotify watchers

If you are not interested in the technical details and only want to get Listen to work:

  • If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@productdevbook
productdevbook / genarate-jwt.md
Last active May 18, 2022 03:14
JWT Generate

Generate the RSA keys

openssl genrsa -out private.pem 2048 openssl rsa -in private.pem -pubout > public.pem

Yukaridaki kisim openssl kullarak rs256 sifreleme sistemini kullanarak bir gizli key yaratiyor. Sonra bu gizli keyden public key yaratiyoruz.

Bu iki key sistemde kullaniyoruz. Jwt sifrelenirken public key ile sifrenip karsiya gonderiyor. Karsi taraf bize istek attiginda tokeni public key ile cozuyoruz.

print the keys in an escaped format

awk -v ORS='\n' '1' private.pem

type TerminalType =
| string
| number
| bigint
| boolean
| ((...args: any) => any)
/**
* Deep nested keys of an interface with dot syntax
*
@productdevbook
productdevbook / fullnested.ts
Created June 4, 2022 16:34
nested property full
type TerminalType =
| string
| number
| bigint
| boolean
| null
| undefined
| any[]
| Map<any, any>
| Set<any>
@productdevbook
productdevbook / strings.xml
Created June 13, 2022 10:24 — forked from prakashpun/strings.xml
Add test AdMob app ID and ad unit IDs which has to be replaced later with live production ads for Admob account
<resources>
...
<string name="admob_app_id">ca-app-pub-3940256099942544~3347511713</string>
<string name="ad_unit_id">ca-app-pub-3940256099942544/5224354917</string>
...
</resources>
@productdevbook
productdevbook / confetti-js.vue
Last active June 14, 2022 17:21
confetti-js vue 3
<script setup lang="ts">
import ConfettiGenerator from 'confetti-js'
const confettiElement = ref<HTMLCanvasElement | null>(null)
const canvasBoundingRect = computed(() => {
if (confettiElement.value) {
return confettiElement.value.getBoundingClientRect()
}
return {
top: 0,
left: 0,