This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
george@vm-ijme Downloads % php -v | |
PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS ) | |
Copyright (c) 1997-2016 The PHP Group | |
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies | |
with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies | |
george@vm-ijme Downloads % composer create-project cakephp/app test | |
Installing cakephp/app (3.3.1) | |
- Installing cakephp/app (3.3.1) | |
Loading from cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## backup each mysql db into a different file, rather than one big file | |
## as with --all-databases. This will make restores easier. | |
## To backup a single database simply add the db name as a parameter (or multiple dbs) | |
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is | |
## Create the user and directories | |
# mkdir -p /var/backups/mysql/databases | |
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup | |
## Remember to make the script executable, and unreadable by others |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
sudo apt-get install -y zerofree | |
sudo mount -r /dev/sda1 /mnt | |
sudo zerofree -v /dev/sda1 | |
sudo umount /dev/sda1 | |
sudo poweroff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use Zend\Barcode\Barcode; | |
header('Content-Type: image/gif'); | |
$barcodeOptions = [ | |
'text' => '202675653930240016120303473904220110529', | |
'barHeight' => '30', | |
'withChecksum' => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function generarCuilt($dni, $sexo) | |
{ | |
if (!empty($dni)) { | |
$dni = (string)$dni; | |
$prefix = $sexo === 'F' ? '27' : '20'; | |
$sum = ($prefix[0] * 5) + ($prefix[1] * 4); | |
foreach ([3, 2, 7, 6, 5, 4, 3, 2] as $key => $value) { | |
$sum += (int)$dni[$key] * $value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Model\Validation; | |
use Cake\Validation\Validator; | |
/** | |
* [CustomValidator description] | |
*/ | |
class CustomValidator extends Validator | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App.UI | |
{ | |
using System; | |
using System.Windows.Forms; | |
/// <summary> | |
/// Implementación de <see cref="IWin32Window"/>. | |
/// </summary> | |
internal class Win32Window : IWin32Window | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
/// <summary> | |
/// A Windows text box control with a cue banner. | |
/// </summary> | |
public class CueTextBox : TextBox | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
namespace ICSharpCode.TextEditor.UserControls | |
{ | |
class Int32TextBox : TextBox | |
{ | |
public int Min { get; set; } | |
public int Max { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Título | |
echo $this->Plataforma->obtenerTitulo(); // Tutorías | |
// Título con un texto adicional | |
echo $this->Plataforma->obtenerTitulo('texto adicional'); // Tutorías - texto adicional | |
// Comprobar si la instalación corresponde a Tutorías o Graduados | |
if ($this->Plataforma->esGraduados()) { | |
echo 'Graduados'; |
OlderNewer