This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /etc/init.d/apache2 stop | |
sudo /opt/lampp/lampp start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## General Things | |
## ------------------- | |
alias ip="ipconfig getifaddr en0" | |
alias ipx="curl ipecho.net/plain; echo" | |
## Git Things | |
## ------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<code_scheme name="Mostafa"> | |
<option name="OTHER_INDENT_OPTIONS"> | |
<value> | |
<option name="INDENT_SIZE" value="4" /> | |
<option name="CONTINUATION_INDENT_SIZE" value="8" /> | |
<option name="TAB_SIZE" value="4" /> | |
<option name="USE_TAB_CHARACTER" value="true" /> | |
<option name="SMART_TABS" value="true" /> | |
<option name="LABEL_INDENT_SIZE" value="0" /> | |
<option name="LABEL_INDENT_ABSOLUTE" value="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------ page title ------------------------------------- | |
//--------- main.blade.php ------- | |
<title>Laravel | @yield('pageTitle')</title> | |
//--------- home.blade.php ------- | |
@section('pageTitle', 'Home') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//----------------------------------------------- | |
//-------- Controller --------------------------- | |
//-------------------- resource route ---------- | |
Route::resource('users', 'UserController')->only(['index', 'show']); | |
Route::resource('users', 'UserController')->except(['destroy']); | |
// If run below command for create API controller : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://zarinp.al/91491 | |
<?php | |
/** | |
* Plugin Name: My Facebook Tags | |
* Plugin URI: http://danielpataki.com | |
* Description: This plugin adds some Facebook Open Graph tags to our single posts. | |
* Version: 1.0.0 | |
* Author: Daniel Pataki | |
* Author URI: http://danielpataki.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// create middleware with below command : | |
// php artisan make:middleware My_middelware_name | |
// then define this in Kernel.php | |
// we have 2 types middelware : 1-before 2-after | |
// example for 'before middleware': | |
public function handle($request, Closure $next) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------- users --------------------- | |
INSERT INTO laminor.users (id, name, nicename, email, password, created_at) | |
SELECT ID, display_name, user_nicename, user_email, user_pass, user_registered FROM academy.wp_users; | |
// ------------------- comments ----------------- | |
DELETE FROM wp_comments WHERE comment_agent = 'WooCommerce'; | |
DELETE FROM wp_comments WHERE comment_approved = 'spam'; | |
DELETE FROM wp_comments WHERE comment_approved = 'trash'; | |
INSERT INTO laminor.comments (id, user_id, created_at, approved, comment, commentable_id, parent_id, commentable_type, author, author_ip, author_email) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DirectoryIndex index.php | |
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//--- update or insert | |
INSERT INTO MyGuests (id, lastname) VALUES (2, 'Doe') | |
ON DUPLICATE KEY UPDATE lastname = 'Doe'; | |
UPDATE MyGuests SET lastname='Doe' WHERE id=2 | |
IF ROW_COUNT()=0 | |
INSERT INTO MyGuests (lastname, id) VALUES ('Doe',2); | |
OlderNewer