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
keytool -genkeypair \ | |
-alias $ALIAS \ | |
-keyalg RSA \ | |
-keysize 2048 \ | |
-storetype PKCS12 \ | |
-validity 3650 \ | |
-storepass $PASS \ | |
-dname "CN=development,OU=developer,O=developer,C=DV" \ | |
-ext "SAN:c=DNS:$LOCALDNS,DNS:localhost,IP:127.0.0.1" \ | |
-keystore $ALIAS.p12 |
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
const substrings = (input) => { | |
const freq = {}; | |
for (let i = 0; i < input.length; i++) { | |
for (let j = i + 1; j <= input.length; j++) { | |
const s = input.substring(i, j); | |
console.log(i, j, s); | |
if (freq[s]) freq[s] += 1; | |
else freq[s] = 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
const http = require("http"); | |
const uso = (res, mimeType, encoding) => { | |
res.setHeader("Content-Type", `${mimeType}; charset=${encoding}`); | |
res.end(` | |
<h1>teste</h1> | |
<a href="/txt">Ver como texto</a><br/> | |
<a href="/html">Ver como html (o que você vê agora)</a> | |
`); | |
}; |
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
const fsm5 = { | |
alfabeto: ["08:00", "12:00", "13:00", "18:00", "22:00"], | |
estados: ["acordado", "trabalhando", "descansando", "dormindo"], | |
inicial: "dormindo", | |
atual: "dormindo", | |
finais: ["dormindo"], | |
programa: { | |
"08:00": { | |
dormindo: "acordado", | |
acordado: "trabalhando", |
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
const http = require("http") | |
// http://127.0.0.1:3000/aceita?08:00,12:00,13:00,18:00,22:00 | |
const server = new http.createServer((req,res)=>{ | |
const url = req.url | |
if(url == "/favicon.ico") return res.end("") | |
const path = req.url.split("?") | |
const operacao = path[0] | |
console.log(path) |
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
const fsm5 = { | |
alfabeto: ["08:00", "12:00", "13:00", "18:00", "22:00"], | |
estados: ["acordado", "trabalhando", "descansando", "dormindo"], | |
inicial: "dormindo", | |
atual: "dormindo", | |
finais: ["dormindo"], | |
programa: { | |
"08:00": { | |
dormindo: "acordado", | |
acordado: "trabalhando", |
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
const fsm2 = { | |
alfabeto: ["08:00", "12:00", "13:00", "18:00", "22:00"], | |
estados: ["acordado", "trabalhando", "descansando", "dormindo"], | |
inicial: "dormindo", | |
atual: "dormindo", | |
finais: ["dormindo"], | |
programa: { | |
"08:00": { | |
dormindo: "acordado", | |
acordado: "trabalhando", |
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
const fsm2 = { | |
alfabeto: ["a", "b"], | |
estados: ["q0", "q1", "q2", "q3", "q4"], | |
inicial: "q0", | |
atual: "q0", | |
finais: ["q4"], | |
programa: { | |
a: { | |
q0: "q1", | |
q1: "q2", |
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
#include <stdio.h> | |
#include <gpiod.h> | |
// libgpiod must be correctly installed | |
// gcc -Wall -lgpiod pin17.c -o pin17 | |
int main(int argc, char **argv) { | |
struct gpiod_chip *chip = gpiod_chip_open("/dev/gpiochip0"); | |
struct gpiod_line *line = gpiod_chip_get_line(chip,17); | |
gpiod_line_request_output(line,"xxx",0); | |
gpiod_line_set_value(line,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
plugins { | |
id 'war' | |
id "com.bmuschko.cargo" version "2.7.1" | |
} | |
repositories { | |
jcenter() | |
} | |
dependencies { |