Skip to content

Instantly share code, notes, and snippets.

View albertocavalcante's full-sized avatar
🌎
BRA -> USA

Alberto Cavalcante albertocavalcante

🌎
BRA -> USA
View GitHub Profile
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active May 27, 2025 01:23
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@andreasonny83
andreasonny83 / RELEASE-NOTES.md
Last active June 4, 2025 20:44
Release Notes Template

Release Notes Template

Based off https://palantir.quip.com/pzRwAVr1bpzf

Pro-tip: look through the github diff between the previous release to see what's changed. The commit titles should give an outline of what's happened.

Upgrade Steps

  • List out, as concretely as possible, any steps users have to take when they upgrade beyond just dumping the dependency.
  • Write pseudocode that highlights what code should change and how.
@th-deng
th-deng / build.gradle
Last active January 5, 2022 06:29
Config JaCoCo report and violation rules
// groovy DSL
jacocoTestReport {
reports {
// 원하는 리포트를 켜고 끌 수 있습니다.
html.enabled true
xml.enabled false
csv.enabled false
// 각 리포트 타입 마다 리포트 저장 경로를 설정할 수 있습니다.
@devops-school
devops-school / Terraform-taint-untaint-explained.md
Last active May 23, 2023 05:15
Terraform taint and untaint explained with example programs and tutorials
$ terraform taint resource.id

resource.id refers to the resource block name and resource ID to taint. Review the resource block we 

previously created:

resource "aws_instance" "example" {
  ami           = "ami-b374d5a5"
  instance_type = "t2.micro"
@jamescalam
jamescalam / smtp_example.py
Created May 26, 2020 16:53
Example code for sending an email via SMTP with TLS encryption in Python.
import smtplib
# initialize connection to our email server, we will use Outlook here
smtp = smtplib.SMTP('smtp-mail.outlook.com', port='587')
smtp.ehlo() # send the extended hello to our server
smtp.starttls() # tell server we want to communicate with TLS encryption
smtp.login('[email protected]', 'Password123') # login to our email server
@daehahn
daehahn / wsl2-network.ps1
Last active April 21, 2025 03:30
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@moscas
moscas / Sum.groovy
Created December 8, 2020 13:38
Data extractor for IntelliJ which counts the sum of numeric values
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@tokrug
tokrug / ConditionalOnConfigurationProperties.java
Last active January 21, 2024 00:20
Spring Boot autoconfiguration conditional annotation on typesafe ConfigurationProperies class. Maps properties to the provided class and executes it's isPresent() method to determine if Conditional should match or not. application.yml, ExampleSpringConfiguration.java and ExampleSpringPropertiesModel.java show how the rest of the code can be used.
/**
* Metannotation for OnConfigurationPropertiesCondition custom conditional implementation.
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Conditional(OnConfigurationPropertiesCondition.class)
public @interface ConditionalOnConfigurationProperties {
// properties namespace
@rponte
rponte / BeanValidationConfig.java
Last active December 27, 2021 20:33
Spring Boot: integrating Bean Validation between Spring and Hibernate (supporting DI on custom validations with Hibernate)
@Configuration
public class BeanValidationConfig {
/**
* The idea here is to configure Hibernate to use the same ValidatorFactory used by Spring,
* so that Hibernate will be able to handle custom validations that need to use dependency injection (DI)
*/
@Bean
public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(final Validator validator) {
return new HibernatePropertiesCustomizer() {
@wilsonfreitas
wilsonfreitas / rb3-indexes-donuts.R
Created May 30, 2022 10:47
Indexes Composition in a Donuts Plot
library(rb3)
library(tidyverse)
top_weight <- function(.data, n = 10) {
top_10 <- .data |>
arrange(desc(weight)) |>
slice_head(n = n) |>
select(symbol, weight)
total_weight <- sum(top_10$weight)
others <- tibble(