Skip to content

Instantly share code, notes, and snippets.

View omidnasri's full-sized avatar
🏢
PTFCH

Omid Nasri omidnasri

🏢
PTFCH
View GitHub Profile
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).
@ajaxray
ajaxray / cookies.min.js
Created November 26, 2012 09:32
Small JavaScript class to help create, read and delete cookie. [compressed]
/**
* Cookies - [compressed] A small class to manipulate cookies from javascript
* Uncompressed version: https://gist.github.com/gists/4139367
*/
window.Cookies={set:function(e,t,n,r){if(n){var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var s="; expires="+i.toGMTString()}else var s="";var o=r||"/";document.cookie=e+"="+t+s+"; path="+o},get:function(e){var t=e+"=";var n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return i.substring(t.length,i.length)}return null},"delete":function(e){this.set(e,"",-1)}}
@koldev
koldev / Logger.cs
Created September 23, 2014 10:36
Simple C# Logger class for writing log entries to console and/or file
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
public sealed class Logger
{
[Flags]
public enum Targets
{
@razvanstan
razvanstan / [jQuery] find element by data attribute
Created June 17, 2013 04:47
[jQuery] find element by data attribute
$('#id').find('[data-name="' + js_var + '"]');
@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)
@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
{
@ivandnepr90
ivandnepr90 / FtpHelper.php
Created November 21, 2014 14:35
Ftp helper
<?php
/**
* Created by JetBrains PhpStorm.
* User: dn211290sia
* Date: 25.10.14
* Time: 10:00
* To change this template use File | Settings | File Templates.
*/
namespace Common\Utility\GeneralPurpose;
@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
using System.Collections.Generic;
using System.Linq;
 
namespace NumberToWordsLib
{
 /// <summary>
 /// Number to word languages
 /// </summary>
 public enum Language
 {