Skip to content

Instantly share code, notes, and snippets.

View saeedvir's full-sized avatar
🎯
Focusing

saeed abdollahian saeedvir

🎯
Focusing
View GitHub Profile
@saeedvir
saeedvir / php_get_server_info.php
Last active February 15, 2024 08:14
php get server info (+shared-host) without use COM
<?php
/*
Saeed Abdollahian
Telegram:
https://t.me/PhpWebDeveloper
*/
function getServerLoad()
{
$load = 0;
@alisalehi1380
alisalehi1380 / clean_code.md
Last active October 5, 2024 18:52
نکات_کلیدی_کتاب_کلین_کد
کدی تمیز است که به راحتی توسط همه ی اعضای تیم قابل درک باشد. کد تمیز میتواند توسط توسعه دهنده ای به غیر از نویسنده ی آن، خوانده و توسعه داده شود. خوانایی، قابلیت نگهداری، تغییر و توسعه پذیری کد، تنها زمانی امکان پذیر است که شما درک درستی از نحوه ی کار کد پیدا کنید.

قوانین عمومی

@saeedvir
saeedvir / ApiDataResponse.php
Last active August 2, 2024 21:41
Standard API Response in PHP
<?php
/**
* Standard API Response in PHP
*
* https://github.com/obiefy/api-response
*
* @author Saeedvir [
* 'email' => 'saeed.es91@gmail.com',
* 'telegram' => 'https://t.me/PhpWebDeveloper'
* ]
@saeedvir
saeedvir / DataStructureGenerator.php
Last active July 20, 2020 09:01
Generate data in key/value structure / For ex: for admin panel dashboard
<?php
/**
*
* @author Saeedvir [
* 'email' => 'saeed.es91@gmail.com',
* 'telegram' => 'https://t.me/PhpWebDeveloper'
* ]
* @usage :
$dataGenerator = new DataStructureGenerator('data', true,true);
$dataGenerator->setData('users', 8);
@mccabe615
mccabe615 / phpdangerousfuncs.md
Last active October 11, 2024 22:00
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
@zouyangdev
zouyangdev / OpenWithSublimeText.bat
Last active January 15, 2020 07:28 — forked from cstewart90/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 10)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
pause
@JeffreyWay
JeffreyWay / laravel.js
Last active October 9, 2024 03:43
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@gaelbillon
gaelbillon / .htaccess
Created September 29, 2012 13:56
custom htaccess for speed, cache, gzip, ETags, etc
### ENVIRONMENT VARIABLES ###
SetEnv PHP_VER 5
SetEnv REGISTER_GLOBALS 0
### MAIN DEFAULTS ###
Options All -Indexes
DirectoryIndex index.html index.htm index.php
AddDefaultCharset UTF-8
### MIME TYPES ###