Skip to content

Instantly share code, notes, and snippets.

View omidnasri's full-sized avatar
🏢
PTFCH

Omid Nasri omidnasri

🏢
PTFCH
View GitHub Profile
@omidnasri
omidnasri / ReplaceYeKe.sql
Created June 27, 2020 09:17 — forked from Hameds/ReplaceYeKe.sql
Replace Arabic ي & ك in SQL Server Database with Persian characters
use [DATABASE_NAME];
DECLARE @Table NVARCHAR(MAX)
DECLARE @Col NVARCHAR(MAX)
DECLARE Table_Cursor CURSOR
FOR
--پيدا کردن تمام فيلدهاي متني تمام جداول ديتابيس جاري
SELECT a.name, --table
b.name --col
FROM sysobjects a,
syscolumns b
using System.Collections.Generic;
using System.Linq;
 
namespace NumberToWordsLib
{
 /// <summary>
 /// Number to word languages
 /// </summary>
 public enum Language
 {
@omidnasri
omidnasri / SavePerson.php
Last active May 26, 2019 11:38
A simple solution to store person in CRM.
<?php
/**
* Target: SavePerson
*
* Authors: Hossein Neshati, Omid Nasri
*
* Description: A simple solution to store person in CRM.
*
* Version: 1.0
@omidnasri
omidnasri / DeletePersonById.php
Last active May 26, 2019 11:39
A simple solution to delete person entity by ID.
<?php
/**
* Target: DeletePersonById
*
* Authors: Omid Nasri
*
* Description: A simple solution to delete person entity by ID.
*
* Version: 1.0
@omidnasri
omidnasri / SlackClient.cs
Created February 26, 2019 20:18 — forked from jogleasonjr/SlackClient.cs
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@omidnasri
omidnasri / active.md
Created February 6, 2019 07:40 — forked from paulmillr/active.md
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@fordnox
fordnox / check-ftp.php
Created April 5, 2017 13:17
Check ftp connection with PHP
<?php
$host = 'example.com';
$password = 'pass';
$username = 'username';
try {
$result = checkFtp($host, $username, $password);
} catch(Exception $e) {
$result = $e->getMessage();
}
@yeganemehr
yeganemehr / iran-provinces-coordinates.json
Created August 30, 2016 22:01
Coordinates provinces of Iran
{
"@copyright" : "https://fa.wikipedia.org/wiki/%D9%85%D8%AE%D8%AA%D8%B5%D8%A7%D8%AA_%D9%85%D8%B1%DA%A9%D8%B2_%D8%A7%D8%B3%D8%AA%D8%A7%D9%86%E2%80%8C%D9%87%D8%A7%DB%8C_%D8%A7%DB%8C%D8%B1%D8%A7%D9%86",
"East Azerbaijan": {
"Lat": 38.052468,
"Lng": 46.284993
},
"West Azerbaijan": {
"Lat": 37.529607,
"Lng": 45.046549
},
Here’s how to update your fork directly from GitHub (as shown in the video above):
1 Open your fork repository on GitHub.
2 Click on Pull Requests.
3 Click on New Pull Request. By default, GitHub will compare the original with your fork, and there shouldn’t be nothing to compare if you didn’t make any changes.
4 Click on switching the base (if no changes were made in the fork) or click Edit and switch the base manually. Now GitHub will compare your fork with the original, and you should see all the latest changes.
5 Click on Create to create a pull request for this comparison and assign a predictable name to your pull request (e.g., Update from original).
6 Click on Send pull request.
7 Scroll down and click Merge pull request and finally Confirm merge (If your fork didn’t have any changes, you will be able to merge it automatically).
@Hameds
Hameds / ReplaceYeKe.sql
Last active February 3, 2023 16:33
Replace Arabic ي & ك in SQL Server Database with Persian characters
use [DATABASE_NAME];
DECLARE @Table NVARCHAR(MAX)
DECLARE @Col NVARCHAR(MAX)
DECLARE Table_Cursor CURSOR
FOR
--پيدا کردن تمام فيلدهاي متني تمام جداول ديتابيس جاري
SELECT a.name, --table
b.name --col
FROM sysobjects a,
syscolumns b