These crates have been put here in no particular order, and are updates as I come scross them in other people's projects and in my own.
Crate | Use |
---|---|
rand | Random number generator |
fern | Logging for Rust |
{}: Replaces with the next argument, automatically converting it to a string. | |
{:?}: Uses the Debug trait to display the value. Useful for displaying complex data structures. | |
{:#?}: Pretty-prints the Debug output (useful for structs and enums). | |
{:<width}: Left-aligns the output within the specified width. | |
{:>width}: Right-aligns the output. | |
{:^width}: Centers the output. | |
{:.precision}: Limits the number of decimal places for floating-point numbers. | |
{:<0width}: Pads with zeros on the left. | |
{:#x}: Formats an integer as hexadecimal with the 0x prefix. |
public enum Scope { | |
Accounting("ACCOUNTING"), | |
Payments("PAYMENTS"), | |
AccountingPayments("ACCOUNTING_PAYMENTS"), | |
OpenId("OPENID"), | |
Profile("PROFILE"), | |
Phone("PHONE"), | |
Address("ADDRESS"), | |
Email("EMAIL"), | |
OpenIdAll("OPENID_ALL"), |
public class ValuationApplication implements CommandLineRunner { | |
public static void main(String[] args) { | |
SpringApplication.run(ValuationApplication.class, args); | |
} | |
@Override | |
public void run(String... args) throws Exception { | |
ObjectMapper objectMapper = new ObjectMapper(); | |
ClassPathResource resource = new ClassPathResource("bootstrap-config.json"); |
<script setup> | |
import { ref } from 'vue'; | |
import { createAvatar } from '@dicebear/core'; | |
import { croodles } from '@dicebear/collection'; | |
const items = ref(['😏', '😐', '😑', '😒', '😕']); | |
const avatar = createAvatar(croodles, { | |
size: 128, | |
seed: 'Solomon Kane', | |
// ... other options | |
}).toDataUriSync(); |
<div class="w-full md:w-1/2 px-3 md:mb-0"> | |
<label for="photos" class="text-lg">Upload Company Logo</label> | |
<label for="dropzone-file" | |
class="mt-2 flex flex-col items-center justify-center | |
border-2 border-gray-300 border-dashed | |
cursor-pointer dark:hover:bg-bray-800 | |
dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 | |
dark:hover:border-gray-500 dark:hover:bg-gray-600"> | |
<div class="flex flex-col items-center justify-center pt-5 pb-6"> | |
<svg aria-hidden="true" class="w-10 h-10 mb-3 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> |
<configuration> | |
<!-- Setting up log path and log file name --> | |
<property name="LOG_PATH" value="./logs"/> | |
<property name="LOG_FILE_NAME" value="application_logback"/> | |
<!-- Setting up logging pattern for console logging --> | |
<appender name="ConsoleOutput" class="ch.qos.logback.core.ConsoleAppender"> | |
<layout class="ch.qos.logback.classic.PatternLayout"> | |
<Pattern> %white(%d{ISO8601}) %highlight(%-5level) [%yellow(%t)] : %msg%n%throwable </Pattern> | |
</layout> | |
</appender> |
package com.hobbyzhub.userservice.service; | |
import com.hobbyzhub.userservice.event.SendVerificationMailEvent; | |
import javax.mail.MessagingException; | |
import javax.mail.internet.MimeMessage; | |
import java.io.File; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.event.EventListener; |