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
var warehouseCapacity = []; | |
var allWoodTotals = []; | |
var allClayTotals = []; | |
var allIronTotals = []; | |
var availableMerchants = []; | |
var totalMerchants = []; | |
var farmSpaceUsed = []; | |
var farmSpaceTotal = []; | |
var villagesData = []; | |
var allWoodObjects, allClayObjects, allIronObjects, allVillages; |
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
// Função para verificar se os pop-ups estão bloqueados | |
function verifyPopupPermission() { | |
var popupWindow = window.open("", "_blank", "width=1,height=1"); | |
if (!popupWindow || popupWindow.closed || typeof popupWindow.closed == 'undefined') { | |
alert("Pop-ups estão bloqueados neste navegador."); | |
} else { | |
popupWindow.close(); | |
} | |
} |
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
# instal dependencies | |
sudo apt update | |
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common | |
# import docker key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# add docker repository | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable" | |
sudo apt update |
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
def valid_cns?(cns) # CNS is a String | |
return false unless (cns.match('[1-2]\\d{10}00[0-1]\\d') || cns.match('[7-9]\\d{14}')) | |
return weighted_sum(cns) % 11 == 0; | |
end | |
def weighted_sum(cns) | |
total = 0 | |
cns.chars.each_with_index { |char, index| total += (char.to_i * (15 - index)) } | |
total | |
end |
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
<html> | |
<head> | |
<title>Netflix logo in HTML + CSS</title> | |
<style> | |
body{ | |
display: flex; | |
align-items: center; | |
height: 100vh; | |
margin: 0; | |
background: black; |
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 DoWhiteSpace = (text) => { | |
const spacesRegexp = /\x20/g, newLineRegexp = /\n/g; | |
return text.replace(spacesRegexp, ' ').replace(newLineRegexp, '<br>'); | |
}; |
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
// no41 (Campo de Armia) | |
// ******************************************** | |
# [ 122] | |
MinuteGenerate: 1 | |
MaxNumMob: 1 | |
MinGroup: 0 | |
MaxGroup: 0 | |
Leader: Gremlin | |
Follower: Gremlin | |
RouteType: 2 |
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
function fatorial(numero){ | |
// Define resultado padrão como null. | |
let resultado = null; | |
// Se o número digitado atender aos requisitos, altera a variavel resultado. | |
if(numero === 0 || numero === 1){ | |
// Número digitado é 0 ou 1 | |
resultado = 1; | |
}else if(numero >= 0){ | |
// Número digitado atende aos requsitos. |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.html [QSA,L] |
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
class ParentComponent extends Component { | |
render() { | |
// My basic render function structure: | |
// 1) Extract values from props and state | |
const {a, b, someBoolean, someList} = this.props; | |
// 2) Render any dependent items into temporary variables, such as conditional components or lists | |
const conditionalComponent = someBoolean ? <SomeComponent /> : null; | |
const listItems = someList.map(item => <ListItem item={item} />); |
NewerOlder