This file contains 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
#### Contents of the preconfiguration file (for buster) | |
### Localization | |
# Preseeding only locale sets language, country and locale. | |
#d-i debian-installer/locale string en_US | |
# The values can also be preseeded individually for greater flexibility. | |
d-i debian-installer/language string en | |
d-i debian-installer/country string EC | |
d-i debian-installer/locale string en_US.UTF-8 | |
# Optionally specify additional locales to be generated. |
This file contains 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
function before_get_post ($stm) { | |
if ($stm->is_category || $stm->is_tag) { | |
$term_lang = !empty($stm->query['lang']) ? $stm->query['lang'] : ''; | |
if (empty($term_lang) || | |
!function_exists('pll_default_language') || | |
($term_lang === pll_default_language())) { | |
return; | |
} |
This file contains 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
# | |
# This script is part of the video, | |
# Cómo instalar Apache Web Server en Android: https://youtu.be/cwp63pJMy_A and | |
# it's intended to be used on Termux Android 32 bits in order to fix the issue, | |
# https://github.com/termux/termux-packages/issues/1727 | |
# Before executing this script you must install termux-chroot see de video, | |
# Cómo hacer chroot en Termux: https://youtu.be/gdy12S94BBk | |
# | |
#!/usr/bin/env bash | |
aps=$(pidof httpd) |
This file contains 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 | |
function connect() { | |
$link = @mysqli_connect('localhost:2483', 'root', 'root', 'world'); | |
if ($error = mysqli_connect_errno()) { | |
return sprintf("Error de conexión: #%s - %s\n", $error, mysqli_connect_error()); | |
} | |
mysqli_set_charset($link, 'utf8'); | |
return $link; | |
} |
This file contains 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 | |
abstract class A | |
{ | |
abstract function test(string $s); | |
} | |
abstract class B extends A | |
{ | |
abstract function test($s) : int; |
This file contains 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 | |
var_dump("abcdef"[-2]); // Print: string (1) "e" | |
var_dump(strpos("aabbcc", "b", -3)); // Print: int(3) | |
$string = 'bar'; | |
echo "El último carácter de '$string' es '$string[-1]'.\n"; | |
// Print: El último carácter de 'bar' is 'r' |
This file contains 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 | |
function validateAge($age) | |
{ | |
if (!is_int($age)) { | |
throw new InvalidArgumentException('Age must be integer!'); | |
} | |
if (($age < 0) || ($age > 200)) { | |
throw new DomainException('Age must be a value between 0 and 200!'); | |
} |
This file contains 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 | |
function xrange($start, $limit, $step = 1) { | |
for ($i = $start; $i <= $limit; $i += $step) { | |
yield $i; | |
} | |
} | |
function iterate(iterable $iter) | |
{ | |
foreach ($iter as $val) { |
This file contains 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 | |
class Blog | |
{ | |
const BLOG_NAME = 'LibreByte'; | |
protected const START_DATE = '01-01-2007'; | |
private const CREATOR = 'sedlav'; | |
} | |
class Page extends Blog | |
{ |
This file contains 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 | |
$countries = [ | |
['country' => 'Spain', 'lang' => 'ES', 'currency' => 'EUR'], | |
['country' => 'USA', 'lang' => 'EN', 'currency' => 'USD'] | |
]; | |
foreach ($countries as ['country' => $countryName, 'lang' => $language, 'currency' => $currency]) { | |
echo "<strong>Country: </strong> $countryName, <strong>Language: </strong> $language, <strong>Currency: </strong> $currency"; | |
echo nl2br("\n"); |
NewerOlder