Skip to content

Instantly share code, notes, and snippets.

View mfyz's full-sized avatar
✌️

Mehmet Fatih Yıldız mfyz

✌️
View GitHub Profile
@mfyz
mfyz / index.js
Last active January 3, 2024 19:16
Traffic generator
const puppeteer = require('puppeteer')
const BASE_URL = 'https://amazingsite.com'
const visitPage = async (browser, url) => {
const page = await browser.newPage()
console.log('--> Visiting', url)
await page.goto(url)
await page.waitForSelector('.site-logo')
@mfyz
mfyz / index.html
Created July 24, 2023 12:29
Algolia automcomplete.js vanilla
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
font: 16px/24px Arial, Helvetica, sans-serif;
}
@mfyz
mfyz / utils.js
Last active November 28, 2022 03:21
Jupyter utils.js
/*
Gist: https://gist.github.com/mfyz/1dd5bb1145e809fecb60df15661045b3
## Get/Update Local Copy:
curl https://gist.githubusercontent.com/mfyz/1dd5bb1145e809fecb60df15661045b3/raw/utils.js > utils.js
@mfyz
mfyz / wp-install.sh
Last active August 5, 2022 12:00
Install and configure Wordpress
# Install wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
# Set up wordpress site
php wp-cli.phar core install\
--url=http://localhost:8011\
--title='Test Site'\
--admin_user=admin\
--admin_password=admin\
--admin_email=test@example.com\
@mfyz
mfyz / download-wp.sh
Created July 15, 2022 18:50
download wordpress and plugins for offline work
#!/bin/bash
wget https://wordpress.org/latest.zip -O wordpress.zip
wget https://downloads.wordpress.org/plugin/advanced-custom-fields.zip
wget https://downloads.wordpress.org/plugin/wp-graphql.zip
wget https://downloads.wordpress.org/plugin/user-role-editor.zip
wget https://downloads.wordpress.org/plugin/wp-rest-api-authentication.zip
wget https://downloads.wordpress.org/plugin/acf-to-rest-api.zip
wget https://downloads.wordpress.org/plugin/custom-post-type-ui.zip
@mfyz
mfyz / wordle.md
Created February 6, 2022 18:12 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@mfyz
mfyz / take-backup.sh
Last active August 6, 2021 04:33
External SSD Backup Script
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Run command below in terminal:
#
#
# sudo sh /Volumes/ExtremeSSD/Backup/Take-Backups.sh
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@mfyz
mfyz / git-status.js
Created February 14, 2021 22:24
Show git remotes of each project in each folder (nodejs)
const fs = require('fs')
const path = require('path')
const { execSync, spawnSync } = require('child_process')
const runCmd = (cmd) => {
try {
const res = spawnSync(cmd, [], { shell: true })
return res.stdout.toString()
}
catch (err) {
@mfyz
mfyz / cleanup.php
Created February 14, 2021 22:16
wordpress clean up uploads folder (scan files and check in the DB/media-library then delete unmapped ones)
<?php
require(__DIR__ . '/../wp-load.php');
if (!function_exists('wp')) die('Sorry, looks like WordPress isn\'t loaded.');
$dry_run = true;
$move_files_to_trash_folder = true;
$trash_folder_path = realpath(__DIR__ . '/..') . '/unmapped-uploads-to-delete';
if ($move_files_to_trash_folder && !file_exists($trash_folder_path)) mkdir($trash_folder_path);
@mfyz
mfyz / Raspberry Pi Wifi Config.md
Last active August 22, 2020 15:19
Raspberry Pi Wifi Config

Add new network configuration (SSID + Password)

network={
    ssid="testing"
    psk="testingPassword"
}

into