Skip to content

Instantly share code, notes, and snippets.

View lenivene's full-sized avatar
🖖
Full-stack dev

Lenivene Bezerra lenivene

🖖
Full-stack dev
View GitHub Profile
@lenivene
lenivene / function.php
Last active September 25, 2019 15:23
Check STRING is JSON
<?php
/**
* Check string is JSON
*
* @param string $json JSON to check
*
* @return boolean|array
*/
function is_json( $json = null, $_return = false ){
if( ! is_string( $json ) ){
@lenivene
lenivene / appstore.svg
Created April 18, 2018 18:22
Store button SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lenivene
lenivene / readme.md
Last active September 10, 2019 02:03
XAMPP: Import Big File SQL

Do u have a problem?

I'm problems solution (haha, ̶ s̶h̶u̶t̶ ̶u̶p̶ ).

Are u ready?

1 - Terminal

Open your CMD, Power Shell and among others... (admin permission)

2 - The commands

@lenivene
lenivene / function.php
Last active April 13, 2018 23:02
Checa se um valor existe em uma string
<?php
function in_string( $needle, $haystack ){
if( !isset( $needle ) || isset( $needle ) && !is_string( $needle ) ){
$error['needle'] = 'Param $needle invalid';
}
if( !isset( $haystack ) || isset( $haystack ) && !is_string( $haystack ) ){
$error['$haystack'] = 'Param $needle invalid';
}
@lenivene
lenivene / country-dial-codes.json
Created March 26, 2018 13:31
Country Dial Codes
[
{
"name": "Aruba",
"code": "AW",
"dialling_code": "297"
},
{
"name": "Afghanistan",
"code": "AF",
"dialling_code": "93"
@lenivene
lenivene / function.php
Created February 18, 2018 17:40
Get initial letters
<?php
function initial_letters( $char ){
// Defaults
$pos = 0;
$saida = '';
if( !isset( $char ) ){
trigger_error( "Insert text", E_USER_ERROR );
return false;
}
@lenivene
lenivene / functions.php
Last active April 8, 2018 17:07
Check file is image by php
<?php
// Required PHP version >= 4.2.0
function is_image( $filename ){
$getImageSize = getimagesize( $filename );
$image_type = $getImageSize[2];
if( in_array( $image_type, array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP ) ) )
return true;
return false;
@lenivene
lenivene / query.sql
Created January 24, 2018 21:37
Delete all rows table
truncate table `table_name_here`
@lenivene
lenivene / fix-reset.css
Last active June 6, 2019 17:07
css fix all fonts css device/browser ios/safari
*, ::after, ::before {
font-family:inherit;
text-rendering:optimizeLegibility;
text-stroke:1px transparent;
-webkit-text-size-adjust:100%;
-moz-text-size-adjust:100%;
-ms-text-size-adjust:100%;
-webkit-font-smoothing:antialiased;
-moz-font-smoothing:antialiased;
-ms-font-smoothing:antialiased;
@lenivene
lenivene / functions.php
Created November 5, 2017 13:52
Remove fields checkout
<?php
add_filter( 'woocommerce_checkout_fields' , 'wp_remove_fields_checkout' );
function wp_remove_fields_checkout( $fields ){
/**
* All unset \/
* Nome
* Sobrenome
* Empresa
* Endereço