Wednesday, August 3, 2022

Using a custom mouse cursor using CSS

 If you can change the cursor on PC, how about it online. You dont need a .cur file. Using a image file works too. Here is how.

1. Creating the cursor image file

Skip this step if you decided to use a .cur file. 
You will need photo editing software like Photoshop.
  1. Take a screenshot of a cursor 
  2. Put it in the photo editing software
  3. Remove the background
  4. Crop it into squares.
  5. Resize it into 32x32 pixels.
  6. Put the cursor in the top-left of the square.
  7. The image will look like this:

    Cursor image in 32x32px

Now that the cursor is ready, you can apply it to a website.

2. Applying the cursor to the website

  1. Make a file called style.css
  2. In the file make this line of code. 
  3. 
    body {
    
    }
    
  4. Inside the {}, Put this code: cursor: url('pathtocursorfile.cur'), default; Replace pathtocursorfile.cur with the file path to the cursor file like /cursor/main.cur or /cursor/main.cur.
  5. Add this code inside the head tags: <link rel=stylesheet href='style.css'>
  6. Done! 
Now if you want to make it change only when hovering it to a text box, do this steps.
  1. Repeat steps 1 and 2
  2. Replace body into textarea in the CSS file
  3. In the HTML file, create a text box using the textarea tag.
Now were done! so I'm gonna use a custom cursor to this blog! So long...

Thursday, July 14, 2022

Making a Spinning Donut (donut.c)

 Hi, long time no see? So Were going to make a popular code called the Spinning Donut. The Language use is C. So you will need 1 file to execute the code. 



donut.c


#include<stdio.h>
#include<string.h>

int k;
double sin() ,cos();
main(){
    float A=0, B=0, i, j, z[1760];
    char b[1760];
    printf("\x1b[2J");
    for(; ; ) {
        memset(b,32,1760);
        memset(z,0,7040);
        for(j=0; 6.28>j; j+=0.07) {
            for(i=0; 6.28 >i; i+=0.02) {
                float sini=sin(i),
                      cosj=cos(j),
                      sinA=sin(A),
                      sinj=sin(j),
                      cosA=cos(A),
                      cosj2=cosj+2,
                      mess=1/(sini*cosj2*sinA+sinj*cosA+5),
                      cosi=cos(i),
                      cosB=cos(B),
                      sinB=sin(B),
                      t=sini*cosj2*cosA-sinj* sinA;
                int x=40+30*mess*(cosi*cosj2*cosB-t*sinB),
                    y= 12+15*mess*(cosi*cosj2*sinB +t*cosB),
                    o=x+80*y,
                    N=8*((sinj*sinA-sini*cosj*cosA)*cosB-sini*cosj*sinA-sinj*cosA-cosi *cosj*sinB);
                if(22>y&&y>0&&x>0&&80>x&&mess>z[o]){
                    z[o]=mess;
                    b[o]=".,-~:;=!*#$@"[N>0?N:0];
                }
            }
        }
        printf("\x1b[d");
        for(k=0; 1761>k; k++)
            putchar(k%80?b[k]:10);
        A+=0.04;
        B+= 0.02;
    }
}

I also made a repl to this, visit Spinning donut repl

Wednesday, April 27, 2022

Getting Started with Bash

 Bash is a Coding Language Installed for Mac/Linux. You can run it on it's Terminal. So let's get started.

Installing Homebrew

Now we need to install Homebrew to install packages/apps just by typing. I'm sure Homebrew is available already on Linux.
  1. Go to https://brew.sh
  2. Copy it's code
  3. Paste the copied code or type /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" in the Terminal.
  4. Enter the password if prompted. The password feedback or the dots will not show up. Just keep typing the password if the dots didn't appear. Don't think it's broken.
  5. Press enter
  6. If it asks you to install the Xcode command line tools, install it in the software update or via the prompt itself.
  7. Wait for it to finish.

Installing Packages or apps with Homebrew

On Mac, type brew install <package or app name>
For example: brew install gh to install the GitHub command.

On Linux type sudo apt-get install <package name> For more info, go here.

Finally, Bash

  1. Create a file called main.sh.
  2. Type echo "Hello World" for the first code.
  3. Save the file
  4. Type chmod +x main.sh or else it will show an error.
  5. Type ./main.sh  to run it.

Here is a complete code I make


echo "What's the password????"
read -sp 'Password: ' passvar
echo
echo "Your password is: $passvar"
sleep 1
echo "Hello World!"
sleep 2
echo "What's your name?"
read -p 'Name: ' namevar
sleep 2
echo "You POV"
cowsay "Hello! I'm $namevar"
sleep 1
echo "Hello $namevar!"
sleep 2
echo "What do you want to tell about $namevar?"
read -p 'Type: ' textvar
sleep 1
echo "You POV"
cowsay $textvar
sleep 2
echo "Goodbye $namevar!"
sleep 1
echo "Goodbye World!"
sleep 2
echo "press ^C or terminate this process to exit."
sleep 100
while (true) do
echo "A FATAL error has occured! please press ^C right now!!!!!!!!!!!!"
echo "This error has occureed because you've waited too long!!!"
done; exit;

This code is based on ASK-BASH? on Repl.it.

Wednesday, March 30, 2022

3 Things you don't know that something were actually at the website the whole time

NOTE: It's based on my own opinion. I'm not taking any other sources.


Have you ever heard of websites html, more. But. There are more about websites. Here it is....


1. Robots.txt

Have you ever heard abut robots.txt? If no, here it is.
Each websites has their own robots.txt in it. If you have your own website made from scratch(You know, using html, css, asp, js without using wordpress or any third party website builders), You should too. It will be fun like an easter egg that works on all websites.


To make it, simply add User-agent: User and Allow: /page Disallow: /page in it. If you're curious what this for, robots.txt is used for managing robot's permission to access pages in your site.
Also, you can add the link to your sitemap. Just add Sitemap: domainnamegoeshere/sitemap.xml. What is Sitemap? Then here it is...


2. Sitemap

What is a Sitemap? Sitemap is a webpage where it tells you all the pages in the website, like secret websites, easter eggs and more. It's even useful for you to find an easter egg on a website. Works all websites.



How to access it? Just add /sitemap.xml to the website. Here I found an easter egg in RiiConnect24's website by just using their sitemap.xml file. The easter egg is the Error 666. Funny.
rc24.xyz/sitemap.xml

RiiConnect24 Secret Error 666 page

Also, sitemap.xml is not available to some websites. Maybe the website dev forgot to make the sitemap.xml file, or they are lazy to make it.

3. Ads.txt

Here is the last one, ads.txt is a file that contains some information of author's ad info. If you have a website, you can use Google AdSense to display ads. You can go here for more info. It's case sensitive don't ever try to access it. It contains author's private information you don't wanna make the devs upset about it.

I guess that's all for today. Stay safe in the internet, see you next time.

Making a File Upload form that checks supported file types

 Hello were back again. Here I want to show you how to make an file uploading form that can check the supported file type. So first we need to make the form itself using HTML. Here is the code.


index.html



<html>
  <head>
    <title>Images</title>
  </head>
  <body>
    <h1>Submit an Image to Arcade 70 Coding</h1>
    <h3>only Image files are allowed.</h3>
    <form action="submitted.php"
     enctype="multipart/form-data"
     method="post">
      <input name="FileUpload" type="file" />
      <br>
      <input name="submit" type="submit" value="Submit" />
    </form>
  </body>
</html>

Notice

in the <FORM> tag, include the   enctype='multipart/form-data  or else it won't work. It also happened to me before when I ask this question in StackOverflow.


Now lets continue to php. Name the file submitted.php. If you want to name it another name,  change the file destination in the previous html code. More, it can copy the uploaded file to the admin's web server directory. Just replace /pathname/ into your own web server path. Also, it can show the user the uploaded file info. The TMP file path can be ignored. The File size were measured in bytes (b). here is the code

submitted.php



<html>
  <head>
    <title>Uploading File</title>
  </head>
  <body>
    <h1>File Info</h1>
    <?php
echo "<b>File Name: </b>". $_FILES['FileUpload']['name'] . "<br>";
echo "<b>File Type: </b>". $_FILES['FileUpload']['type'] . "<br>";
echo "<b>File Location: </b>". $_FILES['FileUpload']['tmp_name']. "<br>";
echo "<b>File Size: </b>". $_FILES['FileUpload']['size']; 
echo " bytes (B)";
echo "<br><br>";

$FileSource = $_FILES['FileUpload']['tmp_name'];
$FileUpload = '/pathname/'. $_FILES['FileUpload']['name'];

// checks and submits file
if (isset($_POST["submit"])) {
  if (($_FILES['FileUpload']['type'] == "image/png")
  or ($_FILES['FileUpload']['type'] == "image/jpg") 
  or ($_FILES['FileUpload']['type'] == "image/jpeg")
  or ($_FILES['FileUpload']['type'] == "image/svg")
  or ($_FILES['FileUpload']['type'] == "image/bmp")
  {
  copy($FileSource,$FileUpload);
  echo "<h1>Upload Complete!</h1>";
  }
  else
  {
  echo "<h3>Sorry, you can only upload image files.</h3>";
  }
}
?>
  </body>
</html>

Tuesday, March 29, 2022

Ways to cheat in Chrome Dino

 Based on my YouTube video


Got bored when No Internet when browsing in Chrome? The game Chrome Dino will make you un-bored. Impossible? It's because there's no ending in the game.
Hello were back again in Arcade 70 Coding. Today, I gonna show you the Ways on cheating in Chrome Dino. For changing the image of the runner sprite you will need internet connection. Now Let's get started.

1. Opening the Inspect tab

Easy. There are 2 ways to open the Inspect tab.
  • Right click anywhere in the game and click inspect.
  • Click the drop down menu : > More Tools > Developer Tools
And there. Just go the the Console tab and you're ready to hack.

2. Hacks

With these commands you can mess with the speed, powerups, etc. Just type these commands below and press enter.
  • Making the game in fullscreen mode
    Runner.instance_.setArcadeMode(true);
  • Making the Dino not moving forward but still look that the dino is running
    Runner.instance_.playingIntro = true;
  • Make the Dino can pass through the obstacle without dying
    Runner.instance_.gameOver = function(){};
  • Making the dino move faster or slower
    To adjust the speed, you can change the number.
    Runner.instance_.setSpeed(1000);

3. Turn Runner Dino to Sonic

Type  Runner.imageSprite  and replace the  data:image... into  https://i.imgur.com/7BuRkS9.png. Press Enter and start the game. And it will turn to sonic.

Making a working Login Form using HTML and PHP

 Hi and Welcome to this first post of this new blog. This is Calvin and I love coding. I only know a bit but I still can help you learn coding out of this blog. Without further ado, Let's start with the topic.


How to make a working Login form using HTML and PHP

Now lets get started first with HTML. Add a file called index.html. If the filename is index. users don't have to type /index.html after the domain name. Lets try not to use cookies and CSS to make it easy. HTML can be used for the form itself. Here is the code

index.html



<!DOCTYPE html>
<html>
     <head>
         <title>Please Login</title>
     </head>
     <body>
         <h1>Login to Pro 70>
         <form method="post" action="login.php">
             <label for="Username">Enter your Username</label>
             <input type="text" name="Username" placeholder="Username">
             <br><br>
             <label for="Password">Enter your Password</label>
             <input type="password" name="Password" placeholder="Password">
             <br>
             <input type="submit" value="Login">
             <input type="reset" value="Clear">
         </form>
     </body>
<html>



Now that were done with HTML, Let's move to PHP to check that the Username and Password is correct. First you need to install it first. Go to the PHP official Website to install it. Follow the instructions provided to install it. After you are done installing PHP, you can proceed to the next step.

Create a file named login.php. Don't change the filename to any name or else it will display a 404 error.


login.php



<?php

if (($_POST['Username'] == "Admin") and ($_POST['Password'] == "Password123"))
{
 echo "Welcome Admin or User.";
}
else
{
 echo "Wrong Username and Password, Try again.";
}

?>

Try it Your self!

Try to type the username Admin and the Password Password123. And click login. If it displays the welcome message you've type the correct username and password. Now try to type the wrong username and password. It will display a wrong password.

That's all

That all for today, If you have any questions, Please comment down below. Bye!

Using a custom mouse cursor using CSS

 If you can change the cursor on PC, how about it online. You dont need a .cur file. Using a image file works too. Here is how. 1. Creating ...