This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| package main | |
| import "fmt" | |
| func uniqueNonEmptyElementsOf(s []string) []string { | |
| unique := make(map[string]bool, len(s)) | |
| us := make([]string, len(unique)) | |
| for _, elem := range s { | |
| if len(elem) != 0 { | |
| if !unique[elem] { |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| class Formatter { | |
| /** | |
| * | |
| * @param {string} x | |
| * Input string | |
| * - 1234-5678-4321-8765 | |
| * - $1,111.11 | |
| * @param {boolean} isMoney | |
| * Boolean switch, default FALSE | |
| * - If true '.' will be accepted and displayed like 1111.11 |
Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service| var aws = require('aws-sdk') | |
| var lambda = new aws.Lambda({ region: 'us-east-2' }) | |
| exports.handler = async(event, context, callback) => { | |
| // Función helper: Obtener content type | |
| const getContentType = (event) => { | |
| let contentType = event.headers['content-type'] | |
| if (!contentType) { | |
| contentType = event.headers['Content-Type']; |
| const postData = async (values, { setStatus, setSubmitting }) => { | |
| try { | |
| const ping_data = await fetch(`${process.env.REACT_APP_AWS_API_BASE_URL}/auth/ping`, { | |
| method: 'post', | |
| headers: { 'x-api-key': process.env.REACT_APP_AWS_API_X_API_KEY }, | |
| body: JSON.stringify({ correoElectronico: values.email }) | |
| }); | |
| if (ping_data.status !== 200) throw { codigo: 'PING_FALLO', ping_data } |
| // Promesa https | |
| const postHttpsPromise = (body) => { | |
| // Importamos modulo | |
| const https = require('https') // require('http') | |
| // Retornamos promesa | |
| return new Promise((resolve, reject) => { | |
| // Opciones petición |
| <?php | |
| function utf8_encode_deep(&$input) { | |
| if (is_string($input)) { | |
| $input = utf8_encode($input); | |
| } else if (is_array($input)) { | |
| foreach ($input as &$value) { | |
| utf8_encode_deep($value); | |
| } | |
| unset($value); |
| <?PHP | |
| // Generates a strong password of N length containing at least one lower case letter, | |
| // one uppercase letter, one digit, and one special character. The remaining characters | |
| // in the password are chosen at random from those four sets. | |
| // | |
| // The available characters in each set are user friendly - there are no ambiguous | |
| // characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
| // makes it much easier for users to manually type or speak their passwords. | |
| // | |
| // Note: the $add_dashes option will increase the length of the password by |
| #! /usr/bin/env python3.5 | |
| """ | |
| Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5. | |
| Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197 | |
| Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone. | |
| This will be only fixes the bluez5 problem mentioned above . |