Search
Search Code
Search Code by entering your search text above.
html
Boots Widget change from widget to cat head and click function

Moving this from the widget area to the bottom, to make it less obvious but still there if needed.   

4:26 am, March 27, 2023
Linux
Check free space amount and show it in a nice human readable format

this checks the disk space amount on the linux macine and returns the result in human readable form.  df -H Usually this will show it in the following format. Example below. 

12:15 am, December 24, 2022
Quick Modals
Fancybox Quick Video Modal Popup Code Inline

have you ever needed to add a quick video modal using fancybox. Probably not, but if you do, here is the code.

12:02 am, December 13, 2022
php
write to file php

9:27 am, November 29, 2022
Windows Apps
chocolatey command line for windows

i keep forgetting what this is called but its like a command line installer for useful windows tools like ffmpeg and other useful packages. Its like a simple package manager for windows.  How ..

11:30 pm, November 28, 2022
linux
add ssh keys on your linux box in 10 seconds

Here i was typing in the ssh password over and over when connecting to ssh, when i could have just typed this one command and had my ssh keys copied to my linux box! What was i doing all that time! :..

11:00 pm, November 23, 2022
Sliders
Flickity - autoPlay with Loop

Flickity slider with auto play

11:46 pm, November 19, 2022
Windows Apps
windows robocopy /? help and usage

Reference for the windows robocopy command ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ..

10:54 pm, November 15, 2022
image formatting
can you set all image heights to match with css no stretching

Short Answer: Yes with object-fit: cover; on the css of the image properties.  object-fit: cover; You might also need:  object-position: right bottom; ..

4:32 am, November 9, 2022
windows commands
how to show your DNS in windows and then copy it to the clipboard in one command

Here is how you can show your current DNS server in windows command line and then copy it to the clipboard, ready for pasting.  Open Windows Command Prompt<windows key> + R Type cmd ..

3:43 am, November 9, 2022
html
pulse map dots

bunch of pulsing dots for a map or image. allows overlaying of clickable dots on an image, you can change the colors with the css below.  modified from here: e.g: 

12:14 am, November 8, 2022
sections
slick slider section quick add

everything you need for a quick slide section

10:52 pm, November 7, 2022
javascript
get current year in javascript

get and display the current year using javascript. a usage example would be adding the current year as a copyright to the footer of a page

3:05 am, November 1, 2022
javascript
find a text string and replace it in javascript

There is a function in javascript called replace. You can just give it some text and it should replace it with your target text.  For example #1 this just runs and replaces the first instance o..

11:48 pm, October 27, 2022
fancybox
fancybox v3.4 - Mixed gallery

5:19 am, October 25, 2022
sections
sections
four box section template in foundation with classes find and replace (4 box)

this section uses the large-auto classes so you can add or remove boxes easily.  find and replace the name "boxsection" to rename your new classes for the section I have layed this one out a ..

11:08 pm, October 24, 2022
javascript
check if an item id exists in javascript

checks if 2 ids exist in one function and console logs the status here is the result in console log

12:28 am, October 19, 2022
fonts
Proxima Nova Font alternative on google fonts Figtree Embed and Quick Install Code

According to a recent google search by me the font Figtree is the closest one to the Adobe Font Proxima Nova, so lets do a quick install code for it and test if its actually the same.  All Style..

3:33 am, October 12, 2022
php functions
shorten string php, string length php, clip string length php

I'm pretty sure i have done this function before but i cant find it due to the keywords being wrong! Here is a function that takes a string and shortens it and adds .. to the end, with the rest of th..

2:38 am, October 3, 2022
simplepie php
return author title from simplepie rss atom feed

i was just returning the author from this, and for some reason it returns a number. $class->$target_item = $item->get_author(); where you also need to pass the get_name function to this to ext..

2:47 am, October 1, 2022
php functions
get file name from path name in php

returns the file name from a full url or path in php, using basename function. 

1:03 am, September 30, 2022
php functions
imgur upload from php

function that takes an image and uploads it to imgur using a client api id, and then returns all the data. i did this one ages ago and did not make it into a function, but this version should work as..

12:45 am, September 30, 2022
simplepie php
simple pie get link from enclosure item in simplepie rss feed

i had an item like this in a rss feed, and i wanted to grab the enclosure url, took me a while to figure this out for some reason even though the solution is quite simple.  PHP <item> &l..

4:33 am, September 29, 2022
php functions
simplepie error : XML or PCRE extensions not loaded!

using simplepie it does not load the target feed, and does not display any errors. Just nothing.  if your feed is init'd with $feed check for feed errors with:        $feed ..

4:01 am, September 29, 2022
sections
four box responsive section with all classes find and replace boxsection title foundation grid (4 box)

four box responsive grid, find and replace the word... boxsection with your new section name to generate all class names and section names to match for rapid section creation. Demo Codepen

12:29 am, September 27, 2022
fonts
Google Font Embed - Play Gaming Font

Quick Embed Codes for the google font Play, kind of a gaming style of font. As usual you can choose the @import or the link tags in the scripts section to embed this font quickly. Then apply the c..

4:34 am, September 25, 2022
php functions
loading a non processed item using the load_from_fields_array function

Example using the load_from_fields_array function  to load a single item where the processed value is equal to FALSE.

3:14 am, September 23, 2022
cookies
cookie consent quick install script js html css vanilla

Found this super slick looking cookie consent script here, looks awesome, and its easy to install (i hope). https://github.com/orestbida/cookieconsent  CDN Links https://cdn.jsdelivr.net/gh/or..

12:19 am, September 20, 2022
php functions
simple file cache and check in php

just a quick cache bit of code, may need tweaking to actually work... i just added it here as i thought it was re-usable.  Also requires simple_html_dom library.

6:45 am, September 19, 2022
fonts
font quick embed inter all styles google font

For some reason every time I go into google fonts website it seems to get more and more complex, i dont really care too much about all the font details i just want the embed link! Anyway... Maybe im g..

4:58 am, September 19, 2022
windows 11
How to switch desktops in windows 11 with keyboard

this is just a quick one as i could not see the option, which you would think they would add to the new desktop switching screen.. Anyway here is how you can switch desktops in windows 11 and create n..

12:24 am, September 13, 2022
Font Awesome
Add font awesome icons as placeholder text in inputs

An old one i found on codepen, works with only the old version of font awesome i think. Not tested on the later versions.

12:43 am, September 12, 2022
sections
two box responsive section with all classes find and replace boxsection title foundation grid (2 box)

easy copy and paste section and find replace the word boxsection with your new class names, using foundation grid.

7:01 am, September 9, 2022
sections
basic section item with foundation wrap and grid - single item in section

section with inner and outer css selectors for reuse and basic layout formatting. you can then search for "section-name" and replace it with your own section name.  section-name section-name..

4:36 am, September 6, 2022
images
Video Placeholder Image HTML

a quick image embed for a common video placeholder image size made by this amazing placeholder site

3:44 am, September 5, 2022
jquery
wrap an iframe with another div inside another div

so lets say you had an iframe within another div and that div had the class called content. you cant actually edit the page content but you can add some jquery to the page can you add a wrapper to t..

12:35 am, September 5, 2022
vue
Random User Profile Loading Script in vue

uses the random user ui here to generate profile boxes using vue js  original script here: https://codepen.io/l-i-lc/pen/WNxNwvd?editors=1010   

12:51 am, August 31, 2022
javascript
Twitter Post Fetcher v18.0.4 - javascript twitter feed fetcher

A few queries showing how to get latest tweets and post likes using the Twitter Post Fetcher v18.0.4 script.

12:42 am, August 31, 2022
php functions
loop through $_GET in php

I thought this one would be something like PHP foreach($_GET) { echo $_GET; } but actually as $_GET is an array you need to do the $key and $value loop like this PHP foreach ($_GET as $..

12:01 am, August 29, 2022
php functions
php strip non numbers from string - remove all non-numeric characters from a string

this will remove all non alpha numeric numbers from a string. in this example it returns: 123456 from $1234.56x  

1:00 pm, August 24, 2022
CSS
Map Image with Easy Dots and Titles using only CSS

I had to quickly add some dot points with names to a map the other day, so i thought i should probably look for a jquery library for tool tips or something similar. But then i thought why not just add..

12:44 am, August 24, 2022
css filters
CSS Filter Generator from Hex Code Usage Example

quick example of how to apply a css filter to change logo or image color using this tool

4:40 am, August 16, 2022
regex
Regex replace or find anything in brackets

Search for anything within brackets ( find this ) and the bracket its self.  REGEX \((.*?)\)

12:27 am, August 15, 2022
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
css
truncate text with line clamp allow a certain number of lines

This shows how you can truncate text to a certain number of lines using the css property line-clamp.   -webkit-line-clamp: 3;  line-clamp:3;

1:32 am, May 4, 2022
javascript
Twitter Post Fetcher Script

Uses javascript to fetch a twitter feed from a user screen name. Totally stylable alternative to using the twitter embed code. Your Welcome... 

12:43 am, May 3, 2022
Apps
Clear Youtube DL Cache to fix 403 Forbidden error, youtube-dl 403 forbidden

If you are getting the error: File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_defaulturllib.error.HTTPError: HTTP Error 403: Forbidden It could be cache that is causing this..

3:02 am, May 1, 2022
Images
Auto Changing Image URL

Here is a picsum url that you can use to generate image sizes, just change the numbers in the url to change its generated size.  Some examples of the sizes you can use are below. 

1:31 am, May 1, 2022
ssh
generate a new SSH key on mac for git

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

3:51 am, April 22, 2022
git
git basics - git init, git commit, git all, git *

create a new repository git init the following code can be typed in a terminal window, once you have installed git for your OS. This will create a directory called git-test assuming you already hav..

3:23 am, April 22, 2022
css
using the :user-valid CSS pseudo-class

It seems this is currently only working in firefox. Here is a test of the code in firefox, you can see if you add a "valid" email address it will add a border and a green tick.

1:14 am, April 12, 2022
fonts
font similar to century gothic questrial google font quick install

I found this font to be closely related to the paid font "Century Gothic" the only issue i found with this font is that it only comes in regular weight.  But Questrial is free to use, so that is..

4:32 am, April 4, 2022
css
add a button to an existing link using :after css

Adding a button style to an existing link using :after and css. Preview

1:39 am, April 4, 2022
html
Footer Design and Redesign

I never usually look this far down on the site, but its a bit average... Lets fix it!   Some simple changes Just a few elements added and moved around a bit. Added another row to the f..

12:31 am, April 1, 2022
css
bouncing loader animation in css

uses css and keyframes animation to create a nice and smooth bouncing loader

1:57 am, March 31, 2022
sections
html and css hoizontal simple timeline section in foundation

a horizontal simple timeline section example done in foundation grid with some custom styles. This also uses the Lato Font quick install! So Quick!..  :P Also works on responsive and mobile dev..

3:33 am, March 29, 2022
fonts
Lato font quick install

a quick code to install the font Lato from google, includes the stylesheet and also the @import links, just pick one.

11:25 pm, March 28, 2022
javascript
Javascript Objects Notes

As javascript objects are used so often in javascript i thought i would write an overview and some notes on how they work, well how they work for me anyway. I guess how they work for me should be simi..

2:37 am, March 28, 2022
css
center a box in the middle of the screen

and then center everything in that box as well

11:57 pm, March 15, 2022
javascript
javascript add class to element

how to add a class to an element in raw javascript I wrote a quick demo here showing how you can add a class to an element with an id on a button click

3:35 am, March 15, 2022
javascript
update value of element using javascript

using innerHTML to update the value of an element

1:30 am, March 15, 2022
php
No 'Access-Control-Allow-Origin' header is present on the requested resource.

add this to your php to allow requests from any source Access-Control-Allow-Origin php header

1:09 am, March 15, 2022
javascript
javascript attach a click event to an id not using jquery

I just wanted to bind a click to a button, not using JQuery, turns out its not that hard at all. Why am i using jquery for this stuff???...

8:56 am, March 14, 2022
javascript
console dir usage

the console.dir function shows a list of the properties or the target object. Usage console.dir(variable); Result Example

11:25 pm, March 13, 2022
api
test love like dislike script from api

just testing writing to page from javascript and api

5:04 am, March 11, 2022
javascript
how to write a javascript string over multiple lines

i remember learning this on freecodecamp while doing the ES6 training, and i could not remember exactly how to do it.  I was using the \ at the end of each line but thats really a bit annoying.&..

4:33 am, March 11, 2022
javascript
best way to write html into an existing page javascript

this probably isnt the "best way" but it is a way that works. say you want to add some elements to a page with javascript this is a method to do it.  Add an element, before including the script..

3:21 am, March 11, 2022
core
Core Function : list_search_by_class_return_links - List Searches by Class Type and Return Links

Function that list's the latest and top searches by the class name and return a list of links, with the search totals on them.  I wanted to extract the top searches and the latest searches by da..

2:35 am, March 10, 2022
php
Fatal error: Uncaught Exception: Required extension GD is not loaded.

How to resolve the error: Fatal error: Uncaught Exception: Required extension GD is not loaded. This Error is ususally due to a php library or script requiring the GD php extention.  On ubuntu ..

1:04 am, March 9, 2022
php
php check if a class exists

check if a class exists in php. this can be used rather than assuming the class exists and then causing an error You can run the class_exists function on the class before loading it with the followi..

12:47 am, March 9, 2022
javascript
Uncaught TypeError: Cannot set properties of null (setting 'onclick')

I was just testing some code and noticed i had this error on my site.  Locate the error in the site code I removed this script, so the whole thing is now not required, as i opted for the au..

12:12 am, March 9, 2022
javascript
check url hash using javascript

What is a url hash? This is a URL Hash. You can add the # symbol on the end of a url and content after it, and this will not effect the content usually, unless the browser is intructed to do somet..

3:59 am, March 7, 2022
javascript
submit form with javascript

if you have a form with an id, you can submit it with the following javascript. usually this will be attached to an event or something similar like a button click.  If i run this on the demo, it..

3:55 am, March 4, 2022
css
highlight a button with an animation css

While i was downloading the latest AdoptJDK i noticed this button, and thought it was a nice effect.  I wondered how hard it would be to replicate this. Copy the link html Check each class..

12:48 am, March 4, 2022
html
Regions of New Zealand - In Dropdown Form

Split into north and south island lists Also added a combined list, with a disabled options for north and south. /your welcome! :)

3:18 am, February 25, 2022
javascript
Converting PHP to Javascript for State Extraction by numeric value Australian State Names

I cant even remember when i originally wrote this php function, but now i need to have it in javascript, should not be much change to it to get it working.  The original function takes an austra..

2:33 am, February 25, 2022
javascript
get the value from a textarea element

gets the value from the textarea and prints it to the console of the browser rather than using innerHTML you have to use value.

6:02 am, February 20, 2022
javascript
javascript get content from element

gets the content from a target element with javascript using its id sets the target with the content from element 1 using its innerHTML attribute

12:48 am, February 20, 2022
javascript
convert characters to entities using javascript replace

takes a html string and replaces the html elements into their equivalent characters. e.g: replaces < with &lt;

12:05 am, February 20, 2022
php functions
convert a string into its html entitles using php htmlentities function

this takes a html string such as the following example and converts it into its html entities. it will take a character such as < and convert it into &lt; so that the string is not parsed as h..

8:48 am, February 19, 2022
core
generate view statistics widget in php class extend

How i generate the Week, Month and Year view statistics widget for this site.  Views Widget Function This generates the widget based on the views data. PHP // views widget /* using fi..

1:04 am, February 19, 2022
svg
svg animated line testing - shooting star right

I found this on a random site i was looking at it took me a while to extract the animation, but i found it and its working below.  There is shoot right and also shoot left, if you are that way i..

8:46 am, February 17, 2022
php
Uncaught Error: Call to undefined function mb_convert_encoding()

I was getting this error when calling a function in the readability php class, on a new server for code that worked on the old server. Uncaught Error: Call to undefined function mb_convert_encoding()..

11:45 am, February 15, 2022
CSS
Using Marker to add a Triangle to List Items

In this demo i use the ::marker attribute on the list items to change the content of the marker to a ▶

11:33 pm, February 14, 2022
javascript
Auto Create HTML Code Snippets

make anything within a <code> tag into a nice looking code snippit with highlighting via prism. To get this code to make a snippit, you need to: Give an element a .make-snippet class and it's ..

4:17 am, February 14, 2022
Alpine JS
Alpine JS Testing

some simple tests using alpine js

10:28 pm, February 10, 2022
php
get the subdomain name from the domain string in php - sub domain

returns the first part of a domain string, for example moo.kruxor.com will return moo

2:24 am, February 10, 2022
Slick Slider
Slick Slider Showing Multiple Items at a time

Just wanted to test some review type items showing more than one on slick, Seems to work well.  This shows two items at a time, but you can show as many as you like. Could be good for a testimo..

4:55 am, February 9, 2022
CSS
CSS Only Table Stacking Solution

11:24 pm, February 8, 2022
jquery
add a toggle with jquery and change the class

With this code I just wanted a quick bit of inline code that could add a toggle to an element or multiple and also switch its class to make it show that the item is toggled on or off.  Here is t..

12:00 am, February 8, 2022
svg
chevron right thick and pointy edges base64

finally found a svg chevron that does not cost $3, amazing...

11:46 pm, February 6, 2022
node
Testing Playwrite on for Node

I came across this library on y news, and thought id give it a bit of a test.  I managed to get it working but not really sure what tests it can do.  I set it to take a screen shot of a we..

4:00 am, January 28, 2022
css
add an outline to everything!

very handy for checking elements and other things on your page. this one line will add an outline to every element, so you can see where all the elements are located. 

12:27 pm, January 18, 2022
html
content editable p tag with spell check enabled

im not sure how this is useful, but you can set a p element to content editable so you can change its contents and then also set the spellcheck to true so the browser knows that it should run its spel..

12:01 pm, January 18, 2022
bootstrap templates
card.html template

a card template with title, content and a mb-3 for bottom margin for usage with the php template system.

4:52 am, January 18, 2022
site bugs
making the search page nicer

Sometimes i dont even notice things like this, as i look at them all day and go, ah yeah thats a search box. I forget that all these things can be fixed.  Anyway, even just adding this form to a..

4:42 am, January 18, 2022
sqlite
function to delete older sqlite records when the limit is reached

I had an issue where a sqlite database was hitting over 100,000 records and this was causing quite a lot of lag and crashing on my server, the number of records was not really meant to be this high, s..

4:20 am, January 18, 2022
php
fixing error Call to undefined function simplexml_load_string

usually the error "Call to undefined function simplexml_load_string" happens when the php xml library is missing from your server. You can install the xml php library with the following command, repl..

4:00 am, January 18, 2022
javascript
loop to arr.length or array length

showing a simple loop that uses the length of the array to find the end of the loop. This just console logs each item in the array and stops the loop when it gets to the end of the array. 

1:33 am, January 18, 2022
bootstrap
bootstrap form basic

a nice simple bootstrap form layout example template

11:49 pm, January 17, 2022
html
get directions from google maps form embed

this is a random form that posts back to google maps showing the directions needed to get from one address to another location, im not sure where this would be usefull. Maybe on a site where you neede..

12:19 pm, January 17, 2022
images
center image preview with lightbox and caption

I just wanted a thumbnail or preview of the image, where if clicked it would load into a lightbox, but the preview just shows the center of whatever image is added to it.  Note: I just picked ra..

2:54 am, January 12, 2022
javascript
get tomorrows date with javascript

Same as the get yesterdays date except with a +1 rather than a -1 let tomorrow = new Date(new Date().setDate(new Date().getDate()+1));  

11:03 pm, January 10, 2022
javascript
get yesterdays date with javascript

This gets todays date and minuses one day from it to be ... yesterday.  let yesterday = new Date(new Date().setDate(new Date().getDate()-1));console.log(yesterday); This format is the full da..

10:39 pm, January 10, 2022
css
hide the first h3 tag on the page with css

in case you want to target the first item on a page and hide it or change it with css. 

2:29 am, January 10, 2022
php functions
make a nice readable date using a timestamp string function make_nice_date

handy if you have a timestamp like this: 2022-01-10 00:12:42 and want it to look a bit nicer. like this... 12:19 am, January 10, 2022

12:12 am, January 10, 2022
javascript
change a select box back to its initial select value

this will reset the select box selected value back to the 1st item in its options list

1:00 am, March 17, 2021
javascript
select onchange

select onchange run a function this will run the check_years function when the select value is changed

11:54 pm, March 16, 2021
css
logo tickers marquee slow scrolling

logo tickers with a slide animation

12:07 am, March 14, 2021
javascript
codemirror htmlmixed textarea

a working (hopefully) version of codemirror using the htmlmixed mode, not sure why its not doing code highlighting. Update: 5 Jul 2022, this is working now. 

2:09 am, January 23, 2021
js
stacktable jQuery plugin for stacking tables on small screens

stacktable.js The purpose of stacktable.js is to give you an easy way of converting wide tables to a format that will work better on small screens. It creates a copy of the table that is converted in..

6:20 am, August 31, 2018
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

:default

The :default CSS pseudo-class selects form elements that are the default in a group of related elements.
:default css reference