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 / skipper.js
Last active October 27, 2017 00:23
Skip and bypass the wait
// Inject start document code
Object.defineProperty(window, 'ysmm', {
set: function(val) {
var T3 = val,
I = '',
X = '',
key;
for (var m = 0; m < T3.length; m++) {
if (m % 2 == 0) {
{
"bin" : "10101101"
}
@lenivene
lenivene / hash-tag.php
Created October 21, 2017 23:08
Get hash tag with php
<?php
/*
* First array return "tags" with hash, example: #Example
* Second "tag" return without hash, Example: Example
*
* @string $tweet The text
* @function preg_match_all | Pattern | @string $tweet (The text) | @array $tags (output array the tags)
* @return array $tags
*/
$twet = "But I must #explain to u how all this #mistaken idea of #denouncing pleasure and praising pain was born and I'll #give you a complete accout";
@lenivene
lenivene / jquery.removeClassPrefix.js
Created November 1, 2017 16:51
jQuery function Remove Class by Prefix
$.fn.removeClassPrefix = function( prefix ){
var element = jQuery(this);
return this.each(function(){
var c = this.classList;
jQuery.each(c, function(i, className) {
if( className.indexOf( prefix + "-" ) > -1 ){
element.removeClass( className );
}
});
})
@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
@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 / query.sql
Created January 24, 2018 21:37
Delete all rows table
truncate table `table_name_here`
@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 / 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 / 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"