Skip to content

Instantly share code, notes, and snippets.

View akmandev's full-sized avatar
🐧
Focusing

Ozan Akman akmandev

🐧
Focusing
View GitHub Profile
add_newline = false
format = """
$directory\
$git_branch\
$git_commit\
$git_state\
$git_metrics\
\n\
$character"""
{
"preset": "laravel",
"rules": {
"fully_qualified_strict_types": true,
"clean_namespace": true,
"no_superfluous_phpdoc_tags": true,
"ordered_imports": {
"imports_order": ["class", "function", "const"],
"sort_algorithm": "alpha"
},
@akmandev
akmandev / PhpStorm_WSL_ActionsOnSave_PhpCsFixer.md
Last active November 27, 2022 11:12
Phpstorm WSL, Php cs fixer

PhpStorm WSL, Format on Save using PhpCsFixer

File Watcher

File type: PHP
Program: wsl
Arguments: php /ubuntu/path/to/php-cs-fixer fix /ubuntu/path/to/project/$/FileRelativePath$

Tools > Actions on Save

@akmandev
akmandev / Dockerfile
Last active February 23, 2020 22:35
Nginx & Php container based on Alpine Linux
## Simple Usage: docker build -t web . && docker run -p 80:8080 -it --name="web" web
FROM alpine:latest
LABEL Maintainer="Tim de Pater <code@trafex.nl>, Ozan Akman <info@ozanakman.com.tr>" \
Description="Lightweight Nginx & PHP container based on Alpine Linux."
# trust this project public key to trust the packages.
ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
# make sure you can use HTTPS
@akmandev
akmandev / php74-install.sh
Created October 18, 2019 11:23
PHP 7.4 Installation - Ubuntu/Elementary OS
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4
php -v
sudo apt-get install -y php7.4-{curl,mbstring,mcrypt,opcache,xml,readline,zip,gd}
/**
* Originally created by: https://github.com/mdunham/delete-fb-messages
* Edited for the latest UI changes by Ozan Akman
*/
(function($){
var
stepOne = function(){
if (null !== $('div[aria-label="Conversation actions"]')) {
$('div[aria-label="Conversation actions"]').click();
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
alias cdr="cd ~/Repositories"
alias phpunit="./vendor/bin/phpunit"
alias unixtime="date +%s"
alias c="clear"
gc() {

Ubuntu, WiFi adapter not working

In this example: my adapter was TP Link Archer T4U

sudo apt-get update

sudo apt-get install dkms

wget https://github.com/abperiasamy/rtl8812AU_8821AU_linux/archive/master.zip

@akmandev
akmandev / GetRandomFilesFromDirectoryRecursively.php
Created March 22, 2018 14:27
Fastest way to get random files from a directory (Recursively)
<?php
$directory = '/folder/name/etc';
$length = 100;
$command = 'find "' . $directory . '" -type f | shuf -n ' . $length . ';';
exec($command, $paths);
// $paths will contain every files with their paths as an array
@akmandev
akmandev / sortByMultipleColumns.php
Last active September 16, 2017 10:08
Laravel - sortBy Multiple Columns
<?php
// Laravel collections - sorting by multiple columns;
$collection->sortBy(function ($post) {
return sprintf('%s%s', $post->column, $post->relation->column);
});