Skip to content

Instantly share code, notes, and snippets.

View rasulsh's full-sized avatar
:octocat:

rasulsh

:octocat:
View GitHub Profile
@rasulsh
rasulsh / alias.cmd
Created January 15, 2025 07:24 — forked from benjamine/alias.cmd
Aliases for windows command line
::
:: Aliases for windows command line
::
:: Installation:
::
:: - create a folder for your aliases (eg: ```c:\cmd-aliases```)
:: - add that folder to your PATH variable
:: - save this script as setalias.cmd on that folder
:: - run "alias" to see usage
::
<?php
namespace DDB;
class MySQLi {
private $link;
public function __construct($hostname, $username, $password, $database, $port = '3306') {
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$this->link = new \mysqli($hostname, $username, $password, $database, $port);
<?php
public function addDocument($data = array()) {
// ایجاد یک نمونه از TransactionWrapper با استفاده از registry و اطلاعات اتصال به پایگاه داده
$transactionWrapper = new \DDB\TransactionWrapper($this->registry, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
// اجرای تراکنش با استفاده از متد execute
$result = $transactionWrapper->execute(function($tw) use ($data) {
try {
// دریافت شناسه کاربر
$user_id = $this->user->getId();
public function addDocument($data = array()) {
$user_id = $this->user->getId();
$user_selected_date = call_function($this->language->get('function_jtg'), $this->db->escape($data['user_selected_date']));
$document_note = strip_tags(trim($data['document_note']));
$this->db->query("INSERT INTO `" . DB_PREFIX . "finance_document` SET `user_id` = '" . $this->db->escape($user_id) . "', `user_selected_date` = '" . $this->db->escape($user_selected_date) . "', `document_note` = '" . $this->db->escape($document_note) . "'");
$document_id = $this->db->getLastId();
# Checked with ipinfo.io
# Soroush Rasanheh Company Ltd
87.107.96.0/22
87.107.88.0/22
87.107.68.0/22
87.107.52.0/23
87.107.51.0/24
87.107.42.0/23
87.107.34.0/23
87.107.24.0/22
@rasulsh
rasulsh / code-review-checklist.md
Last active January 8, 2022 12:50 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@rasulsh
rasulsh / Deploy_on_cPanel.md
Created July 19, 2021 05:15 — forked from dusta/Deploy_on_cPanel.md
Deploy your site with git on cPanel

Deploy your site with git on cPanel

The most important: You must have shell access!

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
  • your (PHP) scripts are served from /var/www/html/