Search
Search Code
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
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..
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.
How to Use PropTypes to Define Props in React
React allows you to define the types of props given to your components to make sure that invalid data is not sent as the prop to the element. To do this you can define propTypes. You can defin..
using css counter-increment to add numbering to elements
i just found this element in css where you can add numbering to elements, very handy to add counters and things. This uses the counter-increment: section; in the main element and then adds the ..
javascript update item in object
find something in a javascript array by its array id and then update the value of that item i changed this from an array to an object as i wanted to use something other than numbers for the index Ob..
change file permissions to -rw-rw-r--
When adding a new php template file, it adds it under the www-data user with the file permissions set to -rw-r--r-- so its not remotely editable. Use chmod 664 to change it to -rw-rw-r-- chmod 664 ca..
calculate a percentage (dec) difference based on two numbers
I wrote this function a while ago, but im not actually sure what its suppost to do, so ill test it here and see what it returns. I think after running this function it returns the differents in perce..
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.
install codemirror for textareas [added]
i think rather than editing all the code using just a plain textarea element it might be nice to have codemirror format them nicer https://stackoverflow.com/questions/21085170/codemirror-how-to-insta..
style page numbers [fixed]
need to style the page numbers. https://kruxor.com/list-table/search_links/ Before: After: Dark Mode Light Mode
linking search results to view pages [finished] 🤣
I was thinking it might be useful to link the search term to the page, so that it can be found more easily using that search. For example, Link this search text (somehow) to the post page and display..
bold the numbers in a ol li list
sounds like an easy thing to do, but maybe not so simple. you can do this using the counter css element. code below:
Use Recursion to Return a Range Array
using recursion to return a range array between the two numbers added
js using recursion to create a range of numbers
in this we will create a function that calls its self to add to an array a range of numbers
Generate Random Whole Numbers within a Range
My testing for generating a random whole number within a range... 🤞 While the solution here works, it just loops until it gets a random number that is lower than the max, so not sure if this is th..
Generate Random Whole Numbers with JavaScript Function
generate a random whole number function with test buttons
get the average of a number list using an array in php
get the average of a array of numbers
basic for loop odd numbers
a basic for loop with odd numbers adding to an array
using a css grid area template
here we can specify areas for the grid. using grid-template-areas. once the areas are defined we can add the items into each area with grid-area: header in each element Use grid-area Without Creatin..
Random string generator function in php suniqid
Here is a a smaller version of the built in php function uniqid() uses letters and numbers and specify the length of the random string.
calculate a percentage (dec) difference based on two numbers
this function will show you the percentage difference between two numbers
emoji data - version 1.0
Emoji Data version 1.0 This is a better emoji list that you can search by title ctrl + f emoji-data.txt # Emoji Data for UTR #51 # # File: emoji-data.txt # Version: 1.0 # Date: 20..