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 { useState } from "react"; | |
export const useInput = initialValue => { | |
const [value, setValue] = useState(initialValue); | |
return { | |
value, | |
setValue, | |
reset: () => setValue(""), | |
hooks: { |
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
//;Got from https://www.baeldung.com/httpclient-ssl | |
@Test | |
public void givenAcceptingAllCertificates_whenHttpsUrlIsConsumed_thenException() | |
throws IOException, GeneralSecurityException { | |
TrustStrategy acceptingTrustStrategy = (cert, authType) -> true; | |
SSLSocketFactory sf = new SSLSocketFactory( | |
acceptingTrustStrategy, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); | |
SchemeRegistry registry = new SchemeRegistry(); | |
registry.register(new Scheme("https", 8443, sf)); | |
ClientConnectionManager ccm = new PoolingClientConnectionManager(registry); |
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
Show hidden characters
{ | |
"cmd": ["javac \"$file_name\" && java \"$file_base_name\""], | |
"shell": true, | |
"file_regex": "^(...*?):([0-9]*):?([0-9]*)", | |
"selector": "source.java" | |
} |
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
#!/bin/bash | |
#Credits to cuibonobo: https://gist.github.com/cuibonobo/f37f723d1ce77f68c5ddf324c8468da3 | |
# You need this for your OpenSSL tests to pass later | |
yum install perl-core | |
# Grab the source for OpenSSL 1.1, which has the patch for CVE-2016-2107 | |
cd /usr/local/src | |
wget https://www.openssl.org/source/openssl-1.1.0b.tar.gz | |
tar -zxf openssl-1.1.0b.tar.gz | |
cd openssl-1.1.0b |
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
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> | |
<deployment> | |
<exclude-subsystems> | |
<subsystem name="org.hibernate" /> | |
<subsystem name="org.hibernate.validator" /> | |
<subsystem name="jpa" /> | |
</exclude-subsystems> | |
<exclusions> |
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 java.util.function.Function; | |
import java.util.function.Supplier; | |
class Student { | |
private String name; | |
private String email; | |
public String getName() { return name; | |
} | |
public void name(String name) { |
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
#Criando RAMDISK LINUX | |
mkdir /tmp/ramdisk | |
chmod 777 /tmp/ramdisk | |
mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/ |
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
convert -density 300 +antialias -quality 100 std.ps std.jpg |
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
public static void main(String[] args) throws Exception{ | |
ClassLoader cl = Demo.class.getClassLoader(); | |
URL stageConfig = cl.getResource("project-stages.yml"); | |
Swarm swarm = new Swarm(false).withStageConfig(stageConfig); | |
logger = Logger.getLogger(Demo.class); | |
swarm.fraction(datasource(swarm)); | |
swarm.fraction(logging()); | |
swarm.start(); | |
swarm.deploy(archive()); | |
} |
NewerOlder