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
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
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 URL = 'https://letsrevolutionizetesting.com/challenge.json'; | |
function makeCall(url) { | |
return fetch(url).then(response => response.json()); | |
} | |
function startChallenge(url) { | |
return makeCall(url) | |
.then(response => { | |
const {follow} = response; |
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
sudo apt update | |
sudo apt install -y xfce4 xfce4-goodies | |
sudo apt install -y xrdp chromium-browser filezilla | |
sudo adduser xrdp ssl-cert | |
sudo adduser maria |
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.util.Arrays; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class Loto { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.print("Quantos números? "); | |
int n = sc.nextInt(); |
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
def comparar(valor, inicio, fim): | |
if valor < inicio or valor > fim: | |
return True | |
while True: | |
try: | |
ano = int(input('Em que ano nasceste? ')) | |
if ano < 0: | |
raise ValueError | |
break |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
"sort" | |
) | |
func main() { |
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
sudo apt update | |
apt install -y apache2 vsftpd |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.7.5; | |
pragma experimental ABIEncoderV2; | |
// https://kovan.etherscan.io/address/0x18c0417f85ae320d35138b0bb289532156a92356 | |
contract ElegerDelegado { | |
string[15] nomes; |
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
HUB: | |
- Create the tunnel interface | |
tunnels: | |
mgre0: | |
mode: gre | |
remote: 0.0.0.0 | |
local: 172.31.192.10 | |
addresses: | |
- "192.168.0.100/24" | |
mtu: 1476 |
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 | |
# From here https://www.cubicrace.com/2016/03/efficient-logging-mechnism-in-shell.html | |
# Modular approach to bash logging | |
# | |
SCRIPT_LOG=/var/log/cloud-config.log | |
touch $SCRIPT_LOG | |
function SCRIPTENTRY() { |
OlderNewer