14 Ağustos 2022

PHP datetime common

 <?php

 
  // Declare and define two dates
  $date1 = strtotime("2016-06-01 22:45:00");
  $date2 = strtotime("2018-09-21 10:44:01");
 
  // Formulate the Difference between two dates
  $diff = abs($date2 - $date1);
 
  // To get the year divide the resultant date into
  // total seconds in a year (365*60*60*24)
  $years = floor($diff / (365*60*60*24));
 
  // To get the month, subtract it with years and
  // divide the resultant date into
  // total seconds in a month (30*60*60*24)
  $months = floor(($diff - $years * 365*60*60*24)
                                 / (30*60*60*24));
 
  // To get the day, subtract it with years and
  // months and divide the resultant date into
  // total seconds in a days (60*60*24)
  $days = floor(($diff - $years * 365*60*60*24 -
               $months*30*60*60*24)/ (60*60*24));
 
  // To get the hour, subtract it with years,
  // months & seconds and divide the resultant
  // date into total seconds in a hours (60*60)
  $hours = floor(($diff - $years * 365*60*60*24
         - $months*30*60*60*24 - $days*60*60*24)
                                     / (60*60));
 
  // To get the minutes, subtract it with years,
  // months, seconds and hours and divide the
  // resultant date into total seconds i.e. 60
  $minutes = floor(($diff - $years * 365*60*60*24
           - $months*30*60*60*24 - $days*60*60*24
                            - $hours*60*60)/ 60);
 
  // To get the minutes, subtract it with years,
  // months, seconds, hours and minutes
  $seconds = floor(($diff - $years * 365*60*60*24
           - $months*30*60*60*24 - $days*60*60*24
                  - $hours*60*60 - $minutes*60));
 
  // Print the result
  printf("%d years, %d months, %d days, %d hours, "
       . "%d minutes, %d seconds", $years, $months,
               $days, $hours, $minutes, $seconds);
?>

27 Şubat 2022

Creating Ethereum NFT Project

git clone https://github.com/HashLips/hashlips_art_engine.git

git clone https://github.com/HashLips/hashlips_nft_minting_dapp.git

git clone https://github.com/HashLips/hashlips_nft_contract.git


create a nfts with hashlips_art_engine


upload nfts to pinata cloud

create hidden and upload 


15 Şubat 2022

Creating a Solana NFT project

 

Important Links:

https://github.com/HashLips/hashlips_art_engine

https://github.com/metaplex-foundation/metaplex

https://github.com/exiled-apes/candy-machine-mint


npm run generate

For creating your assets


//// metaplex-master % npm install yarn

//// metaplex-master % npm install -D ts-node

//// metaplex-master % npm install -D typescript


I installed solana command line tools. For more: https://docs.metaplex.com/


Choose network 

for devnet: solana config set --url https://api.devnet.solana.com

for mainet: solana config set --url https://api.mainnet.solana.com


Create a new sol wallet 

solana-keygen new --outfile ~/.config/solana/devnet.json  


Set default wallet

solana config set --keypair ~/.config/solana/devnet.json


Set devnet

solana config set --url https://metaplex.devnet.rpcpool.com/


Get money$$$

solana airdrop 1

You will get 1 sol


cd js

yarn install

yarn build 

yarn bootstrap


--------------------------------------------======================

test del all-====

================================================


solana-keygen new --outfile ./keypair.json

git clone https://github.com/metaplex-foundation/metaplex.git

cd metaplex/js

yarn install --cwd /Users/username/Desktop/worker/solana/solana-nft/metaplex/js 

solana config set --url https://api.devnet.solana.com

solana config set --keypair keypair.json

solana airdrop 2

 

after you have to add config.json to solana-nft folder

check this website for config file : 

https://docs.metaplex.com/candy-machine-v2/configuration



npx ts-node /Users/username/Desktop/worker/solana/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \
-e devnet \
-k keypair.json \
-cp config.json \
./assets

save the initialized config for a candy machine with publickey:

npx ts-node /Users/username/Desktop/worker/solana/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts verify_upload \
-e devnet \
-k keypair.json


npx ts-node /Users/username/Desktop/worker/solana/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts mint_one_token \
-e devnet \
-k keypair.json


metaplex/js/packages/candy-machine-ui

you have to change .env.example file name with .env


change <YOUR CANDY MACHINE PROGRAM ID> with which is we saved cm publickey


save and go to this path


cd metaplex/js/packages/candy-machine-ui

yarn install && yarn start












14 Ocak 2022

DC MAC OS GRAY SCREEN


 Discord cache Macos

How to clear Discord cache on macOS
  1. Open Finder and select the Go dropdown.
  2. Select Go to folder and enter ~/Library/Application Support/discord/
  3. Select the Cache, Code Cache, and GPUCache folders.
  4. Right-click and select Move to Bin.
  5. I deleted everthin

27 Mart 2021

Python 3.7 firebase async sorunu

lol. I 'fix' this 'issue' that is long than an year.
  1. you should rename file async.py ( i choose async_fb.py)
  2. then in 'init.py' file replace line 3 with: from .async_fb import process_pool
  3. then in 'firebase.py' file replace line 12 with: from .async_fb import process_pool
    this is embarrassing...
    Enjoy codding!

Git: Commit Yönetimi ve Rebase Rehberi

Git: Commit Yönetimi ve Rebase Rehberi Bu rehber, staged değişiklikleri koruma, commit sırasını değiştirme ve squash işlemlerini kapsamaktad...