List Code

Total Items found in Code is 983.
This is a collection of various code tests and descriptions on how to use them. Primarily HTML, CSS, Javascript and PHP.
fonts
Quick Embed Import and Code Samples for Google Font Roboto

quick embed codes and code examples for the google font Roboto. Roboto Font Preview

5:30 am, July 20, 2022
css
rainbow text background clip with linear gradient

testing using background clip with a linear gradient background colour to make the text appear rainbow colours 🌈 

2:02 am, July 6, 2022
html
codemirror with auto preview window

this should auto preview html code into the preview area using code mirror

7:15 am, July 5, 2022
php
save string to file php

save the contents of a string to a file This function is identical to calling fopen(), fwrite() and fclose() successively to write data to a file.

4:01 am, July 4, 2022
javascript
Are you sure you want to navigate away from this page? #JavaScript warning

You only need to include one of these scripts as the top one seems to work fine by its self not requiring any jquery. Javascript window.onbeforeunload = function (e) { return "You..

3:03 am, July 4, 2022
Factorio
Factorio Megabase-In-A-Book

Just in case i decide to start up playing factorio again... Megabase in a Book Lets Play Book Contents Copper Smelting Iron Smelting Steel Smelting (from Ore) Steel Smelting (from Plate) Gr..

1:56 am, July 4, 2022
fonts
Oswald Font Quick Embed

Quick Embed code and class for Oswald Google Font. This includes all font weights and styles for the Oswald font, just add the class oswald onto your elements, or you can apply it to all page element..

2:15 am, June 27, 2022
SQLite
MySQL to Sqlite converter

# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the# CREATE block and create them in separate commands _after_ all the INSERTs. # Awk is choos..

1:32 am, June 25, 2022
php functions
get string between other strings function php

So it turns out that i have had this issue before of finding a string in between other strings and made a function for it that i forgot about. 

5:00 am, June 24, 2022
php
using preg_match to extract text from elements

using preg_match to extract specified text from elements I also tried this search "if you have the start and end of a string extract the middle with php" as thats really all i need it to do, i have t..

1:41 am, June 24, 2022
html
using figcaption and figure for your images

So i usually add images in a <p> tag with just an <img> tag and then <br> and the image caption, but there is actually a tag for this that i should get used to using. The <figcapt..

12:40 am, June 24, 2022
Apps
Robocopy Options /? help

My usual backup command is now robocopy source destination *.* /M robocopy d:\ f:\ *.* /M Update: actually scrap that, its /E not /M, i used to use the /MIR option, but as deleting files in the des..

1:34 am, June 21, 2022
php
encode spaces in items passed to url to %20 not +

I was using urlencode in php and it was encoding words with spaces into word+space rather than word%20space This can be resolved by using the function rawurlencode rather than urlencode.

5:04 am, June 20, 2022
modals
Load fancybox modal on hash check

I was just testing this code, not working on the hash check as yet. 

1:40 am, June 15, 2022
php functions
php validate email function

php function that can be used to validate an email address string

1:59 am, June 12, 2022
domains
redirect www to non www

usually i point the www to the ip address of the server and then create a redirect block on nginx, but this seems like extra work for nothing.  Tested the cname point to the address but this see..

5:42 am, June 10, 2022
Site Updates
Welcome Widget Card - Toggle

Testing the welcome widget with a more or less toggle.  This version seems to work, with a jquery slide toggle. 

5:07 am, June 10, 2022
php
php function load as table - load_as_table

Load data and add into a table format by passing in the required fields as an array.  Example Result Live Example https://kruxor.com/view/nz_postcodes/5KrBW/zurich-place-weymouth-manukau/&nb..

1:01 am, June 10, 2022
fonts
Quicksand font quick install

Quicksand font quick install. Note: use the @include in css or the html link to the font only, not both. 

1:25 am, June 3, 2022
php
turn on or off error reporting php

Allows you to turn on or off errors in php, like the following: Warning: SQLite3::query(): Unable to prepare statement: 5, database is locked Warning: SQLite3::query(): database is locked in 

5:29 am, June 2, 2022
fonts
Playfair Display Font Quick Embed - Google Font Quick Embed

Note: you only need the @import in css or the link href not both to embed this font. This font reminds me a bit of Times New Roman

4:57 am, June 1, 2022
jquery
add a custom event trigger in jquery document ready

i saw something that said if you add an event listener at the end of the doc ready it should fire last, but i dont think this is correct as it runs everything at once. so i think this code does not wo..

3:42 am, June 1, 2022
php
get json with php from a url and display it

yep its that easy. this code shows getting the contents from a json request api. var dumping all of the results and extracting one single item by its array key and showing it. 

1:39 am, June 1, 2022
linux
Install PHP without Apache on Ubuntu

I was actually about to do some coding and then i got distracted with this annoying error on vscode. I keep getting this error on vscode: I had been ignoring it, but i thought fine, ill fix it and..

12:30 am, June 1, 2022
jquery
fancybox inline auto size modal easy

It seems weird to me that the examples on here, do not have code linked to them, and rather i have to dig through the source and find how they work.

12:36 am, May 31, 2022
html
a google font like muli - mulish and embed code

mulish font embed codes and styles with example

4:41 am, May 30, 2022
css
content-visibility and contain-intrinsic-size for page load rendering speed increase

interested to see if this makes any difference content-visibility The content-visibility CSS property controls whether or not an element renders its contents at all, along with forcin..

1:06 am, May 30, 2022
php
php convert number with k on the end to full number

I have a function that converts raw numbers into shorthand or human readable numbers, but was wondering how to convert these back if they are stored in that format, and also makes it better if you are..

9:16 am, May 29, 2022
php
extract variables from url string php

How do I extract query parameters from a URL string in PHP? You can do this using the parse_url function or parse_str function in php.  Say my url string is:  $url = "https://kruxor.com..

5:02 am, May 29, 2022
html
basic radio checklist - check and item and get its value in a textarea

a basic radio input type checklist, where you can only select one of the items in the list.  Ok so no longer so basic.  This script allows you to fil the value of a text area with the valu..

2:06 am, May 25, 2022
Site Bugs
Invalid argument supplied for foreach()

Fix for Warning: Invalid argument supplied for foreach() in /var/www/html/pages/seo-meta-tag-search.page.php on line 204 As this is just a warning, i may not have noticed it originall..

7:28 am, May 22, 2022
Site Bugs
Warning: file_put_contents(/var/www/html/bundle/responsive-viewport-meta-tag-responsive-meta-tag/index.php): failed to open stream: Permission denied in /var/www/html/pages/update.page.php on line 167

i think that the content in this location is not writable by php so need to change the permissions too fix this error.  This should fix it, as it was not correctly write permissioned Bash cs /..

1:56 am, May 21, 2022
Site Bugs
Warning: Undefined variable $class_single_hero in /var/www/html/pages/section.page.php on line 177

This warning was caused by a dot in front of the equals $class_single_hero .= $code->hero_widget($t_uid = $class_single->uid,$t_class = $p2); Fixed version Easiest way to fix this is remo..

6:58 am, May 20, 2022
Site Bugs
Search Duplicating Bugs

Still having issues with the word above duplicating, not sure why.  Search Page PHP - Get Search Value $search_value_encoded = htmlentities($search_value); Check for Search value, and then ..

6:39 am, May 20, 2022
mac
flush dns on mac

sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder

4:36 am, May 19, 2022
linux
add a user and add the user to sudo group

basic adding of a user in linux and then adding the user to the sudo group to allow it to run super user commands like apt update or other potentially system breaking commands. Note: replace "usern..

2:23 am, May 19, 2022
javascript
floating message box on bottom right of screen with close button

A floating fixed message box on the bottom right hand side of the screen with a close button. 

12:00 am, May 17, 2022
css
set a css grid to auto to make it stack on mobile

to make a grid stack when the screen size gets smaller you need to set the grid items to auto when it gets to the desired screen size.  In this example once the screen size gets to 1024px or les..

1:51 am, May 12, 2022
vscode
duplicate a line in vscode shortcut

if you ever wanted to duplicate a line in vscode, this is the shortcut for you. rather than doing the hightlight, and then CTRL + C and then CTRL + V you can use the following shortcut. just put you..

12:52 am, May 11, 2022
jquery
jquery load wait function

load something in jquery, wait for it to load then do something else

5:05 am, May 10, 2022
docker
unable to write to a sqlite database with docker

turns out this was not a docker specific problem, i was getting the readonly database error.  even if the database has full write permissions, the directory also needs to have write permissions ..

1:46 am, May 8, 2022
linux
add user to sudo group in ubuntu

Adds the user "username" to the sudo group usermod -aG sudo username

7:04 am, May 6, 2022
javascript
share to twitter javascript button function open a new window

gets and encodes the current page url and opens a new window to share the link to twitter

5:23 am, May 4, 2022
html
share to twitter html link only

share to twitter the html version of the link only

5:21 am, May 4, 2022
javascript
share to linked in current url button with javascript

Share the current page url to linked in with a button and javascript

5:16 am, May 4, 2022
html
linked in share link html only, linkedin, linked-in

share a post or url to linked in html only version

5:14 am, May 4, 2022
javascript
Get current URL and add a share to facebook share button with it

Combines this Facebook HTML for Sharing a Link and encode url with javascript this to make captan planet! Or... makes a share this post to facebook button. 

5:02 am, May 4, 2022
javascript
encode url with javascript

get the current url, encode it and log the encoded result to console

5:00 am, May 4, 2022
html
Facebook HTML for Sharing a Link

just the html for the link, that is all. Replace kruxor.com with your url to share E.g: share to facebook

4:55 am, May 4, 2022
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
Treasure every moment that you have and treasure it more because you shared it with someone special, special enough to spend your time...and remember that time waits for no one.
Unknown
Random CSS Property

border-inline-start

The border-inline-start CSS property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet.
border-inline-start css reference