Skip to content

Instantly share code, notes, and snippets.

View luzzardi's full-sized avatar
:octocat:

André Luzzardi de Carvalho luzzardi

:octocat:
View GitHub Profile
@luzzardi
luzzardi / module_name.module.php
Last active February 16, 2024 17:28
Preprocess page and get menu item for the current node and load all menu parent three
<?php
/**
* @file
* Primary module hooks for module.
*
* @DCG
* This file is no longer required in Drupal 8.
* @see https://www.drupal.org/node/2217931
*/
@luzzardi
luzzardi / rector.php
Created August 21, 2023 16:58
Rector script
<?php
declare(strict_types=1);
use DrupalFinder\DrupalFinder;
use DrupalRector\Set\Drupal8SetList;
use DrupalRector\Set\Drupal9SetList;
use Rector\Config\RectorConfig;
// Drupal rector file to check code deprecation and updaate it.
@luzzardi
luzzardi / LazyLoad.js
Last active November 26, 2015 21:53
LazyLoad.js
// I didn't test this yet, please feel free to comment
var LazyLoad = function(imagesIds) {
this.imagesSrc = [];
this.init(imagesIds);
return this;
};
LazyLoad.prototype = {
init: function(imagesId) {
if (imagesId && imagesId.length > 0) {
#include <stdio.h>
int main()
{
int m[10][10];
int i=0, j=0;
for(i=0; i<10; i++) {
for(j=0; j<10; j++) {
m[i][j]=rand()%100;
<?php
$matriz = array(); // [] significa iniciar um array vazio em php.
$i = 0; // Indice da matriz inicial
$j = 0; // php nao tem definição de tipos, ele vai assumir o valor que eu passar, no caso i e j serão Inteiros (int)
for ($i = 0; $i < 10; $i++) {
for ($j = 0; $j < 10; $j++) {
matriz[$i][$j] = rand(); // PHP tem a função rand que retorna um numero random.
}
}