Search
Search Code
SQLite - load a game from games, that has not been processed - AI
Im just going add some of these here as they might be useful in the future. Request: Can you write a sqlite query to select the latest game from this table using insdate as the datetime structure ..
blocking ip range with ufw
You can block an entire IP range using CIDR (Classless Inter-Domain Routing) notation with ufw. To block all addresses under 57.141.2.x, you'd specify the network as 57.141.2.0/24.1 ..
check and block connections script
a safe diagnostic script that helps you check and analyze the connections. ⚠️ Why Automatic Blocking is a Bad Idea You could lock yourself out: An automated script ..
block ip address ranges on ubuntu linux with UFW
sudo ufw deny from 203.0.113.0/24
blocking all ips in a range
block all ips in a range // The IP prefixes you want to block. Add a dot at the end.$ip_block = ['47.79.']; foreach ($ip_block as $ip_block_val) { // Check if the user's IP address begins ..
Locate a DIV and CLASS and create an IMAGE element using JAVASCRIPT
I had this weird request the other day, well today to replace an image thumbnail that was generated by an aspx script, but the link was from youtube and the list was not auto loading the thumbnail.&nb..
wp simple blocks plugin
Just saving this here for later testing: This is just AI generated crap that does not work, ignore it... ;) Absolutely, let’s start fresh with a simple WordPress plugin that loads a si..
wordpress block grid code
the basic wordpress grid column layout this is a 3 col layout
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 ..
windows robocopy /? help and usage
Reference for the windows robocopy command ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ..
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.
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..
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..
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 ..
Common and Uncommon Meta Tag's and Social Meta Tags
I am writing an api that checks for meta tags so i thought i would add a list here of some of the common meta tag names that i found. The ones prefixed with og: are facebook and linked in and s..
twitter social sharing meta tags
I had done this one so many times on client sites I actually forgot that i had not applied it to my own site! Doh! Anyway this is the tag setup i use for adding the title, url, author and featured im..
document placeholder for a4 in portrait
a nice document placeholder image with dropshadow and transparency
landscape image document placeholder
A nice landscape image of a blank presentation format, in landscape mode with drop shadow.
simple php ip blocker
just to quickly block annoying ip addresses using an array and $_SERVER['REMOTE_ADDR'] so i woke up this morning to find 200 comments from this spam ip, here is a simple script that will block that i..
counting the occurrence of words in a multidimensional array
array sorting example The array Array ( [0] => Array ( [0] => Some [1] => great-looking [2] => special [3] => editio..
clear a input field when it looses focus using onblur
this will cause the input field to clear when it is not in focus
css double page document preview with shadow
two div elements that look like blank documents with drop shadows
darkmode toggle switch with local storage to remember the last selection
Here is a darkmode toggle switch, that swaps out the body class so you can target dark-mode or light-mode on all your elements! It saves to local storage the last selection so if you come back to the..
how to install js socials for social media share buttons and make them rounded
This should be a nice quick one on how to install js socials which add social media sharing buttons on your pages. Yeah i always just ignore these as well, but hey some people may use them?? H..
Fixing PHP SQLite database is locked warning - Unable to execute statement: database is locked
Apparently this error is caused by not closing the database after using it. Warning: SQLite3::query(): Unable to execute statement: database is locked. You can close the database using the fol..
add a class or remove it based on window scroll location
if you inspect the header div you will see a class added to it when scrolled down, i have added additional margins to it so you can still see it even when scrolled. then you add a fixed property to m..
Nginx Server Block with Rewrite
Nginx Server Block with Rewrite Here is a basic nginx server block with rewrite to the index.php file. So it takes all the parameters and passes them into the index, into the variable $p or $_GE..
Get the documentURI with JS
This function gets the current document URI assigns it to the variable documentURI so it can be reused and shows it in the result area once you click on run function.
jquery document ready with foundation init as well
here is a jquery document ready that also loads the foundation js library. im not sure if the document foundation needs to be loaded in the document ready, but this way seems to work.
document ready javascript standalone version no jquery
this is a version of a dom ready or document ready that does not require jquery
using local storage rather than cookies to store data (localStorage)
you can see what is stored in local storage by typing this into your browser console. localStorage Adding something You can add something to local storage by using the setItem function.
Get the document root path in php $_SERVER['DOCUMENT_ROOT']
I ususally use this one if i am linking to files in the server document root folder rather than specifying ../directory/include.file.php i will use something like this: $document_root = $_..
find the 1st occurence of a string in another string
do a case-sensitive search for a string within another string strpos mixed strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) usage find the 1st location of a string position within a..
document ready wordpress jquery
Wordpress uses JQuery rather than $ to initialize so here is a workaround that allows you to still use the $ to access JQuery functions. Just incase your normal document ready is not working. tags: ..
digital clock with jquery
Just a simple digital jquery clock that updates every second. Also added the dropshadow animation, not sure why... ;) .digital-clock { font-size:80px; } .transition { transition..
jquery document ready
The most used script in jquery, loads things after the document is ready. $(document).ready(function(){ // do some stuff });
design nice block header
I saw this the other day and thought the color scheme looked quite nice. Ill see if i can replicate it here. @import url('https://fonts.googleapis.com/css?family=Raleway:300'); .mid-header { ..