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
| yarn create react-app my-app |
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
| vault operator init -key-shares=3 -key-threshold=2 |
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" | |
| "github.com/headzoo/surf" | |
| ) | |
| // const x509UnknownAuthorityError = "Get \"https://digitalmint.exchange/\": x509: certificate signed by unknown authority" |
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
| func hashAndSalt(pwd []byte) string { | |
| hash, err := bcrypt.GenerateFromPassword(pwd, bcrypt.MinCost) | |
| if err != nil { | |
| log.Println(err) | |
| } | |
| return string(hash) | |
| } | |
| func comparePasswords(hashedPassword string, plainPassword []byte) bool { |
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
| c := make(chan os.Signal) | |
| signal.Notify(c, os.Interrupt) | |
| go func() { | |
| select { | |
| case sig := <-c: | |
| fmt.Printf("Got %s signal. Aborting...\n", sig) | |
| os.Exit(1) | |
| } | |
| }() |
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
| // ascending, non-decreasing | |
| func BubbleSort(data []int) { | |
| for i := 0; i < len(data); i++ { | |
| for j := 1; j < len(data)-i; j++ { | |
| if data[j] < data[j-1] { | |
| data[j], data[j-1] = data[j-1], data[j] | |
| } | |
| } | |
| } |
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 Foundation | |
| import SwiftUI | |
| struct PeopleView: View { | |
| @ObservedObject var viewModel = PeopleModel() | |
| var body: some View { | |
| VStack { |
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 Foundation | |
| final class UserModel: ObservableObject { | |
| struct User: Identifiable { | |
| var id = UUID() | |
| var firstName: String | |
| var lastName: String | |
| var email: String | |
| var degree: String |
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 Foundation | |
| import SwiftUI | |
| struct PeopleView: View { | |
| @ObservedObject var viewModel = PeopleModel() | |
| var body: some View { | |
| VStack { |
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 test | |
| import ( | |
| "bytes" | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" |