-- Temporal.
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
| import math | |
| def prob_of_birthday_collision(people=23.0, days=365.25): | |
| e = math.e | |
| k = float(people) | |
| n = float(days) | |
| return 100.0*(1.0-e**((-k*(k-1.0)) / (2.0*n))) |
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
| def prob_of_birthday_collision(people = 23.0, days = 365.25) | |
| e = Math::E | |
| k = people.to_f() | |
| n = days.to_f() | |
| return 100.0 * (1.0 - e**((-k * (k - 1.0)) / (2.0 * n))) | |
| end |
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
| # Takes 3 optional params: an int code_length, a string "separator" and a look-up "table" (hash). | |
| def my_uuid_code( | |
| code_length = 24, | |
| separator: '-', | |
| table: { "0" => '0', "1" => '1', "2" => '2', "3" => '3', "4" => '4', "5" => '5', | |
| "6" => '6', "7" => '7', "8" => '8', "9" => '9', | |
| "A" => 'E', "B" => 'J', "C" => 'N', "D" => 'P', "E" => 'V', "F" => 'X' }) | |
| posibilities = 16**code_length | |
- Hacer una copia de seguridad completa del sitio
- Activar certificado SSL en nuestro hosting
- Activar acceso al Panel de Administración mediante HTTPS
- Cambiar nuestro dominio base en el Panel de Administración WP
- Cambiar los enlaces de la web
- Redirigir todas las direcciones a https mediante
.htaccess - Actualizar SEO
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
| const intlSpanishFormatter = Intl.NumberFormat('es-ES', { style: 'currency', currency: 'EUR'}); | |
| const PreventGroupingOfFourIntegerDigits = function ({type, value }, idx, parts) { | |
| (idx === (parts.length - 7) && value.length < 2 && (parts[idx + 1].value = '')); | |
| return value; | |
| }; | |
| intlSpanishFormatter.formatToParts(1234.56).map(PreventGroupingOfFourIntegerDigits).join(''); |
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
| function describe(x) { | |
| function trueType(obj) { | |
| return (Number.isNaN(obj) && 'NaN') || (Object.prototype.toString.call(obj).slice(8, -1)); | |
| } | |
| let description = `DESCRIPTION: | |
| ------------ | |
| trueType: ${trueType(x)}, | |
| typeOf: ${typeof x}, | |
| boolean: ${!!x}, | |
| number: ${+x}, |
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
| document.querySelector('pre').textContent = JSON.stringify(JSON.parse(document.querySelector('pre').textContent), null, 4); |
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
| // Usage: | |
| // djb2eHash( 'Hello World1' ); # => 1171219298 | |
| // djb2eHash( 'Hello World2' ); # => 449666786 | |
| // djb2eHash( 'Hello World3' ); # => 201925602 | |
| // djb2eHash( 'Hello World4' ); # => 3033001186 | |
| function djb2eHash(string, randomNumber = 0xcde7) { | |
| // UTF16-rotate a character. | |
| function rotU16(charCode) { | |
| return 0x10000 - charCode; | |
| } |
