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
| package main | |
| import "fmt" | |
| func GetCount(str string) (count int) { | |
| for _, value := range str { | |
| switch value { | |
| case 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U': | |
| count++ | |
| } |
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
| /* | |
| The goal of this exercise is to convert a string to a new string where each character in the new string | |
| is "(" if that character appears only once in the original string, or ")" if that character appears more | |
| than once in the original string. Ignore capitalization when determining if a character is a duplicate. | |
| Examples: | |
| "din" => "(((" | |
| "recede" => "()()()" | |
| "Success" => ")())())" | |
| "(( @" => "))((" |
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 dative = (word) => { | |
| return word.match(/[aáoóuú]+/gi) ? `${word}nak` : `${word}nek`; | |
| } | |
| console.log(dative("ablak")) | |
| /* | |
| https://en.wikipedia.org/wiki/Vowel_harmony#Hungarian | |
| Input Expected |
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 createPhoneNumber(numbers){ | |
| return `(${numbers.slice(0,3).join("")}) ${numbers.slice(3,6).join("")}-${numbers.slice(6,10).join("")}` | |
| } | |
| console.log(createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0])) | |
| // "(123) 456-7890" |
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 decodeMorse = (morseCode) => { | |
| let splitted = morseCode.split(" ") | |
| let str = [] | |
| const Codes = { | |
| ".-": "A", "-...": "B", "-.-.": "C", "-..": "D", | |
| ".": "E", "..-.": "F", "--.": "G", "....": "H", | |
| "..": "I", ".---": "J", "-.-": "K", ".-..": "L", | |
| "--": "M", "-.": "N", "---": "O", ".--.": "P", | |
| "--.-": "Q", ".-.": "R", "...": "S", "-": "T", | |
| "..-": "U", "...-": "V", ".--": "W", "-..-": "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
| # ------------------------------------------------------------------------------ | |
| # GOLANG Build Stage | |
| # ------------------------------------------------------------------------------ | |
| FROM golang:alpine as builder | |
| RUN apk add bash git gcc g++ libc-dev | |
| RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates | |
| WORKDIR /usr/src/microservice_intranet_solicitudes |
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 ( | |
| "crypto/rand" | |
| "crypto/sha256" | |
| "crypto/subtle" | |
| "encoding/base64" | |
| "strconv" | |
| "strings" | |
| "time" | |
| "golang.org/x/crypto/pbkdf2" |
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
| #QR Code Generator | |
| from django.http import HttpResponse | |
| import base64 | |
| import pyqrcode | |
| def qr_code_generator(request): | |
| key = request.GET.get('key', None) | |
| if key: | |
| qrcode = pyqrcode.create(key) | |
| base64image = qrcode.png_as_base64_str(scale=6) | |
| binaryfile = base64.b64decode(base64image) |
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
| SELECT | |
| tc.constraint_name, tc.table_name, kcu.column_name, | |
| ccu.table_name AS foreign_table_name, | |
| ccu.column_name AS foreign_column_name | |
| FROM | |
| information_schema.table_constraints AS tc | |
| JOIN information_schema.key_column_usage AS kcu | |
| ON tc.constraint_name = kcu.constraint_name | |
| JOIN information_schema.constraint_column_usage AS ccu | |
| ON ccu.constraint_name = tc.constraint_name |