Skip to content

Instantly share code, notes, and snippets.

Working from home

Nasser Rafie geminorum

Working from home
View GitHub Profile
geminorum / reset.js
Created Mar 25, 2022
form resetting jQuery to clear any values from `input` types that are not hidden and neither a `checkbox` nor `radio` type
View reset.js
$('input:not([type="checkbox"]):not([type="radio"]):visible, textarea:visible', form).val('');
View .htaccess
# OLD:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# BEGIN Redirect HTTP to HTTPS
geminorum / remove-message.js
Created Jan 2, 2020 — forked from simonw/remove-message.js
JavaScript one-liner for removing a ?message=... parameter from the visible URL in the browser
View remove-message.js
history.replaceState && history.replaceState(
null, '', location.pathname +[\?&]message=[^&]+/, '').replace(/^&/, '?')
geminorum / bootstrap-4-sass-mixins-cheat-sheet.scss
Created Nov 29, 2019 — forked from mattez/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples] #BS4
View bootstrap-4-sass-mixins-cheat-sheet.scss
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// @author
// @see
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
geminorum / Convert like-Persian characters to Persian characters A PHP function for convert like-Persian characters to Persian characters
View Convert like-Persian characters to Persian characters
function convert_non_persian_chars_to_persian ($str) {
//main goal: arabic chars: from ؀ U+0600 (&#1536;) to ۿ U+06FF (&#1791;)
$right_chars = array (
geminorum / object_inheritance_function.js
Created Oct 18, 2019 — forked from kn9ts/object_inheritance_function.js
How jQuery's $.extend function works, a way for object to inherit other objects properties and functions
View object_inheritance_function.js
function extend(target_object) {
// Look for additional parameters in this function
// eg. extend(target_object, ....a,b,c,d)
if (!arguments[1]) {
// If any extra arguments, which are objects
// loop through them
for (var index = 1; index < arguments.length; index++) {
View gist:14ee2f094750d43a512fd0a63e317603
View gist:a7789578f18754c2b8ddfb69e191abd6

1. Clone your fork:

git clone

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

cd into/cloned/fork-repo
git remote add upstream 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.

View .editorconfig
root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab