Skip to content

Instantly share code, notes, and snippets.

@geminorum
geminorum / object_inheritance_function.js
Created October 18, 2019 06:54 — forked from kn9ts/object_inheritance_function.js
How jQuery's $.extend function works, a way for object to inherit other objects properties and functions
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++) {
100.43.91.14
100.43.91.2
104.236.133.77
107.150.37.26
119.29.82.97
120.192.205.67
120.56.185.132
134.175.183.168
136.243.176.20
136.243.65.215
@geminorum
geminorum / gist:a7789578f18754c2b8ddfb69e191abd6
Created January 10, 2019 00:22 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

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

Contributing To WordPress (Using Git)

December 10, 2012

More and more people are realizing that git is awesome. Although the official WordPress source code still lives in an svn repository, you can contribute patches without having to touch svn ever again.

So, without further ado, here’s how you can generate and manage patches for WordPress Core (it assumes you’re comfortable with the command line).

1. Find a ticket to work on.

@geminorum
geminorum / .editorconfig
Last active July 30, 2019 14:13
dot files
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
@geminorum
geminorum / weeknumber.js
Created October 21, 2018 18:11
Week numbers in JavaScript
/// How to get the week number from a date
// The code below adds two new functions to the Date object. Add this to your source code.
// To get the ISO week number (1-53) of a Date object, mydate, use mydate.getWeek().
// To get the corresponding four-digit year, use mydate.getWeekYear().
// This script is released to the public domain and may be used, modified and
// distributed without restrictions. Attribution not necessary but appreciated.
// @SOURCE: https://weeknumber.net/how-to/javascript
// Returns the ISO week of the date.
@geminorum
geminorum / wpcf7-bs.html
Last active December 22, 2020 01:05
Contact Form 7 with Bootstrap
<div class="row">
<div class="col-md-6 mb-4">
[text* your-name akismet:author class:form-control placeholder "نام (ضروری)"]
</div>
<div class="col-md-6 mb-4">
[email* your-email akismet:author_email class:form-control placeholder "ایمیل (ضروری)"]
</div>
<div class="col-md-12 mb-4">
@geminorum
geminorum / company-code-IR.php
Last active July 30, 2019 14:13
شناسه ملی شرکت
<?php
// @REF: https://github.com/DevRoomOrg/ircheck/issues/1#issuecomment-348672401
// @REF: http://www.aliarash.com/article/shenasameli/shenasa_meli.htm
function checkNationalCode($nationalCode) {
if (strlen($nationalCode) != 11)
return false;
$c = intval(substr($nationalCode, 10, 1));
@geminorum
geminorum / numbred-sprintf.js
Last active October 10, 2017 23:30 — forked from rmariuzzo/sprintf.js
Javascript sprintf
// @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
علی آرش خداداد ۱۳۸۴
کد ۱۲۸ امکان کد گذاری همهٔ ۱۲۸ حرف مربوط به مجموعه کاراکترهای کد اسکی را ارائه می‌کند. این کد با استفاده از خطوط و فضاهای خالی با ۴ پهنای مختلف، به بیشترین فشردگی ممکن سمبل‌ها نسبت به روش‌های قدیمی‌تر خود که از خطوط و فضاهای خالی با ۲ ضخامت مختلف استفاده می‌کردند، رسیده است

کد ۱۲۸ ممکن است به صورت دو طرفه (از هر دو جهت) اسکن شود و محدودیتی هم برای تعداد کاراکترها در هر بارکد وجود ندارد. هر چند ممکن است طول بارکد با توجه به نوع اسکنر مورد استفاده و یا مکان مورد نظر برای چاپ بارکد محدود شود. اما این روش محدودیتی برای طول بارکد ایجاد شده ندارد.

کد ۱۲۸ سه مجموعه کاراکتری متفاوت دارد که در جدول مشخصات بارکد به نام‌های Code Set A و Code Set B و Code Set C مشخص شده است. هر کدام از این سه مجموعه کد می‌تواند با کاراکتر شروع مربوط به خودش مورد انتخاب واقع شود. کاراکتر خاص «shift» در هر مجموعه به شما امکان می‌دهد تا بتوانید در بین یک کد ست از کد ست‌های