Featured Website - Planescape Online

The Planescape Online website has been a labor of love. Since the beginning of my time at Conestoga College, in the Web Design and Development program, I have been working very hard on this personal project.

Preloading Images and Removing Screen Flicker While SWF Loads

Give your website look smoother by preloading images and making SWF content load without distracting flickering.

PHP here document (heredoc)

How to use heredoc in PHP.

Web Design and Development Course List

The full course list for the Web Design and Development program at Conestoga College. I will be graduating in January!

Friday, May 13, 2022

Drop all tables, MySQL

Drop all tables, MySQL.

SELECT concat('DROP TABLE IF EXISTS `', table_name, '`;') FROM information_schema.tables WHERE table_schema = 'MyDatabaseName';

Copy and paste the result and run it.

Friday, April 22, 2022

Noob Creating a Shell Script

Using the terminal can be a pain in the ass. So let's make a shell script, so we can avoid typing in the same commands over and over again. Connect to your terminal and log in, then type this...
cd ~
...or wherever you want, "~" is the users home directory...
mkdir shellScript
cd shellScript
...note: while you're typing in a file or folder name, type a few letters and press the TAB button, the rest of the name should appear automatically, unless there's another name that starts the same.
Create a script file: Both "vim" and "nano" are file editors in Linux, you probably have both. Either way they are easy to install, I'm using "nano".
so...
nano scriptFile.sh
... this will create a file and open the "nano" editor, behold you're editing a file, type this...
echo "gd"
...press control+X, you will be asked to save? press "y", then press enter to save as the current file name. You're back in the terminal...
bash scriptFile.sh
...the file runs and "gd" is echoed to the terminal, wow. So you don't like having to type "bash" before the filename to run it? No problem, just do this...
nano scriptFile.sh
...add this line at the top of the file...
#!/bin/bash
...press: control+X, y, enter - file updated! Now all you have to do to run it is...
./scriptFile.sh
...notice you need the "./" before the filename now?
Haha got you, the file doesn't have permission to do anything, lol...
chmod +x scriptFile.sh
...permission granted. Now just type...
./scriptFile.sh
...wow it worked! So easy.
Now just type...
rm scriptFile.sh
...great, now that piece of garbage file is gone!

Delicious Digg Stumbleupon Favorites