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 / gapp.js
Created January 13, 2020 19:26
Auto Increment (Sequence) in Google Sheets / Google Apps Script
function onEdit(e) {
// Auto increment number column name
var aiColumnName = 'A';
// The column that is tested, seq numbers will be
// given if this column is not empty.
var requieredColName = 'B'
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var worksheet = spreadsheet.getActiveSheet();
var aiColRange = worksheet.getRange(aiColumnName + '1:' + aiColumnName + '1000');
@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 / terminal-colors.sh
Created February 25, 2020 14:20
terminal-colors.sh (this is how it looks like: https://d.pr/free/i/Ovrwza)
echo "----- BG COLORS -----"
echo "\033[40m BLACK BG \033[0m"
echo "\033[41m RED BG \033[0m"
echo "\033[42m GREEN BG \033[0m"
echo "\033[43m YELLOW BG \033[0m"
echo "\033[44m BLUE BG \033[0m"
echo "\033[45m MAGENTA BG \033[0m"
echo "\033[46m CYAN BG \033[0m"
echo "\033[47m LIGHT_GRAY BG \033[0m"
@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 / resize_preview.html
Created April 8, 2014 21:49
HTML5 FileReader + canvas resizer to resize & preview before upload an image using jquery.
<!DOCTYPE html>
<html>
<head>
<title>Angular HTML5 Preview, Crop And Upload</title>
<style>
body {
padding: 50px;
font: 16px Helvetica;
}