git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
[ | |
{ | |
"code": "aa", | |
"name": "Afar", | |
"native": "Afar" | |
}, | |
{ | |
"code": "ab", | |
"name": "Abkhazian", | |
"native": "Аҧсуа" |
history.replaceState && history.replaceState( | |
null, '', location.pathname + location.search.replace(/[\?&]message=[^&]+/, '').replace(/^&/, '?') | |
); |
/* -------------------------------------------------------------------------- */ | |
// All Bootstrap 4 Sass Mixins [Cheat sheet] | |
// @author http://anschaef.de | |
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins | |
/* -------------------------------------------------------------------------- */ | |
// Grid variables | |
$grid-columns: 12 !default; | |
$grid-gutter-width: 30px !default; |
<?php | |
function convert_non_persian_chars_to_persian ($str) { | |
//main goal: arabic chars: from U+0600 (؀) to ۿ U+06FF (ۿ) | |
//source: https://unicode-table.com/en | |
$right_chars = array ( | |
'ا', | |
'ب', | |
'پ', | |
'ت', | |
'ث', |
function extend(target_object) { | |
// Look for additional parameters in this function | |
// eg. extend(target_object, ....a,b,c,d) | |
if (!arguments[1]) { | |
return; | |
} | |
// If any extra arguments, which are objects | |
// loop through them | |
for (var index = 1; index < arguments.length; index++) { |
// @SOURCE: https://stackoverflow.com/a/4673436/4864081 | |
// First, checks if it isn't implemented yet. | |
if (!String.prototype.format) { | |
String.prototype.format = function() { | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match |
<?php | |
namespace WPSE; | |
/** Plugin Name: Google JSAPI test plugin */ | |
add_action( 'admin_enqueue_scripts', __NAMESPACE__.'\addScripts' ); | |
function addScripts() | |
{ | |
wp_enqueue_script( |
<?php | |
/* | |
Copyright (c) 2012, Manu Manjunath | |
All rights reserved. | |
Redistribution and use of this program in source/binary forms, with or without modification are permitted. | |
Link to this gist is preferred, but not a condition for redistribution/use. | |
*/ | |
function mail_with_attachments($to, $subject, $message, Array $filepaths, $from = null, $replyto = null) { |
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i; | |
return input.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title){ | |
if (index > 0 && index + match.length !== title.length && | |
match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && | |
(title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') && | |
title.charAt(index - 1).search(/[^\s-]/) < 0) { | |
return match.toLowerCase(); | |
} |