Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nasser Rafie geminorum

🏠
Working from home
View GitHub Profile
@geminorum
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: https://www.janes.co.za/quick-tip-force-ssl-with-htaccess/
<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]
</IfModule>
# BEGIN Redirect HTTP to HTTPS
# https://www.wpfastestcache.com/tutorial/how-to-redirect-all-http-to-https-htaccess/
@geminorum
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 + location.search.replace(/[\?&]message=[^&]+/, '').replace(/^&/, '?')
);
@geminorum
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 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;
@geminorum
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
<?php
function convert_non_persian_chars_to_persian ($str) {
//main goal: arabic chars: from ؀ U+0600 (&#1536;) to ۿ U+06FF (&#1791;)
//source: https://unicode-table.com/en
$right_chars = array (
'ا',
'ب',
'پ',
'ت',
'ث',
@geminorum
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]) {
return;
}
// If any extra arguments, which are objects
// loop through them
for (var index = 1; index < arguments.length; index++) {
View gist:14ee2f094750d43a512fd0a63e317603
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
View gist:a7789578f18754c2b8ddfb69e191abd6

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
View contributing-to-wordpress-using-github.md

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
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab