- Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node-dev rimraf
- Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
| <!doctype html> | |
| <html><head><script src="app.js"></script></head><body></body></html> |
| openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt | |
Documentación oficial sobre Jest
npm install -D jest @types/jest ts-jest supertest
Más información - Docs Oficiales
npm i -D typescript @types/node
| <?php | |
| /** | |
| * JSON Web Token implementation | |
| * | |
| * Minimum implementation used by Realtime auth, based on this spec: | |
| * http://self-issued.info/docs/draft-jones-json-web-token-01.html. | |
| * | |
| * @author Neuman Vong <[email protected]> | |
| */ | |
| class JWT |
| public function phpRule_ValidarRut($rut) { | |
| // Verifica que no esté vacio y que el string sea de tamaño mayor a 3 carácteres(1-9) | |
| if ((empty($rut)) || strlen($rut) < 3) { | |
| return array('error' => true, 'msj' => 'RUT vacío o con menos de 3 caracteres.'); | |
| } | |
| // Quitar los últimos 2 valores (el guión y el dígito verificador) y luego verificar que sólo sea | |
| // numérico | |
| $parteNumerica = str_replace(substr($rut, -2, 2), '', $rut); |
| function drawCircle(text, size, color) { | |
| var textSize = Math.ceil(size / 2.5); | |
| var font = 'Proxima Nova, proxima-nova, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif'; | |
| var colors = ["#1abc9c", "#16a085", "#f1c40f", "#f39c12", "#2ecc71", "#27ae60", "#e67e22", "#d35400", "#3498db", "#2980b9", "#e74c3c", "#c0392b", "#9b59b6", "#8e44ad", "#bdc3c7", "#34495e", "#2c3e50", "#95a5a6", "#7f8c8d", "#ec87bf", "#d870ad", "#f69785", "#9ba37e", "#b49255", "#b49255", "#a94136"]; | |
| var colorIndex = Math.floor((text.charCodeAt(0) - 65) % colors.length); | |
| var finalColor = color || colors[colorIndex]; | |
| var template = [ | |
| '<svg height="' + size + '" width="' + size + '" style="background: ' + finalColor + '">', | |
| '<text text-anchor="middle" x="50%" y="50%" dy="0.35em" fill="white" font-size="' + textSize + '" font-family="' + font + '">' + text.toUpperCase() + '</text>', |
| Filter | Description | Example |
|---|---|---|
| allintext | Searches for occurrences of all the keywords given. | allintext:"keyword" |
| intext | Searches for the occurrences of keywords all at once or one at a time. | intext:"keyword" |
| inurl | Searches for a URL matching one of the keywords. | inurl:"keyword" |
| allinurl | Searches for a URL matching all the keywords in the query. | allinurl:"keyword" |
| intitle | Searches for occurrences of keywords in title all or one. | intitle:"keyword" |