Skip to content

Instantly share code, notes, and snippets.

View MostafaNorzade's full-sized avatar
🎯
Focusing

Mostafa Norzade MostafaNorzade

🎯
Focusing
View GitHub Profile
sudo /etc/init.d/apache2 stop
sudo /opt/lampp/lampp start
@MostafaNorzade
MostafaNorzade / Bash_Aliases.example
Last active March 14, 2019 05:46
Bash Aliases Example
## General Things
## -------------------
alias ip="ipconfig getifaddr en0"
alias ipx="curl ipecho.net/plain; echo"
## Git Things
## -------------------
@MostafaNorzade
MostafaNorzade / PHPStorm.xml
Last active June 14, 2026 08:06
PHPStrom Code Style Settings | Setting > Editor > CodeStyle > Scheme > Import Scheme > intillij IDE XML
<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" />
@MostafaNorzade
MostafaNorzade / wordpress_plugin.php
Last active February 19, 2020 07:55
Learn wp plugin
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
//---------------------- 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)
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
export PATH
SELECT SUM(price), DATE(created_at) FROM payments WHERE DATE(created_at)>='2019-08-31' GROUP BY DATE(payments.created_at);
//--- select VIP payements
SELECT user_id,COUNT(*) as count
FROM `payments`
WHERE course_id='VIP' and payment=1
GROUP BY user_id
ORDER BY count DESC
@MostafaNorzade
MostafaNorzade / HTTPD config
Last active March 10, 2020 22:57
HTTPD config for change public_html route
|*if !SUB|
ServerAlias *.|DOMAIN|
|?DOCROOT=/home/admin/domains/Domain.com/MyProjectFolder/public|
|*endif|
#!/bin/bash
# setup-laravel-php84-ssh.sh
# Automated Laravel setup on Ubuntu with PHP 8.4 and SSH keys for GitLab (using non‑root deploy user)
set -e
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with sudo!"
exit 1
fi
public function analyze($chord): array
{
$prompt = "Analyze this chord progression:
{$chord}
Analyze Persian song lyrics and chords.
Return ONLY compact valid JSON.
Rules:
- Persian output