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
//SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract Mood { | |
string currentMood; | |
function setMood(string memory _newMood) external { | |
currentMood = _newMood; | |
} |
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, { useState } from "react"; | |
const LogoGenerator = () => { | |
const [city, setCity] = useState(""); | |
const handleSubmit = (event) => { | |
event.preventDefault(); | |
// Call API to generate logo based on city name | |
// ... | |
}; |
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, { useState } from 'react'; | |
const LogoGenerator = () => { | |
const [city, setCity] = useState(''); | |
const [logo, setLogo] = useState(null); | |
const handleSubmit = event => { | |
event.preventDefault(); | |
// Example code to generate logo based on city name | |
// Replace this with a real logo generation code |
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 axios = require('axios'); | |
async function summarizeNovel(text) { | |
const response = await axios.post('https://api.openai.com/v1/engines/text-davinci-002/jobs', { | |
prompt: 'Please summarize this text:', | |
max_tokens: 100, | |
temperature: 0.5, | |
n: 1, | |
stop: ['Thank you.'], | |
text, |
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 fizzbuzz(n) { | |
let result = []; | |
for (let i = 1; i <= n; i++) { | |
let output = ""; | |
if (i % 3 === 0) { | |
output += "Fizz"; | |
} | |
if (i % 5 === 0) { | |
output += "Buzz"; | |
} |
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 countDivisibleBy11(list) { | |
let count = 0; | |
for (let i = 0; i < list.length; i++) { | |
if (list[i] >= 111) { | |
return 0; | |
} | |
if (list[i] % 11 === 0) { | |
count++; | |
} | |
} |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract HouseRent { | |
address payable public landlord; | |
address payable public tenant; | |
uint256 public rentAmount; | |
uint256 public paymentDueDate; | |
bool public landlordHasWithdrawn; |
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
pragma solidity ^0.8.0; | |
contract LotToken { | |
string public name; | |
string public symbol; | |
uint8 public decimals; | |
uint256 public totalSupply; | |
mapping (address => uint256) public balanceOf; | |
mapping (address => mapping (address => uint256)) public allowance; |
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 algoliasearch from 'algoliasearch/lite'; | |
import { | |
InstantSearch, | |
Configure, | |
Hits, | |
SearchBox, | |
DynamicWidgets, | |
Panel, | |
ClearRefinements, |
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
em { | |
background: cyan; | |
font-style: normal; | |
} | |
body { font-family: sans-serif; padding: 1em; } | |
.header { | |
display: flex; | |
align-items: center; |
OlderNewer