Skip to content

Instantly share code, notes, and snippets.

View soroushmp's full-sized avatar
🎯
Focusing

soroush moradpour soroushmp

🎯
Focusing
View GitHub Profile
@majidalaeinia
majidalaeinia / convert_gregorian_date_to_jalali_date.md
Last active November 19, 2025 07:37
Convert Gregorian Date to Jalali (Shamsi - Persian) Date in Postgresql

Add Persian Calendar Functions to a Postgres Database

Here's the Ruby on Rails migration implementation:

class AddPersianCalendarFunctionsToDb < ActiveRecord::Migration[4.2]
  def up
    execute(
      <<-EOSQL
      DROP FUNCTION IF EXISTS startOfJalaaliMonth(timestamp);
@mhf-ir
mhf-ir / sheba.js
Created November 24, 2017 09:48
iranian sheba bank validation javascript | اعتبار سنجی کد شبا با جاوا اسکریپت
function iso7064Mod97_10(iban) {
var remainder = iban,
block;
while (remainder.length > 2){
block = remainder.slice(0, 9);
remainder = parseInt(block, 10) % 97 + remainder.slice(block.length);
}
return parseInt(remainder, 10) % 97;