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
<?php | |
//get tht ip from the user | |
$ip=$_SERVER['REMOTE_ADDR']; | |
//open or create the file | |
$arquivo = fopen($filename, "a"); | |
if ($arquivo == false) { | |
die('Error message creating or opening the file.');} | |
//write to the file the IP from the user | |
if (!fwrite($arquivo, $ip."\n")) die('Error updating the file.');{ | |
echo 'Sucess.'; |
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 entries = document.querySelector(".entries") | |
const allGames = entries.children | |
function getGoodNodeIndex() { | |
const allGamesArr = Array.from(allGames) | |
const goodPosition = allGamesArr.findIndex((item) => { | |
return item.className === 'good' | |
}) | |
return goodPosition |
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 getMatchsBetween = (Arr1, Arr2, propertyToCompare) => { | |
const matchesFound = Arr2.filter((Arr2Item => { | |
const found = Arr1.find(Arr2Item => { | |
return Arr2Item === dia[propertyToCompare] | |
}) | |
return found !== undefined | |
})) | |
console.log('------------------------------------'); | |
console.log(matchesFound); | |
console.log('------------------------------------'); |
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
<?php | |
$horas = '43200'; | |
$tempo_anuncio = '20'; | |
$tempo_n = '35'; | |
$link_protetor = $_POST['link_final']; | |
if(isset($_POST['link_final']) and !empty($link_protetor)){ | |
$display = "none"; | |
$referer = $_SERVER['HTTP_REFERER']; | |
if($_COOKIE['protetor'] == '1'){ | |
setcookie("protetor", "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
// Stateless component to use inside the form | |
const RenderField = ({ | |
input, | |
placeholder, | |
type, | |
meta: { touched, error } | |
}) => { | |
return ( | |
<div style={{ width: '100%' }}> | |
{touched && error ? |
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
<?php | |
//write your do-while loop below | |
$f = 1; | |
do { | |
if ($f == 1){ | |
echo "the loop is ru"; | |
} | |
if else ($f > 1) { | |
echo "n"; | |
} else { |
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
server.put('/auth/v1/alterar-senha', async (req, res) => { | |
console.log('TOKEN from server: ', req.cookies.access_token) | |
const response = await fetch('yourputurl.com', { | |
method: 'PUT', | |
headers: { | |
token: req.cookies.access_token, | |
authorization: 'Basic Q3asdasdasdbGllbnQ6ZW9CWDYxaWcasdasVaRHpH', | |
'content-type': 'application/json' | |
}, | |
body: JSON.stringify({ nova: 'oldpass', antiga: 'newpass' }) |
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
{ | |
"compilerOptions": { | |
"plugins": [ | |
{ | |
"name": "typescript-styled-plugin" | |
} | |
], | |
"baseUrl": "./", | |
"paths": { | |
"app/*": ["src/*"] |
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 React from 'react' | |
import { View, StyleSheet, Text, Picker } from 'react-native'; | |
class RenderPicker extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
value: 'Selecione' | |
} | |
} |
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 { createSelector } from 'reselect'; | |
import moment from 'moment'; | |
export const orderListByDate = createSelector(state => { | |
return state.sort((a,b) => { | |
return moment.utc(b.startDate).diff(a.startDate); | |
}) | |
}, | |
// the final paramenter in the createSelector | |
// function must be a function that accepts as arguments |
NewerOlder