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
<role> | |
You are Lovable, an AI editor that creates and modifies web applications. You assist users by chatting with them and making changes to their code in real-time. You understand that users can see a live preview of their application in an iframe on the right side of the screen while you make code changes. Users can upload images to the project, and you can use them in your responses. You can access the console logs of the application in order to debug and use them to help you make changes. | |
Not every interaction requires code changes - you're happy to discuss, explain concepts, or provide guidance without modifying the codebase. When code changes are needed, you make efficient and effective updates to React codebases while following best practices for maintainability and readability. You take pride in keeping things simple and elegant. You are friendly and helpful, always aiming to provide clear explanations whether you're making changes or just chatting. | |
Current date: 2025-06-15 | |
</role> | |
<guidelines> |
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
Currently reading: | |
Yaratıcı Eylem by Rick Rubin | |
Recently read: | |
Muhtesem Gatsby by F. Scott Fitzgerald | |
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
{ | |
"Version": "2024-08-28", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetRole", | |
"logs:DeleteLogGroup", | |
"apigateway:PUT", |
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
function buy(uint256 tokenId) payable { | |
require(msg.value >= price, "Payment not enough"); | |
address _currentOwner = ownerOf(tokenId); | |
_transfer(_currentOwner, msg.sender, tokenId); | |
bool sent = _currentOwner.send(msg.value); | |
require(sent, "Failed to send Ether"); | |
} |
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
// contracts/Version1-Safe.sol | |
pragma solidity ^0.8.0; | |
interface IERC20 { | |
function transferFrom(address from, address to, uint256 value) external returns(bool); | |
function transfer(address to, uint256 value) external returns(bool); | |
} | |
contract Bank2 { |
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
// contracts/Version1-Safe.sol | |
pragma solidity ^0.8.0; | |
interface IERC20 { | |
function transferFrom(address from, address to, uint256 value) external returns(bool); | |
function transfer(address to, uint256 value) external returns(bool); | |
} | |
contract Bank { |
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
/* | |
** pipex.c - multipipes support | |
*/ | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
/* | |
* loop over commands by sharing |
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: MIT | |
/** | |
A simple Solidity smart contract which generates a random number between 0 and the desired max number. | |
Uses two functions to generate the random number: | |
- First "prepareRandom" should be called. The function will set the "preparationBlockNumber" to the current block number. | |
- Second "roll" should be called to generate the number. The function generates a random number using the blockhash of the block when "prepareRandom" has been called. This way, as the blockhash of the block can't be know before the "prepareRandom" transaction goes thorugh, | |
the result of the roll can't be predicted and thus manipulated. | |
How many times the roll has been called and all the previous results are recorded in the blockchain. | |
*/ |
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
pragma solidity ^0.8.0; | |
contract RandomNumbers{ | |
// Result varibles | |
uint256[] public winnerNumbers; | |
uint256 public rollCount; | |
function random(uint256 maxNumber) public view returns (uint256) { | |
/** | |
Generates a random number between 0 and maxNumber. Uses current block difficulty, timestamp, caller address, and the blockhash of the block when prepareRandom has been called. | |
Although the output of this function can be precalculated, the manager not knowing the blockhash of the block they called "prepareRandom" makes the system fair. |
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
pragma solidity ^0.8.0; | |
contract RandomNumbers{ | |
uint256 public preparationBlockNumber; | |
bool public canCallRandom; | |
function prepareRandom() public { | |
/** | |
When called sets the preparation block number to the current block number. | |
*/ |
NewerOlder