Skip to content

Instantly share code, notes, and snippets.

View danielmme's full-sized avatar

Daniel M. Medeiros danielmme

  • Innovare Technologies
  • Osasco
View GitHub Profile
id: course_variation
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags:
- 'Drupal 7'
- Content
migration_group: drupal_7
label: 'Course nodes'
source:
@danielmme
danielmme / Course.php
Created May 22, 2023 13:52
Drupal 7 course variation source
<?php
namespace Drupal\migrate\Plugin\migrate\source;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
use Drupal\paragraphs\Plugin\migrate\field\FieldCollection;
/**
* Drupal 7 course variation source.
@danielmme
danielmme / local.settings.php
Created May 22, 2023 13:40
Set up the migration D7 Database
$databases['migrate']['default'] = [
'database' => 'database',
'username' => 'mysql',
'password' => 'mysql',
'host' => 'drupal_7',
'port' => '3306',
'driver' => 'mysql',
'prefix' => '',
];
systemctl status nginx
crontab [ -u user ] [ -i ] { -e | -l | -r }
(default operation is replace, per 1003.2)
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)
-i (prompt before deleting user's crontab)
crontab -l -u www-data
crontab -e -u www-data
sudo service cron restart
select table_name as "Table Name",sum(data_length+index_length)/1024/1024 as "Table Size in MB" from information_schema.tables;
select table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'database name';
@danielmme
danielmme / CertificadodeConclusaodeCurso.sol
Created July 5, 2018 01:26
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.18;
contract EmissaodeCertificados {
string public nomeCurso = "Física";
string public nomeAluno = "Daniel M Medeiros";
string public emailAluno = "medeiros.danielm@gmail.com";
address public ProfessorResponsavel = 0xE2cA82616ef026ff45143705f63830F62Bf0aede;
address public Aluno = 0xd4fd25d18118336e95016d532dad4b23d1610a5f;
address public InstituicaoEmissora;
@danielmme
danielmme / FigurinhaDaCopa.sol
Created June 26, 2018 01:03
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.18;
contract NomeDoContrato {
// [tipo] [visibilidade] [nome] = [valor] [opcional]
uint public idade = 10;
string public nomeJogador = "Neymar Jr";
uint public numeroCamisa = 10;
string public selecao = "Brasil";
address public dono;
@danielmme
danielmme / contratoqualquer.sol
Created June 26, 2018 00:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.18;
contract ContratoQualquer {
// variável qualquer
string public valor;
// função qualquer
function alterarValor(string novoValor) public {
valor = novoValor;
}
function hook_menu(){
$items = array();
$items['mycustompage/%'] = array(
'page arguments' => array(1),
'page callback' => 'page_example',
'access_callback' => TRUE,
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);