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 / jQuery.iframe.js
Created October 13, 2016 18:28 — forked from monjer/jQuery.iframe.js
jQuery.iframe.js,simple jQuery plugin for iframe element
/**
* Simple jQuery plugin for iframe element .
*
* Note: The parent doc and iframe's embed doc must be in the same origin ,
* Domains, protocols and ports must match.
*
* reference:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
*
@omidnasri
omidnasri / cross-domainYQL.js
Created October 15, 2016 04:42 — forked from rickdog/cross-domainYQL.js
x-domain using YQL
// callback is optional, since jQuery has promises
function getFile(theURL, type, callback)
{
/*
* Original jQuery.ajax mid - CROSS DOMAIN AJAX
* @author James Padolsey (http://james.padolsey.com)
* @updated 12-JAN-10
* @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
* source: https://raw.github.com/padolsey/jquery.fn/master/cross-domain-ajax/jquery.xdomainajax.js
*
@omidnasri
omidnasri / gist:1d894550c5d582ffa8c0e64d8a5e73f6
Created December 19, 2016 18:19 — forked from Balya/gist:c29a7620efdebd5470d820f241c6090b
jQuery: Display favicon next to external link
jQuery(document).ready(function() {
jQuery("article a[href*='//']:not([href*='" + document.location.hostname + "']):not(:has(*))").each(function() {
jQuery(this).css({
background: "url(http://www.google.com/s2/favicons?domain=" + this.hostname + ") left center no-repeat",
"padding-left": "22px"
});
});
});
@omidnasri
omidnasri / gist:4008c480352d1955114a718e1d9f8687
Created December 19, 2016 18:23 — forked from smonteverdi/gist:2822016
jQuery: Display favicon next to external link
$("a[href^='http']").each(function() {
$(this).css({
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + this.hostname +
") left center no-repeat",
"padding-left": "20px"
});
});
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).
@omidnasri
omidnasri / README-Template.md
Created November 17, 2017 10:36 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@omidnasri
omidnasri / Logger.cs
Created January 16, 2018 20:05 — forked from koldev/Logger.cs
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
{
$('#id').find('[data-name="' + js_var + '"]');

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@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 => user.followers > 1000)