This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Cast string to array. The separator is space ' ' or comma ','. | |
* @param $string | |
* @return array | |
*/ | |
function string2array($string) { | |
$array = array(); | |
if( is_string($string) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hex2rgba($hex, $a = '1') { | |
$hex = str_replace('#', '', $hex); | |
if(strlen($hex) === 3) { | |
$r = hexdec( substr($hex,0,1) . substr($hex,0,1) ); | |
$g = hexdec( substr($hex,1,1) . substr($hex,1,1) ); | |
$b = hexdec( substr($hex,2,1) . substr($hex,2,1) ); | |
} else { | |
$r = hexdec( substr($hex,0,2) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use: | |
* $array = ('Hi', 'World') | |
* $array = manageArray('Foo, Bar Foobar', 'World'); | |
* // output: | |
* // $array = ('Hi', 'Foo', 'Bar', 'Foobar') | |
*/ | |
function easyArrayManage ($array, $addElements = '', $removeElements = '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN Oropesa | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www.oropensando.com$ [NC] | |
RewriteRule ^(.*)$ http://oropensando.com/$1 [L,R=301] | |
</IfModule> | |
# END Oropesa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isset_get( $array, $key, $default = null ) { | |
return isset( $array[ $key ] ) ? $array[ $key ] : $default; | |
} | |
/* | |
* In Wordpress, the most common PHP warning is when it uses an array index without check if that index is valid. | |
* So, you have to ask if the array index is valid: | |
* if( isset( $array['index'] ) ) | |
* And then you can use it: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* BOOTSTRAP: SIZE EXTRA LARGE | |
*/ | |
@screen-xl-min: 1480px; | |
@screen-lg-max: (@screen-xl-min - 1); | |
@container-extra-large-desktop: ((1420px + @grid-gutter-width)); | |
@container-xl: @container-extra-large-desktop; | |
@modal-xl: 1100px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Make PHPStorm ignore .idea folder | |
|- File > Settings > Version Control > Ignored Files > Add(+) > Ignored all files under > select directory .idea | |
2. Clean PhpStorm Git Cache | |
|- Open Terminal (Left+Down) #> "C:\Program Files (x86)\Git\cmd\git.exe" rm -f --cached .idea/* | |
or | |
|- Open Terminal (Left+Down) #> git rm -f --cached .idea/* | |
3. Reboot PhpStorm | |
\- Done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install SSH2 and PHP mod, and restart Apache2 | |
|- #> sudo apt-get install libssh2-1-dev libssh2-php | |
\- #> sudo service apache2 restart | |
2. Generate RSA keys, Create authorized_keys, and Update permissions | |
|- #> ssh-keygen | |
|- TIP: do not save them in your web directory | |
|- #> cd .ssh/ | |
|- #> cp id_rsa.pub authorized_keys | |
|- #> cd ../ | |
|- #> chmod 775 .ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function alisios_add_user_column_registered( $columns ) { | |
$columns[ 'user_registered' ] = 'Register Date'; | |
return $columns; | |
} | |
add_filter( 'manage_users_columns', 'alisios_add_user_column_registered' ); | |
function alisios_add_user_sortable_column_registered( $columns ) { | |
$columns[ 'user_registered' ] = 'user_registered'; | |
return $columns; |
OlderNewer