Skip to content

Instantly share code, notes, and snippets.

🍕
eating pizza and being happy making code.

Carlos Levano calevano

🍕
eating pizza and being happy making code.
Block or report user

Report or block calevano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@calevano
calevano / array_multidimensional.php
Created Aug 19, 2019
search value in array multidimensional
View array_multidimensional.php
$key = array_search('100', array_column($userdb, 'uid'));
View order_array_to_value
$new = [
[
'hashtag' => 'a7e87329b5eab8578f4f1098a152d6f4',
'title' => 'Flower',
'order' => 3,
],
[
'hashtag' => 'b24ce0cd392a5b0b8dedc66c25213594',
'title' => 'Free',
@calevano
calevano / removeIndexArray.js
Created May 16, 2018
function to remove index in array
View removeIndexArray.js
function remove(array, element) {
const index = array.indexOf(element);
if (index !== -1) {
array.splice(index, 1);
}
}
@calevano
calevano / execute_search_key_list_store_procedure.sql
Created Feb 21, 2018
Search definition in Store Procedure in sqlServer
View execute_search_key_list_store_procedure.sql
SELECT
ROUTINE_NAME ,ROUTINE_DEFINITION
FROM
INFORMATION_SCHEMA.ROUTINES
WHERE
ROUTINE_DEFINITION LIKE '%Letter%'
AND ROUTINE_TYPE = 'PROCEDURE'
ORDER BY ROUTINE_NAME
@calevano
calevano / openModal.js
Last active Jan 30, 2018
Create simple openModal
View openModal.js
#In view
<a href="[_route_]"
class="btn btn btn-success btn-circle btn-xs zmdi zmdi-edit"
data-toggle='modal'
data-target="#openModal"
data-tamanio='lg'>
</a>
#OpenModal
@calevano
calevano / ChangeColumnLength
Created Dec 26, 2017
Laravel 5.2 Console Comand, Alter table with arguments, options... php artisan change-column-table [argument] [--options]
View ChangeColumnLength
public function handle()
{
$tableName = $this->argument('table');
if ($tableName != null) {
$table = Schema::hasTable($tableName);
if ($table) {
$columnName = $this->option('column');
if ($columnName != null) {
$column = Schema::hasColumn($tableName, $columnName);
if ($column) {
View cleanTildeCharacterSpecial
<?hp
function url_amigable($url) {
//$urlMinuscula = strtolower($url);
$buscarLetra = array('Á', 'É', 'Í', 'Ó', 'Ú', 'Ñ', 'á', 'é', 'í', 'ó', 'ú', 'ñ');
$reemplazar = array('A', 'E', 'i', 'O', 'U', 'N', 'a', 'e', 'i', 'o', 'u', 'n');
$urlNueva = str_replace($buscarLetra, $reemplazar, $url);
$buscarCaracteres = array(' ', '&', '\r\n', '\n', '+');
$urlAceptable = str_replace($buscarCaracteres, ' ', $urlNueva);
//$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
//$repl = array('', '-', '');
@calevano
calevano / distritos.sql
Created Jul 20, 2017
Tabla de Distrito asociado a una provincia
View distritos.sql
INSERT INTO `distritos` (`id`, `distrito`, `provincia_id`) VALUES
(1, 'CHACHAPOYAS', 1),
(2, 'ASUNCION', 1),
(3, 'BALSAS', 1),
(4, 'CHETO', 1),
(5, 'CHILIQUIN', 1),
(6, 'CHUQUIBAMBA', 1),
(7, 'GRANADA', 1),
(8, 'HUANCAS', 1),
(9, 'LA JALCA', 1),
@calevano
calevano / provincias.sql
Created Jul 20, 2017
Tabla de Provincias asociados a una region
View provincias.sql
INSERT INTO `provincias` (`id`, `provincia`, `region_id`) VALUES
(1, 'CHACHAPOYAS ', 1),
(2, 'BAGUA', 1),
(3, 'BONGARA', 1),
(4, 'CONDORCANQUI', 1),
(5, 'LUYA', 1),
(6, 'RODRIGUEZ DE MENDOZA', 1),
(7, 'UTCUBAMBA', 1),
(8, 'HUARAZ', 2),
(9, 'AIJA', 2),
@calevano
calevano / regiones.sql
Created Jul 20, 2017
Tabla de regiones
View regiones.sql
INSERT INTO `regiones` (`id`, `region`) VALUES
(1, 'AMAZONAS'),
(2, 'ANCASH'),
(3, 'APURIMAC'),
(4, 'AREQUIPA'),
(5, 'AYACUCHO'),
(6, 'CAJAMARCA'),
(7, 'CALLAO'),
(8, 'CUSCO'),
(9, 'HUANCAVELICA'),
You can’t perform that action at this time.