Skip to content

Instantly share code, notes, and snippets.

View BurakBoz's full-sized avatar
🏠
Working from home

Burak BOZ BurakBoz

🏠
Working from home
View GitHub Profile
@BurakBoz
BurakBoz / .zshrc
Last active October 8, 2023 03:11 — forked from jamiebullock/.zshrc
Manjaro zshrc adapted for Mac
## Options section
setopt correct # Auto correct mistakes
setopt extendedglob # Extended globbing. Allows using regular expressions with *
setopt nocaseglob # Case insensitive globbing
setopt rcexpandparam # Array expension with parameters
setopt nocheckjobs # Don't warn about running processes when exiting
setopt numericglobsort # Sort filenames numerically when it makes sense
setopt appendhistory # Immediately append history instead of overwriting
setopt histignorealldups # If a new command is a duplicate, remove the older one
@BurakBoz
BurakBoz / get-composer.bat
Created June 12, 2022 16:26
Download latest composer.phar file as named "composer" to current directory. useful when working different versions of php
@echo off
wget https://getcomposer.org/download/latest-stable/composer.phar -O %cd%\composer
@BurakBoz
BurakBoz / README.MD
Last active May 18, 2022 23:47
SMTP Test script

SMTP Test Script

This script checks if system firewall is blocking smtp ports.
For example: Godaddy hosting is usually blocks smtp ports.

Download script via shell

# download with wget
wget --no-check-certificate https://gist.githubusercontent.com/BurakBoz/6b370012b4e7c920db01cf4c9a7cc81a/raw/aa9fcdf29731460875aa15bf9b303eab47767d52/smtp-test.php -O smtp-test.php

# download with wget and run
@BurakBoz
BurakBoz / anyKeyValueOr.php
Last active March 31, 2022 09:49
PHP Helper Functions anyKeyValueOr
<?php
function anyKeyValueOr(array|object|null $haystack, array $acceptableKeys = [], $defaultValue = null)
{
if (is_null($haystack) or empty($acceptableKeys))
{
return $defaultValue;
}
$isObject = is_object($haystack);
$isArray = is_array($haystack);
@BurakBoz
BurakBoz / Readme.MD
Created November 1, 2021 12:17
Download & preserve folder structure all image resources on a wordpress web page via wget
@BurakBoz
BurakBoz / function_read_lines_me.php
Created November 16, 2020 13:46
PHP Function: Read Lines Memory Efficiently
<?php
/**
* Read Lines Memory Efficiently
* @param $file
* @param callable $callable
* @return bool
*/
function read_lines_me($file, callable $callable)
{
$handle = @fopen($file, "r");
@BurakBoz
BurakBoz / urlSafeBase64.php
Last active July 2, 2023 20:17
RFC Compliant URL Safe Base64 Encode and Decode functions for php
<?php
function urlsafe_base64_encode($string)
{
return str_replace(['+','/','='], ['-','_',''], base64_encode($string));
}
function urlsafe_base64_decode($string)
{
$string = str_replace(['-','_'], ['+','/'], $string);
$mod4 = strlen($string) % 4;
@BurakBoz
BurakBoz / Crontab.php
Created July 28, 2019 02:06
PHP Crontab shell command utilizer class
<?php
/**
* Class Crontab
* About: crontab shell command utilizer.
* Author: Burak BOZ
* GitHub: https://github.com/BurakBoz
* License: No License & Restrictions
*/
class Crontab
@BurakBoz
BurakBoz / README.md
Last active December 4, 2022 10:15
squid anonymous proxy server installation script debian
@BurakBoz
BurakBoz / allow
Last active July 18, 2020 12:22 — forked from Nilpo/allow
CSF Allow AND Ignore Cloudflare IP's.
for i in `curl https://www.cloudflare.com/ips-v4`; do csf -a $i; done
for i in `curl https://www.cloudflare.com/ips-v6`; do csf -a $i; done