This file contains 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 mailRegExp = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.?[a-zA-Z]*$/; | |
mailRegExp.test("a@a") | |
// true | |
mailRegExp.test("a!@a") | |
// false | |
mailRegExp.test("a!@a/x") | |
// false | |
mailRegExp.test("a_-a@a.x") | |
// true |
This file contains 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 range = (start, end, includeEnd=false) => Array.from({ length: end - start + (includeEnd ? 1 : 0) }, (_, i) => i + start); |
This file contains 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 s.id, t.* | |
from service_groups s | |
join ( | |
select short_name, service_id, count(*) as qty | |
from service_groups | |
group by short_name, service_id | |
having count(*) > 1 | |
) t on s.short_name = t.short_name and s.service_id = t.service_id; |
This file contains 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
<css-doodle click-to-update> | |
<style> | |
@grid: 80x1 / 80vmin; | |
@size: @rn(0, 100%, 5); | |
@offset: @plot(r: .5); | |
@random(.3) { filter: blur(2px) } | |
background-size: 35%; | |
background-image: @svg( | |
viewBox: 0 0 10 10; | |
circle { |
This file contains 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
$width: 70px; | |
.circle { | |
display: inline-block; | |
position: relative; | |
text-align: center; | |
width: $width; | |
height: $width; | |
margin-right: 20px; |
This file contains 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
@ExtendWith(SpringExtension.class) | |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | |
public class IntegrationTest { | |
@LocalServerPort | |
protected int port; | |
@Autowired | |
protected ObjectMapper objectMapper; |
This file contains 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 lombok.SneakyThrows; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.context.event.ApplicationReadyEvent; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.event.EventListener; | |
import org.springframework.data.mongodb.core.MongoTemplate; | |
import org.springframework.data.mongodb.core.convert.MappingMongoConverter; | |
import org.springframework.data.mongodb.core.index.IndexOperations; | |
import org.springframework.data.mongodb.core.index.MongoPersistentEntityIndexResolver; | |
import org.springframework.data.mongodb.core.mapping.Document; |
This file contains 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
sudo xattr -r -d com.apple.quarantine /Applications/SomeApp/ |
This file contains 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
module.exports = { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
debug: true, | |
"corejs": 3, | |
"useBuiltIns": "entry", | |
targets: ['last 2 versions', 'ie >= 11'] | |
}], |
This file contains 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 myconext.crypto; | |
import org.bouncycastle.asn1.x500.X500Name; | |
import org.bouncycastle.cert.CertIOException; | |
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; | |
import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import org.bouncycastle.openssl.jcajce.JcaPEMWriter; | |
import org.bouncycastle.operator.ContentSigner; | |
import org.bouncycastle.operator.OperatorCreationException; |
NewerOlder