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 java.lang.reflect.Field; | |
public class IgualA5 { | |
public static void main(String[] args) throws Exception { | |
Class cache = Integer.class.getDeclaredClasses()[0]; | |
Field c = cache.getDeclaredField("cache"); | |
c.setAccessible(true); | |
Integer[] array = (Integer[]) c.get(cache); | |
array[132] = array[133]; |
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
version: "3.7" | |
services: | |
rabbitmq3: | |
image: rabbitmq:3-management | |
environment: | |
RABBITMQ_ERLANG_COOKIE: 'insira a sua chave secreta' | |
volumes: | |
- ./db-data:/var/lib/rabbitmq | |
ports: | |
- 5672:5672 |
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
$ cd ~/nodejs-mongodb | |
$ nano package.json | |
Dentro do arquivo coloque, salve e feche. | |
{ | |
"name":"nodejs-mongodb", | |
"version":"0.0.1", | |
"main":"app.js", | |
"dependencies":{ | |
"consolidate":"~0.9.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
$ mkdir ~/nodejs-mongodb | |
$ cd ~/nodejs-mongodb | |
$ nano package.json | |
Dentro do arquivo coloque, salve e feche. | |
{ | |
} | |
$ nano app.js |
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
DROP FUNCTION tabela_temporaria(); | |
CREATE OR REPLACE FUNCTION tabela_temporaria() | |
RETURNS TABLE (id bigint, nome character varying, cpf character varying) AS | |
$func$ | |
DECLARE | |
_row RECORD; | |
BEGIN | |
FOR _row IN (SELECT tablename as name FROM pg_catalog.pg_tables WHERE tablename LIKE 'tabela_temporarias%') LOOP | |
return query EXECUTE ' SELECT id, nome, cpf |
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
#!/bin/bash | |
echo "Iniciando"; | |
PASSWORD=senha | |
echo "Deletando o banco antigo"; | |
PGPASSWORD=$PASSWORD dropdb --host=localhost --username=postgres aplicacao_homologacao | |
echo "Criando o banco novo"; |
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
Iterable<int> countTo(int max) sync { | |
int i = 0; | |
while(i < max) yield i++; | |
} | |
main() { | |
Iterable it = countTo(5); | |
Iterable i = it.iterator; | |
while (i.moveNext()) { | |
print(i.current); |
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
class MyNumber { | |
num val; | |
num operator + (num n) => val * n; | |
MyNumber(v) { this.val = v; } | |
} | |
main() { | |
MyNumber mn = MyNumber(5); | |
print(mn + 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
require 'net/ftp' | |
CONTENT_SERVER_DOMAIN_NAME = "IP" | |
CONTENT_SERVER_FTP_LOGIN = "USER" | |
CONTENT_SERVER_FTP_PASSWORD = "PASSWORD" | |
# upload files to nested directory | |
TXT_FILE_OBJECT = File.new("./build/libs/infarma-reports.jar") | |
name = File.basename(TXT_FILE_OBJECT).split "." | |
Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp| |
NewerOlder