Skip to content

Instantly share code, notes, and snippets.

@victorwpbastos
victorwpbastos / flatlist.js
Created May 22, 2020 16:47
Better performance paginated FlatList
import React, { useState, useEffect } from 'react';
import { Text, FlatList, View, TextInput, TouchableOpacity } from 'react-native';
let arr: any[] = [];
for (let i = 1; i <= 100; i++) {
arr.push({ id: i, text: `mensagem bacana #${i}` });
}
arr.reverse();
[
{
"clabe": "002",
"marca": "BANAMEX",
"nombre": "Banco Nacional de México, S.A., Institución de Banca Múltiple, Grupo Financiero Banamex"
},
{
"clabe": "006",
"marca": "BANCOMEXT",
"nombre": "Banco Nacional de Comercio Exterior, Sociedad Nacional de Crédito, Institución de Banca de Desarrollo"
@leoli-dev
leoli-dev / jquery-htmlentities.js
Created December 4, 2017 12:35
PHP HTML entiy functions (`htmlentities()` & `html_entity_decode()`) in jQuery
$.htmlentities = {
/**
* Converts a string to its html characters completely.
* It's equivalent to htmlentities() in PHP
* Reference: https://css-tricks.com/snippets/javascript/htmlentities-for-javascript/
*
* @param {String} str String with unescaped HTML characters
**/
encode (str) {
return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
@heiswayi
heiswayi / fm.php
Created October 25, 2017 14:00
Single PHP File Manager Script - Screenshot: https://i.imgur.com/4OtrKUz.png
<?php
/**
* File Manager Script
*/
// Default language ('en' and other from 'filemanager-l10n.php')
$lang = 'en';
// Auth with login/password (set true/false to enable/disable it)
$use_auth = true;
@sohelrana820
sohelrana820 / catch-php-output-buffering-data-jquery-ajax.php
Last active December 12, 2023 14:20
Get Streaming Data Over Jquery Ajax
<?php
/**
* Catch php output buffering data over jQuery AJAX
*
* @author: Sohel Rana (me.sohelrana@gmail.com)
* @author url: https://blog.sohelrana.me
* @link: https://blog.sohelrana.me/catch-php-output-buffering-data-jquery-ajax/
* @licence MIT
*/
@ewiggin
ewiggin / MailSender.php
Created November 9, 2015 10:26
Helper to send emails with PHPMailer and basic html templates.
<?php
/**
* MailSender
* Per utilitzar PHPMailer de forma molt més senzilla i
* utilitzant plantilles HTML.
*
* Dependencies:
* - PHPMailer
*
* @version 0.24
@mbijon
mbijon / xss_clean.php
Last active November 1, 2022 03:23
XSS filtering in PHP (cleans various UTF encodings & nested exploits)
<?php
/*
* XSS filter, recursively handles HTML tags & UTF encoding
* Optionally handles base64 encoding
*
* ***DEPRECATION RECOMMENDED*** Not updated or maintained since 2011
* A MAINTAINED & BETTER ALTERNATIVE => kses
* https://github.com/RichardVasquez/kses/
*
* This was built from numerous sources