# Freelance Developer in London > Expert in the development of websites and applications ## Posts - [Custom Drop Down Menu with click outside close](https://green-box.co.uk/custom-drop-down-menu-with-click-outside-close/): In this post I’ll demonstrate how to create a custom drop down menu, that has the added bonus of closing when you click outside of the menu. If you just want to see the custom drop down menu working with click outside. You can view source (everythings on the page including css and js) Anyway on to the code the menu itself is as below, I’ve stored the option values in the data attributes. I’ve kept the css basic for the dropdown too, you could get rid of some of it. The main things are: position: absolute ( so the ... Read more - [Installing SSL an cert on a LAMP Docker container (Apache)](https://green-box.co.uk/installing-ssl-an-cert-on-a-lamp-docker-container-apache/): This is a WIP / rough draft. In this post I’ll run over installing an SSL cert for a web server (Apache), that is running inside a docker container (the docker container is running on a Linux server AWS Amazon Linux EC2). to install certbot on amazon linux https://unix.stackexchange.com/questions/741450/installing-lets-encrypt-on-amazon-linux-2023 (see Jens Answer) once installed run: sudo /opt/certbot/bin/certbot certonly choose 1 to use a local server on port 80 ( this can interfere if you have something on port 80 already , I dont have anything on port 80). importantant Then add the domains (space separated) that the cert is for ... Read more - [Css Grids Cheatsheet](https://green-box.co.uk/css-grids-cheatsheet/): I’ve just been doing a quick reviser on the most useful parts of css grid (for most devs, for super fancy layouts you may need more). But for me this covers most of what I need / use. https://green-box.co.uk/wp-content/uploads/plain_html_css/grid.html This code is above in basic form. - [A concise bullet point checklist for SEO content articles (from Chat GPT)](https://green-box.co.uk/some-guide-lines-for-seo-accordingly-to-chat-gpt/): My question to Chat GPT What are the latest guidelines (in bullet points), for creating SEO content articles (e.g. best word count and so on) ?   ChatGPT’s Answer Here are some general guidelines for creating SEO content articles: Focus on a specific topic or keyword phrase for each article. Conduct keyword research to identify the best target keywords for your article. Use the target keyword phrase in the article title, URL, and meta description. Write high-quality, original content that provides value to your target audience. Use subheadings to break up the content and make it easier to read. Aim ... Read more - [Setting up Docker containers with nginx to reverse proxy to multiple web servers](https://green-box.co.uk/setting-up-docker-containers-with-nginx-to-reverse-proxy-to-multiple-web-servers/): In this post I’ll show how to set up docker containers with nginx reverse proxying to 2 different web servers (apache and apache tomcat). All setup with one docker compose file. Very handy for running on one machine for development , to simulate what you might have running on multiple machines in your production environment. This is abit of bare bones example, I’m not going to setup SSL or go into any rewrite rules in any great detail. So with out further ado. We need 3 files: docker-compose.yml yoursites.conf ( nginx config, it doesn’t have to be called yoursites.conf, just ... Read more - [Language learning tools and developing my own Wordpress Duolingo Quiz plugin](https://green-box.co.uk/language-learning-tools-and-developing-my-own-wordpress-duolingo-quiz-plugin/): update Check out the language learning plugin here. I’ve being learning Spanish for the last year or so, and as well as attending classes, I’ve been using some of the interactive tools out there that I’ve found useful. I’ve talk about developing my own WordPress quiz plugin with app like / responsive Duolingo like features, later in this post. But first I wanted to mention the tools I’ve been using to learn Spanish and which ones I’ve found useful / fun ( it helps alot to stay engaged with the fun tools ). Tools I’ve found useful for Learning Spanish ... Read more - [How to draw a line at a specific Angle using Canvas and Javascript](https://green-box.co.uk/how-to-draw-a-line-at-a-specific-angle-using-canvas-javascript/): When looking at how to draw a line at a specific angle on a Canvas Element using Javascript,  I couldn’t find anything that was really short and sweet (really I just wanted a copy and paste),  I had to investigate the maths abit todo it and understand it, but I won’t go into that here. So if you just want to draw a line at a specific angle on a Canvas HTML using Javascript, here it is. Just plugin in the relevant values to the javascript function below to draw your Line on the Canvas ( starting position x and ... Read more - [Raspberry Pi Pomodoro timer with lights (using JamHat hobby board )](https://green-box.co.uk/raspberry-pi-pomodoro-timer-with-lights-using-jamhat-hobby-board/): This is a timer for the Raspberry Pi that lights the lights on the JamHat Hobby Board as the timer progresses through its cycle. I use it as a Pomodoro Timer for timing 30 minute intervals. When you click the blue button, that starts the timer (its set to 30 minutes by default, but this can be altered by changing the timer variable ). The lights come on at equal times in the cycle so after 15 minutes there are 3 of the 6 lights lit. When 30 minutes is completed a tune plays (well a couple of beeps, sounds ... Read more - [Hello World microservice example in Java composed of API Gateway, Service, and Lookup (Eureka)](https://green-box.co.uk/hello-world-microservice-example-in-java-composed-of-api-gateway-service-and-lookup-eureka/): Introduction In this post I’ll run through a very simple Hello World Microservice example (in Java) that covers the main parts of a web type Micro Service. This example composes of: A REST Web Service A Lookup / Discovery system ( I’ve used Eureka ) A type of API Gateway / Web Server Just to be clear Microservices (or at least setting up a full working version of one with these elements) is somewhat complex. But I’ve tried to make it as simple as it can be. The classes have the minimal number of lines of code ( I’ve broken ... Read more - [How to setup a log file in Spring Boot](https://green-box.co.uk/how-to-setup-a-log-file-in-spring-boot/): This is a very short guide to get a log file setup for a Spring Boot Application. Spring uses Logback as its default logging system, and automatically logs to the console. To setup a log file in the resources folder of your app (where application.properties lives ), create a file called logback.xml  (copy / paste below). This will create a log file called my-app-logfile.log in the logs dir of your app. <?xml version="1.0" encoding="UTF-8"?> <configuration> <property name="LOGS" value="./logs" /> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable </Pattern> </layout> </appender> <appender name="RollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOGS}/my-app-logfile.log</file> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <Pattern>%d ... Read more - [Maven cheatsheet](https://green-box.co.uk/maven-cheatsheet/): Just a place for me to store handy bits and pieces. Having not used it for awhile to remind of things, I’ll likely to forget ! How to compile to different versions of Java ( see also https://mkyong.com/maven/maven-error-invalid-target-release-1-11/ ) <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>11</source> <target>11</target> </configuration> </plugin> In the <build> section How to change the output/target dir Handy if you want to drop a war straight into tomcat deploy directory for example. In the <build> section <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0</version> <configuration> <outputDirectory>/Users/someuser/mydockerdir/java_tomcat/built_war_files/</outputDirectory> </configuration> </plugin>   Change the name of war file thats outputed  In the <build> section <finalName>SpanishGames</finalName>   An ... Read more - [Running Docker on AWS](https://green-box.co.uk/running-docker-on-aws/): Recently I wanted to use my Java Tomcat Docker image on AWS to run a spring boot app. I looked at the various ways of setting this up ECS (Elastic Container), and found it to be a load of hassle ( for what I needed , I don’t need Kubernetes style functionality , just a one server for messing about with ). I found the most straight forward way todo this is: setup an EC2 instance with latest AMI Linux operating system sudo yum install docker put Dockerfile / compose file in place sudo service docker start then standard docker ... Read more - [Threads in Java](https://green-box.co.uk/threads-in-java/): We need to control access to shared state ( when multiple threads are at work ), to avoid unexpected results. In the case of the program below the shared state is the int sheepCount. 10 different threads call the method incrementAndReport() . Without thread management  public class Ch18SheepManager { private int sheepCount = 0; private void incrementAndReport() { Thread t = Thread.currentThread(); System.out.print("sheepcount = " + (++sheepCount) + " Worker - " + t.getName()); } public static void main(String[] args) throws Exception { var service = Executors.newFixedThreadPool(20); var manager = new Ch18SheepManager(); for (int i = 0; i < 10; ... Read more - [Creating drop downs (that don't alter the space below them when opened )](https://green-box.co.uk/creating-drop-downs-that-dont-alter-the-space-below-them-when-opened/): Just a very quick tutorial on how to create a dropdown (like a drop down menu), so that when you expand the dropdown the space below it isn’t pushed down. Like this (all the Other actions below contain a drop down menu – see next image)   When I expand one of the menus I don’t want the row below pushed down. I want the dropdown to overlay and not alter the space below it (ie not push the row below down). Like below:   The way this is done is but having the menu that it opens in a wrapper ... Read more - [css rotate ( from a certain point )](https://green-box.co.uk/css-rotate-from-a-certain-point/): Just a quick note on how this works. I wanted to stick a div against the right of the page ( with abit of fixed positioning ), then rotate it so it was 90 degrees (sitting nice and flush against the right). But when I did it ( just with rotate it rotates about the center of the div, meaning it is abit out in the middle of the page ). This is because the rotation is about the middle point of the thing ( the green div in this case ). transform-origin to the rescue: I rotated it using ... Read more - [Creating a project in local git and then putting it on GitHub](https://green-box.co.uk/creating-a-project-in-local-git-and-then-putting-it-on-github/): Easy way if poss: its easiest if possible to just create the project on github first (remember to tick the checkbox to create a readme.md file ). In the options you can even select a relevant gitignore file so it will ignore relevant stuff based on your stack ( eg spring boot, wordpress or whatever ) Then (locally) git clone the new repo url e.g. git clone [SSH url]    ( git WEB URL is switched off ,  use a SSH  key for security now ) careful with this step (backup first): remember to delete local git ref (if and ... Read more - [How Lambdas can be useful in Java](https://green-box.co.uk/how-lambdas-can-be-useful-in-java/): I’m revising for the OCP (Oracle Certified Professional Java Programmer ), and running over Lambdas at the moment. In tutorials I see many of them seem to focus on what they are , what they do , streams etc. Not much on how they can be used to improve code ( and making less Class files in particular ). Here we have an Animal class that has a couple of subclasses. The Animal subclasses will print out their behaviour polymorphically (and its all abit of a mess). I won’t get into Inheritance, classes and composition. But I will say less ... Read more - [How to print sql queries to Log file (in Laravel)](https://green-box.co.uk/how-to-print-sql-queries-to-log-file-in-laravel/): This is just a quick Laravel snippet on how to log SQL to the log file. You just need to enable logging for DB , run SQL ( and then turn off or leave on its up to you). Oh and remember to include the classes you’re using (usually at the top of your file). - [Create a Wordpress plugin that uses a React App](https://green-box.co.uk/create-a-wordpress-plugin-that-uses-a-react-app/): In this post I’ll describe how to create a simple Hello World plugin that gets its content from React. The WordPress plugin will use a shortcode to generate its content from a React App ( the React App is built / bootstrapped using the Create React App cmd line tool ). Prerequisite: I will presume you have Node already installed Create a WP plugin Create a React App within the plugin (using create React app) Tweak the React app to make it easy to load in the WordPress plugin ( Shortcode), by disabling code splitting (for the asset files JS ... Read more - [Javascript - How to monitor a Change Event in Chrome](https://green-box.co.uk/javascript-how-to-monitor-a-change-event-in-chrome/): Today I needed to see what javascript was triggered on a change event (when a checkbox was clicked), my go to for seeing what event is triggered is Chrome (Event Listener Breakpoints). update: Doh, realised you can do it just by clicking control->change , see screenshot. old way I did it I selected mouse click ( as the change was on the click of a checkbox), nothing nada. I added this to the console to give me some info about the change event: monitorEvents(window [“change”]) Maybe there’s a better way, if anyone reads this and has a better way it ... Read more - [Allowing access from one AWS service (EC2) to another service (S3), using an IAM Role](https://green-box.co.uk/allowing-access-from-one-aws-service-ec2-to-another-service-s3-using-an-iam-role/): In this post I’m going to allow EC2 to use S3 to store files. I’m going todo this 2 ways: First simple access (less secure, not for production), EC2 instance can do anything on S3 Secondly , I will limit what the EC2 instance can do (read, write only on a specific bucket using its ARN ) Simple Access for EC2 to use S3 The Process Create Policy to allow access to service (S3 everything) Create Role (and attach policy from step 1) Give the EC2 instance the Role Verify it works using AWS CLI (from EC2 server), to upload ... Read more - [Optimising Apache (for AWS EC2 micro or small instances)](https://green-box.co.uk/optimising-apache-for-aws-ec2-micro-or-small-instances/): In this post I’ll talk about the optimising / configuring I did on Apache. So my site could live happily on its new home of AWS EC2 small instance ( running Amazon Linux ). The guide below covers sites that get maybe a few hundred page views per day (if you have bigger traffic you will probably need a bigger server). I moved my site to AWS and it kept crashing Apache, I would restart it and it would be fine for while (maybe a few days or a week), then the same thing would happen again. I looked in ... Read more - [How to speed up Web Development in Java](https://green-box.co.uk/how-to-speed-up-web-development-in-java/): This is an article I’m currently working on (its just rough notes at the moment). Java features ( Java 8 and beyond ) eg var for variables in methods Spring Boot Can be up and running as fast as a Laravel app ( can even have a prod grade server, so just start server and you’re good) Spring Dev Tools – Spring fast restrarts JRebel ( rem costs £400 per year ) Spring STS Eclipse Clean Code Make it obvious was code does from variable and function names. Reading less code, saves alot of time. Loads of comments can be ... Read more - [Setup Wordpress WP-CLI on Docker ( the simple way )](https://green-box.co.uk/setup-wp-cli-on-docker-the-simple-way/): In this post I’ll run over how to setup WP-CLI on a Docker web server image ( so you can easily use it todo a Database find and replace , would is handy when you need to migrate a site from one place to another ). This presumes you have PHP setup on the command line (which my image did have ). Anyway here goes: First in your Docker folder run ‘docker ps’ ( to get the name of the web server image CONTAINER ID ) Pop that into this command e.g. ‘docker exec -it fdghye5742252 bash’ You’ll be in ... Read more - [In Wordpress Recent Posts Widget , only show posts tagged with the current page url](https://green-box.co.uk/in-recent-posts-only-show-posts-tagged-with-the-current-page-url/): /******* filter posts by tag based on page url ***********/ add_filter('widget_posts_args', 'wpsites_modify_recent_posts_widget', 100000); function wpsites_modify_recent_posts_widget($params) { $url = sanitize_text_field($_SERVER['REQUEST_URI']); $last_word = basename($url); error_log("last word = $last_word"); $tags_filter_by = array('who','what','when','where','why','how'); // only do for these pages if(in_array($last_word, $tags_filter_by) ){ //$params['tag'] = 'bread,baking'; posts with any of these tags $params['tag'] = trim(strtolower($last_word)); error_log("filtering to only show posts with this tag "); } return $params; }   - [Setting up a Laravel app on Docker](https://green-box.co.uk/setting-up-a-laravel-app-on-docker/): Rough notes, will pull this togther in a blog post at later date. issue: The requested URL /login/ was not found on this server. resolution: add to manually enable mod rewrite on command line in the container: # launch a terminal in the container docker exec -it e39431779799 bash # enable modrewrite a2enmod rewrite /etc/init.d/apache2 reload   issue: could not find driver (SQL: resolution: Add this to Dockerfile: RUN docker-php-ext-install mysqli pdo pdo_mysql run docker-compose build then bring it up: docker-compose up -d - [Use anonymous functions sparingly](https://green-box.co.uk/use-anonymous-functions-sparingly/): This is the first of a bunch of posts I’m going to write on programming tips and best practices. This one is about Anonymous functions ( a sometimes useful technique if your going to use in one place and throw away ).  And thats all well and good, however these make code more difficult to understand ( especially large code bases you need to maintain ). For example imagine some code you need to maintain, lets say it starts off with a long file you need to read through and get a high level understanding of. If its littered with ... Read more - [Adding javascript functions to Laravel Mix ( and why you get error Uncaught ReferenceError: function is not defined )](https://green-box.co.uk/adding-javascript-functions-to-laravel-mix-and-why-you-get-error-uncaught-referenceerror-function-is-not-defined/): This one had me pulling my hair out the other day. I was using Laravel,  adding a javascript function to the app.js file ( also tried using require in app.js and pulling in my function ). Laravel uses Laravel Mix which is a wrapper for webpack. Yet with either approach I was getting the javascript error: Uncaught ReferenceError: testing_helloworld is not defined It seemed to be working ( had npm run watch , compiling it and doing a view source I could see the function in my javascript app.js file ). My function source code looked like this: function testing_helloworld(){ ... Read more - [Exporting Forum data from BBPress](https://green-box.co.uk/exporting-forum-data-from-bbpress/): This is how to export data from BBPress, which would be useful if you wanted to migrate from BBPress to another forum platform. Its straight SQL export direct from the mysql database, with things like forum posts (topics ) and forum replies, as well as some other data including users ( and their user ids etc ). I’ve exported the forum data into a table, then escaped the quote marks and finally output into a csv (comma separated list ) file that can be used to suck into the relevant system , where you’re moving the BBPress forum to.   ... Read more - [The Covid-19 Pandemic is Changing Company Mindsets about Remote Working](https://green-box.co.uk/the-covid-19-pandemic-is-changing-company-mindsets-about-remote-working/): This Covid-19 Pandemic has disrupted life as we know it. Businesses and companies are struggling to adjust to utilising and implementing different work options because of the lockdowns and quarantines in place. The positive trend that is happening though is more and more companies are adopting remote working set-ups to keep their businesses running amidst this pandemic. Going from a traditional set-up to a remote one has become a feat and a challenge for many companies, especially those caught unaware and left to make transitions quickly. This pandemic brought about a need for a big change in mindset and companies ... Read more - [Hide Buddypress members pages from guests ( also hide BBpress forum posts)](https://green-box.co.uk/hide-buddypress-members-pages-from-guests-also-hide-bbpress-forum-posts/): The code below is to hide sections of a WordPress website from guests (hide certain pages or groups of pages on a WordPress , so they are only available for logged in users). In this case we’re hiding all the Buddypress members pages from guests ( so hiding all pages that start with /members such as member profiles and so on). We’re also  hiding BBpress forum topics ( but they can still view the forums and forum post / topic names ). If a guest is trying to view a page (that we’re not allowing them to, they are sent ... Read more - [AI Care for the Elderly](https://green-box.co.uk/ai-care-for-the-elderly/): With all the advancements in technology and in the field of medicine, it is no wonder that people have longer lifespans now more than ever.  More elderly people are able to live on their own, albeit self-care and mobility challenges, and medical issues because of their advanced age. In recent years, artificial intelligence has also gained a lot of ground in various fields. Aside from advancements in business and other areas, it has been utilised to focus on elderly care and in improving quality of life for those in their later years. From providing better and more streamlined services, all ... Read more - [Charities and Utilising the Potential of Artificial Intelligence](https://green-box.co.uk/charities-and-utilising-the-potential-of-artificial-intelligence/): Artificial Intelligence is here and now. We may not realize it, but we interact with some form of AI most, if not, each time we go online–from voice assistants like Alexa to as simple as being given suggested movies, products or options every time we use programs and applications. AI makes things easier for us by learning about our preferences and patterns and it then makes suggestions or actions according to these. For the sake of having a working definition of what artificial intelligence is, according to The Street, “AI is the use of computer science programming to imitate human ... Read more - [Setting up fail2ban on Centos 7 - to limit login attempts via SSH](https://green-box.co.uk/setting-up-fail2ban-on-centos-7-to-limit-login-attempts-via-ssh/): Using (private/public) keys to restrict access is definitely the best way to secure access to a server via SSH. However it can be abit of pain if multiple people need access and they aren’t that tech savvy. Another way to secure SSH but not have to worry about keys is by limiting the login attempts and banning a user’s IP address, if they make too many tries in x time period ( i.e. if they try a brute force password attack on you). One tool for doing this is fail2ban . Here’s the process: # if epel not installed ( ... Read more - [Creating a Digital Marketing Strategy for Charities and Effective Tools to Use](https://green-box.co.uk/creating-a-digital-marketing-strategy-for-charities-and-effective-tools-to-use/): For charities, the marketing team must be capable and able to adapt to the ever-changing and advancing technologies. After all, it is in marketing that the charity depends on to get the support it needs to keep its programs and advocacies going, may it be in terms of donations or volunteers. In this day and age, traditional marketing efforts are mostly obsolete and ineffective. Gone are the days when charities could rely on non-digital methods to get their message across effectively. Digital marketing is, by far, the most effective way to go now for charities and organisations alike. With digital ... Read more - [The Pros and Cons of Custom Websites](https://green-box.co.uk/the-pros-and-cons-of-custom-websites/): For businesses, it is a must in this day and age to have a website. It is your home base and your business address in the virtual world.  Having a great website can actually help or hurt your business. A great website will reflect on your business, helping it gain more clients and become more successful.  A poorly made one will look messy and unprofessional, turning off clients even from the very start.; and this is not great from a business perspective. In the process of getting a website for your business, there are 2 very big decisions you have ... Read more - [Buddypress - How to add group types](https://green-box.co.uk/buddypress-how-to-add-group-types/): It can be useful to have group types sometimes for example, maybe a University might want to have 2 group types for staff and students. So they could have staff groups and student groups ( and a directory for each eg staff would list the staff groups and student groups would list the Student Groups ). This is easy todo in Buddypress: function my_bp_custom_group_types() { bp_groups_register_group_type( 'staff', array( 'labels' => array( 'name' => 'Staff groups', 'singular_name' => 'Staff group' ), // New parameters as of BP 2.7. 'has_directory' => 'staff', 'show_in_create_screen' => true, 'show_in_list' => true, 'description' => 'some description ... Read more - [Why Charities Need to Learn the Art of Digital Storytelling](https://green-box.co.uk/why-charities-need-to-learn-the-art-of-digital-storytelling/): We all love stories.  It has been ingrained in us as humans from the time of our ancestors, where the elders used to tell their tales to explain and influence and impart knowledge.  Stories are a reminder to us that we are connected, that we share common things and common experiences.  Stories make our lives richer and they make us connect with others on a deeper level that compels a change in thought or a move to act. It is because of these that it would be a compelling argument that Charities utilize storytelling in their marketing efforts. With so ... Read more - [Why it's important for charities to have an online presence](https://green-box.co.uk/why-its-important-for-charities-to-have-an-online-presence/): Many charities have started making their online presence high priority. Creating an online home and go-to has proven to help in making the charity more visible and accessible to the public. For many charities though, there has been some difficulty in transitioning to a more digital presence. Many have had difficulties adjusting and going with the flow of technological advancement. To be honest, change is difficult –maybe more so for organisations that have long done their processes a certain way and are now faced with the reality that they must slowly adjust and put importance to a website and presence ... Read more - [SQL for use in migrating a Drupal website to Wordpress](https://green-box.co.uk/sql-for-use-in-migrating-a-drupal-website-to-wordpress/): Currently I’m working on migrating a Drupal 7 website to WordPress, in the process I’ve learned alot about the Drupal database schema. So this post is a place for me to store handy queries and notes. Its a Work in Progress so I’ll add more over the coming weeks. Content types in Drupal are similar to post types in WordPress where fields can be added, however in the database how the fields are handled is very different from WordPress. In Drupal fields are added as separate tables. SQL to get multiple images ( stored as a collection item field in ... Read more - [Mental Health Awareness for Freelancers](https://green-box.co.uk/mental-health-awareness-for-freelancers/): Working in an office day in and day out can be grating.  The daily commute to and from work, the dragging on of the hours for the office day to end, the office politics to deal with; and a million other things — all these can lead to a lot of frustration and stress! Wouldn’t this motivate you to just leave it all behind and venture off as a freelancer? After all, all the office stress and what comes with it shouldn’t be good for one’s mental wellbeing, right? It is this scenario that oftentimes motivates people to get into ... Read more - [Why link your website to your CRM](https://green-box.co.uk/why-link-your-website-to-your-crm/): This post runs over why you would connect a CRM (Customer Relationship Management) system ( such as Hubspot) to your website. Many CRMs now allow you to capture form data on your website and pull this into the CRM, this has the following benefits to you: store users information in your CRM be able to follow up in CRM and have all the interactions in CRM so you can see the history of interactions with that person see what the user has been looking at on your website   The are 2 main ways of taking the users details from ... Read more - [Buddypress cheat sheet](https://green-box.co.uk/buddypress-cheat-sheet/): in Member loop / directory – show xprofile fields echo bp_get_member_profile_data( 'field=Short Bio' ); Just find the field in wp-admin and pop into the function above and echo it.   - [Buddypress how to sort Groups page alphabetically by default](https://green-box.co.uk/buddypress-sort-groups-page-alphabetically-default/): In this short blog post I’ll run over how you can sort the Groups index page in Buddypress alphabetically by default (i.e. on first load of page they will be ordered by group name). Edit or override 2 of the Buddypress templates You’ll need these in your theme: wp-content/YOUR_THEMENAME/buddypress/groups/index.php and wp-content/YOUR_THEMENAME/buddypress/groups/groups-loop.php If these templates don’t exist in your theme you’ll need to make copies of the 2 templates from the Buddypress plugin  ( find in buddypress/bp-templates/bp-legacy/buddypress ) and pop into your theme directory in a folder called buddypress. You might need to copy from your parent theme if they are ... Read more - [Laravel ajax calls failing with response code 419](https://green-box.co.uk/laravel-ajax-calls-failing-response-code-419/): Recently I was working on a Laravel application with some ajax, and I was getting a 419 error after firing an Ajax call to a Laravel controller. Laravel requires a token to be sent on some types of requests (POST being one of them), this is to prevent Cross site request forgery ( e.g. a form being submitted from somewhere it was intended by the developer to be submitted from ). In php files its very easy to add this with the function call csrf_field(). But in js files, we need to essentially pull in this you store the token somewhere ... Read more - [Laravel how to set a checkbox value to checked based on models value](https://green-box.co.uk/laravel-set-checkbox-value-checked-based-models-value/): In this post I’ll show how to set a Laravel checkbox value to checked based on the value stored on the model. In this example I’ll be using the Laravel Collective Form checkbox {{ Form::checkbox('collected' /* name */, "yes" /*value*/, old('collected', $gas_cert->collected=="yes"?true:false ) /* true sets checked */ ) }} In the code example above my checkbox is called ‘collected’ the value when checked is ‘yes’ , I wanted to populate my form with the value from the database stored on the model (which is yes or no on the $gas_cert->collected field of the model), the Form::checkbox wants a boolean ... Read more - [How to override the comments form in a child theme](https://green-box.co.uk/override-comments-form-child-theme/): This is a quick post on how to provide your own comments template in your child theme ( overriding comments.php in your parent theme). You can just as easily use the same code to override comments.php if you aren’t using a child theme. Todo this you need to you need to use the filter ‘comments_template’ ( see the wordpress codex on this filter here) function greenbox_override_comment_template( $comment_template ) { global $post; if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) { return; } // your full path and name of comments file to use return ... Read more - [How to engage your staff using your Intranet](https://green-box.co.uk/engage-staff-using-intranet/): In this article, we’ll look at some ideas for useful things to have on your intranet and how to use these to help engage your Employees, members or Volunteers. What are the benefits of engaged staff ? Happy workforce ( productive workforce, helps business be more profitable) Low Staff turnover ( saves money in recruitment and training) Useful Intranet features  for employee engagement Employee Recognition Section Make your staff feel engaged by recognising them and their achievements ( both personal and professional ). A section on your homepage for this would really make people feel valued, and a good way ... Read more - [Buddypress hide the top level tabs from users ( e.g. hide the group tab)](https://green-box.co.uk/buddypress-hide-top-level-tabs-users-e-g-hide-group-tab/): This is to hide the top level tabs from users. Based on this code from the buddypress forums. define( 'BP_DEFAULT_COMPONENT','profile' ); // this shows something if no tabs (otherwise 404) function bpfr_hide_tabs() { if ( bp_is_user() && !is_super_admin() ) { /* and here we remove our stuff ! */ //bp_core_remove_nav_item( 'activity' ); //bp_core_remove_nav_item( 'friends' ); bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); } } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );   - [Buddypress how to remove tabs from groups sub tabs ( eg remove Delete group)](https://green-box.co.uk/buddypress-remove-tabs-groups-sub-tabs-eg-remove-delete-group/): This code is based on a post from the buddypress forums tested on Buddypress 2.9.2  ( forum states its compatible from BP 2.6+). In this example we remove the Delete tab and also permission so that user can’t try and goto the url to access it. Note there are numerous other examples / versions of this code  scattered about the bp forums that dont work as function bp_core_remove_subnav_item now requires the extra param (see code below). important: Navigation API has lots of good up to date examples function gwb_remove_group_admin_tab() { if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && ... Read more - [Wordpress SQL snippets](https://green-box.co.uk/wordpress-sql-snippets/): A place to keep snippets of useful WordPress SQL. Do a select based on some meta field of a post ( i.e. search for a post that has a particular metafield  ) SELECT p.ID,p.post_title, MAX(CASE WHEN pm1.meta_key = 'id_vim_node' then pm1.meta_value ELSE NULL END) as field_i_want FROM wp_posts p LEFT JOIN wp_postmeta pm1 ON ( pm1.post_id = p.ID) where pm1.meta_key = 'id_vim_node' GROUP BY p.ID, p.post_title In the example above I’m searching for posts with a value for id_vim_node. This is based on this code from stackexchange Output WP_Query sql code (very useful for debugging WP_Query ) if in the loop ... Read more - [Flexbox cheatsheet](https://green-box.co.uk/flexbox-cheatsheet/): update: this is a very useful cheatsheet also (with lots of pics to explain) css tricks guide to flexbox Equal width columns (responsive i.e. Rows on small screen width) <div class="container"> <div ></div> <div ></div> <div ></div> </div> .container { display:flex; } .container div {flex-basis:100%;} @media screen and (max-width:600px) { .container { flex-direction: column; } }   Vertically align stuff codepen reference to vertical and horizontal centering click here <style> #container{ display: flex; align-items: center; /* vertically */ height: 300px; /* just to illustrate: give container a height so we can clearly see div inside is vertically centered */ } ... Read more - [Wordpress on Windows IIS permissions error - uploaded file could not be moved to wp-content/uploads](https://green-box.co.uk/wordpress-windows-iis-permissions-error-uploaded-file-not-moved-wp-contentuploads/): Recently I’ve been developing a WordPress Intranet for a company that runs on Windows hosting ( IIS 6 – Internet Information Services ). I ran into a problem with file permissions and not being able to write to the wp-content/uploads directory, I’ve ran into the same problem with unix many times (which alittle bit of recursive chmoding usually sorts out or just chgrp www-data, the user many hosts run apache as ). What I was trying todo was add a picture to a post and it gave me the error:  uploaded file could not be moved to wp-content/uploads With Windows its ... Read more - [Using Wordpress as a Company Intranet](https://green-box.co.uk/using-wordpress-company-intranet/): WordPress can be a great choice as a company / staff Intranet, but it’s important to first define what features you need. Then to either code the features or choose plugins to use / customise. Being a programmer, I think WordPress is an excellent intranet choice, the WordPress API allows you to customise things to how you want. In this article I’ll later discuss some useful plugins for some of the main features. Common features of a staff intranet There are many possible features an Intranet website can have, these are probably the ones that nearly all Intranets will need. ... Read more - [Regex reviser](https://green-box.co.uk/regex-reviser/): Every now and then I need to use regex ( and I always forget/confuse what things like * + etc mean ). So this is just a little reviser with a few examples to help me as a reference. Hope you find it useful also. I’ve only covered the basics here as thats usually all I need. special characters + match 1 or more of the previous character * match 0 or more of the previous character ? previous character is optional . match any character (except new line) ^ match starting with (also used as the NOT operator with ... Read more - [How to add a form to a shortcode in Wordpress (using PHP and Ajax)](https://green-box.co.uk/add-form-shortcode-php-ajax/): Recently I needed to develop a Shortcode that would display a form, this blog post details what I did. I used Ajax ( which seems the best way to add forms to shortcodes, but I’d welcome any input from other developers on your approach). So without further ado lets get on with adding a form to a shortcode in WordPress. We need javascript to handle submission of the form via ajax (this presumes you have jquery available), and handle the response from the server. green_form is the form id. jQuery( document ).ready(function() { // Handler for .ready() called. // jQuery(function(){ jQuery("#green_form").submit(function(event){ ... Read more - [How to get a users Roles and how to list all Wordpress roles in PHP](https://green-box.co.uk/get-users-roles-list-wordpress-roles-php/): This code is handy if you want to find out a users role/s. You could expand it and check if a user has a given role or similar. $user_info = get_userdata(2152); echo 'Username: ' . $user_info->user_login . "\n"; echo 'User roles: ' . implode(', ', $user_info->roles) . "\n"; echo 'User ID: ' . $user_info->ID . "\n"; $allroles = get_editable_roles(); foreach ($allroles as $k => $v) { echo "<br>role = $k "; } function get_editable_roles() { global $wp_roles; $all_roles = $wp_roles->roles; $editable_roles = apply_filters('editable_roles', $all_roles); return $editable_roles; } This code is based on examples from: https://codex.wordpress.org/Function_Reference/get_userdata and https://wordpress.stackexchange.com/questions/1665/getting-a-list-of-currently-available-roles-on-a-wordpress-site If you did ... Read more - [Importing a MAMP mysql database on mac (OS X Yosemite)](https://green-box.co.uk/importing-mamp-mysql-database-mac-os-x-yosemite/): How to import a MAMP mysql database (bypassing phpmyadmin problems) Recently I’ve being have a problem importing a large database in MAMP Mysql via phpmyadmin (and after altering various php variables in php.ini, I still couldn’t get it to import). So I tried another approach to import it from the command line a quick google turned up this post on the MAMP site which got me started. I managed to import the database fine from the command line like this:   sudo /Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot  your_database_name < your_sql_import_file.sql   it might warn you about password being insecure via the command ... Read more - [Plugins that can help to increase sales and conversions in Woocommerce 2017](https://green-box.co.uk/plugins-can-help-increase-sales-conversions-woocommerce-2017/): There are many great plugins that can help to increase sales in Woocommerce in this blog post I’m going to talk about 2 very effective plugins in this space: AutomateWoo and SumoMe .   AutomateWoo for increasing sales in Woocommerce AutomateWoo has a lot of great features that can be setup to work automatically based on certain triggers, for example: Win back inactive customers by emailing customers that haven’t shopped (after a certain time that you define) a discount code to Woo them back Convert a percentage of abandoned carts into Sales by emailing customers that didn’t finish the checkout, to remind them of ... Read more - [Woocommerce Table Rate Shipping weight example](https://green-box.co.uk/woocommerce-table-rate-shipping-weight-example/): Sometimes you need to ship by weight, and like most things when it comes to shipping the Table Rate Shipping plugin is your friend. So in this worked example I’ll show how to setup Weight based shipping using the Table Rate Shipping plugin. Firstly we need to decide the costs and the weights for those costs. For example lets say we’re shipping Mushrooms, and we want to ship by these weights: 0kg to 1.99 kg = £2.85 2kg to 4.99kg = £4.95 5kg to 10kg     = £13.75 We need to set this up: per order, then on the table ... Read more - [How to stop Woocommerce redirecting after add to cart (if using subscriptions)](https://green-box.co.uk/stop-woocommerce-redirecting-add-cart-using-subscriptions/): The subscriptions plugin automatically redirects to the checkout page by default. If you want to turn this off you need to change the mixed checkout setting. This can be found in woocommerce -> settings -> subscriptions Tick the box to allow mixed checkout (more about this can be found here: subscriptions mixed checkout )   - [How to do Ajax in Wordpress](https://green-box.co.uk/ajax-wordpress/): updated 10th Jan 2018 Write a javascript function to trigger the ajax call jQuery('#button_or_something').on("click", function() { jQuery.ajax({ url: ajax_object.ajax_url, data: { action: 'like_or_not', /* this is appended to add_action on server side */ id: '99' }, type: 'GET', success:function(response){ //alert('back from ajaxe '+response); /* if you want to update something based on the response text */ jQuery('#gb_div_to_update').html(response); } }); }); Put js above in my_js_file.js (see later in this post). Wrap in code below for nice loading: jQuery( document ).ready(function() {    put above code here     }); To see how to send a form via ajax see here.   Write ... Read more - [Handy Woocommerce SQL queries](https://green-box.co.uk/handy-woocommerce-sql-queries/): This post is just a place to store handy SQL queries for Woocommerce. Get Order and all its information select p.ID as order_id, p.post_date, pm.* from wp_posts p join wp_postmeta pm on p.ID = pm.post_id join wp_woocommerce_order_items oi on p.ID = oi.order_id where post_type = 'shop_order' and p.ID = 14223 Generate an Orders report and specific information about the orders (eg things like order date, shipping address etc) select p.ID as order_id, p.post_date, pm.* from wp_posts p join wp_postmeta pm on p.ID = pm.post_id join wp_woocommerce_order_items oi on p.ID = oi.order_id where post_type = 'shop_order' and p.id > 50457 and ... Read more - [The Bromley in London Coworking group](https://green-box.co.uk/bromley-coworking-group/): This is page dedicated to the Bromley in London coworking group for freelancers, small business etc to come along and do some work in the company of other freelancers. I started this group as a way to get out of the house and do some work with other freelancers locally. update: June 2019 – There is going to be a co-working space opening in Bromley in 2019, for updates check out this: https://contingent.works/. We meetup once a month for a morning of coworking (4 hours from 8am to 12 ). We meet at a secret location, why secret I hear you ... Read more - [Woocommerce - Converting grams to kilograms ( product weights)](https://green-box.co.uk/converting-grams-kilograms-product-weights/): If your using product weights in Woocommerce, you might find you want to change from grams to kilograms at some stage. There are 2 parts to this: Part 1: Firstly in wp-admin you need to change a setting on the Woocommerce (below). However this doesn’t automatically convert grams to kilograms. Part 2: Converting existing products grams to kilograms. For this you’ll need to use a little script, I created this one as a page template. <?php /* * * Template name: list products */ get_header(); ?> <?php $args = array( 'post_type' => 'product', 'posts_per_page' => 2500 ); $loop = new ... Read more - [How to speed up Woocommerce (and Wordpress)](https://green-box.co.uk/speed-woocommerce-wordpress/):   Speed tuning in WordPress and Woocommerce This post contains details of how to supercharge your WordPress website. Here are some speed tuning tips for getting your Woocommerce store loading quickly and keep customers on your site (slow loading = loss of customers). Check file load times In firebug look at the console requests (eg all the css/images etc, but especially important check for any php files like admin-ajax.php ). Any files that are taking a long time to load are slowing down the page for the user. It can be any type of file (but large uncompressed images are ... Read more - [Ecommerce tips to help increase sales](https://green-box.co.uk/ecommerce-tips-help-increase-sales/): In this post I’m going to give some tips to help you increase your sales. Speed – Make your website load quickly Customers like fast sites they can browse quickly and find what they need. Slow loading pages will make many potential customers go to elsewhere site to buy, bottom line you lose money. There are lots of ways to increase website speed including: Fast hosting (you get what you pay ) Caching (this can bring big gains) CDNs (content distribution networks) There are many other ways check out this article I wrote on speeding up WordPress if you’d like abit more ... Read more - [How to make a Wordpress Theme, Woocommerce Compatible from scratch](https://green-box.co.uk/make-wordpress-theme-woocommerce-compatible-scratch/): In this post I’ll going to explain how I took a WordPress Bootstrap Theme and made it Woocommerce Compatible. I couldn’t find many good tutorials on this so I’m writing this one, so that it might help someone else. The Process to make a theme Woocommerce Compatible I’m going to take the very nice DevDmBootstrap3 theme and make it Woocommerce Compatible. I created a child theme of DevDmBootstrap3 I added the required stuff needed to that child theme I’ll skip over 1 (there are plenty tutorials of how to do that out there), and move right onto 2. Complete code below (can be put in functions.php) ... Read more - [Onsite SEO for Ecommerce websites 2016](https://green-box.co.uk/onsite-seo-ecommerce-websites-2016/): In this post I’m going to talk about some of the things you can do to improve your Online Store’s visibility in Search Engines such as Google. To get more sales of your products and services. Onsite SEO for Ecommerce websites isn’t difficult but does require some perseverance. SSL (Secure Sockets Layer) Certificate This means encrypting communication between a users computer and the server that your website is on. Google has added this as a ranking factor in its search algorithm and it will also give your customers and potential customers more confidence in your website when they land on it ... Read more - [Woocommerce - Add an Important Admin Note to the Order Report for Order pickers to view](https://green-box.co.uk/woocommerce-add-important-admin-note-order-report-order-pickers-view/): In this article I’ll show you how to add an Important Admin Note to the Order Report, very useful if there’s some information you want to add for Order pickers to view. For instance maybe the item is fragile you can highlight this to the order picker.   This plugin allows you to enter an Admin note on the order and then displays this note on order report screen. If you just want to get the plugin please click here to download the plugin. The rest of this article will run over how to create a plugin like this, so if you have an ... Read more - [Buddypress how to create a group programmatically in PHP (and add users)](https://green-box.co.uk/buddypress-create-group-programmatically-php-add-users/): In this post I’ll show you how to create a new group in PHP and then add users to the group. In this example I’m adding new users to a new group when they register. add_action('user_register', 'greenbox_add_user_to_new_buddypress_group'); //this should only fire on create user, therefore no problem with dupe groups function greenbox_add_user_to_new_buddypress_group($user_id) { $id_group = greenbox_create_bp_group($user_id); greenbox_add_user_to_group($user_id, $id_group); } function greenbox_create_bp_group($user_id) { $info = get_userdata($user_id); $group_args = array(); $group_args['name'] = "" . $info->user_nicename . "_" . $user_id; $group_args['description'] = "A group to hold the files of " . $info->user_nicename; $group_args['creator_id'] = 1; $group_args['status'] = 'private'; // could be hidden or public ... Read more - [Force a Woocommerce website to use ssl on https](https://green-box.co.uk/force-woocommerce-website-use-ssl-https/): Alot of clients want to have their website on SSL. As its good for customers to see your website on SSL and google also likes this so can give you alittle SEO boost too. In this post I’ll show you have to have your WordPress (Woocommerce) website served on SSL. The first thing todo is alter the general setting page so that http becomes https: We also need to alter the htaccess file like below to force everything to be redirected to SSL.   Your nearly there ! After that you may need todo a find and replace on your ... Read more - [Wordpress create admin reports using WP_List_Table](https://green-box.co.uk/wordpress-create-admin-reports-using-wp_list_table/): In this post I’m going to discuss how to use WP_List_Table to create reports/tables/lists that are similar in style to the standard WordPress reports for Posts, Pages etc. To achieve this I’ll use the WP_List_Table core WordPress class, this contains the functionality to create said tables/reports. This example will look at the links table and display the data from it. This code used here is adapted from an example plugin on WordPress.org by Matt Van Andel Important information to mention about creating admin reports using WP_List_Table Its important to mention that this class is marked private by WordPress and they ... Read more - [Woocommerce Table Rate Plugin charge per item example](https://green-box.co.uk/woocommerce-table-rate-plugin-charge-per-item-example/): The Table Rate Plugin is one of the most useful plugins for Woocommerce. However if you’ve never used it before it may have you scratching your head as to how to use it. In this tutorial I’ve go over how to use it to charge per item and how to apply different rates based on the shipping location. 1. Create Shipping Classes Select Products on left menu and choose shipping class from the submenu. From this page you can set up your shipping classes. For this example I’ve setup 2 Shipping classes called: Small and Large (e.g. in add/edit product ... Read more - [Changing Cart to Basket in Woocommerce (Creating Languages files for Woocommerce)](https://green-box.co.uk/changing-cart-basket-woocommerce-creating-languages-files-woocommerce/): In this post I’m going to explain how to change all instances of cart to basket in Woocommerce. Update (23/12/2016) There is a way to hack it, if its just Cart to Basket that you want to change (or just a couple of strings), you could add something like below to the themes functions.php file: function gb_change_cart_string($translated_text, $text, $domain) { $translated_text = str_replace(“cart”, “basket”, $translated_text); $translated_text = str_replace(“Cart”, “Basket”, $translated_text); return $translated_text; } add_filter(‘gettext’, ‘gb_change_cart_string’, 100, 3);   The slightly longer way to change strings in Woocommerce (such as cart to basket). The way todo this is too create/edit a ... Read more - [Woocommerce How to easy add product categories to your menu](https://green-box.co.uk/woocommerce-how-to-easy-add-product-categories-to-your-menu/): In Woocommerce its very easy to add the product categories to a menu, but it can have those new to WordPress or Woocommerce scratching their heads as to how to do this (without diving into the code). Add product categories to your menu All you need todo is following: 1. on the menus page (appearance -> menus )  go to the top and click to display screen options 2. then tick Product Categories (they will appear with the other menu items) 3. add the categories that you want to the menu 4. finally save the menu and your done So there ... Read more - [Woocommerce: How to add a simple cost price field to products](https://green-box.co.uk/how-to-add-a-simple-cost-price-field-to-products/): In this post I’ll show you how to add a very simple cost price field to your products in Woocommerce. The aim of this is to show admin users the cost price of a product, so they don’t sell it at a loss. The code is adapted from a post here by Gerhard Potgieter We add a field to the interface in the general tab pricing section like so:   add_action( 'woocommerce_product_options_pricing', 'wc_cost_product_field' ); function wc_cost_product_field() { woocommerce_wp_text_input( array( 'id' => 'cost_price', 'class' => 'wc_input_price short', 'label' => __( 'Cost Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')' ) ... Read more - [Web Design how to grow your business](https://green-box.co.uk/web-design-grow-business/): Its nearly the end of the year so I’ve decided to look at what I’ve done this year to grow my web design business and what I can do to grow my web design business next year. First a little background, at the start of the year one of my main clients went out of business. I was heavily reliant on this client (very much a case of all my eggs in one basket), this severely affected my income. 1. Increase your client base (to grow your business) This year my aim was to increase my web design client base.  I have been trying ... Read more - [Hello World tutorial on Advanced Custom Field (ACF) Wordpress Plugin](https://green-box.co.uk/hello-world-tutorial-advanced-custom-field-acf-wordpress-plugin/): The Advanced Custom Field plugin is one of the most useful plugins for WordPress developers. In this quickstart guide I’ll show you why. Advanced Custom Field allows you to easily add a field (and save it) to a particular page, without having to write any programming code. To retrieve the field you have to add a very short (less than one line) snippet of code. Lets go through an example, lets say you want to add a custom greeting to a page and you want to change this depending on your mood or the weather! e.g. if your a local ... Read more - [Using Yoast Wordpress SEO plugin to optimise your blog posts](https://green-box.co.uk/using-yoast-wordpress-seo-plugin-optimise-blog-posts/): In this beginners guide to using Yoast SEO plugin, I’ll show you how to search engine optimise your posts to gain you more hits, leads and sales. My process for writing blog posts typically goes like this: 1. Think of a subject matter that my customers and/or potential customers will find interesting 2. Use Google keyword tool to get some ideas of keyphases to use in the blog post 3. Write the blog post 4. And finally optimise the article using the Yoast WordPress SEO plugin I’m not going to go into 1-3, here I will discuss 4 ( using ... Read more - [How to add a simple Online Booking Form to Wordpress using Ninja Forms](https://green-box.co.uk/add-simple-online-booking-system-wordpress-website/): In this post I’m going to explain how to add a Simple Online Booking Form to WordPress. Having a booking form on your website can be a great lead generator and allows you to take orders for your services while you sleep! With tools like the plugins like Ninja Forms or Gravity Forms you don’t even need to know how to use PHP or HTML. In this post I’ll explain how to create an online form using Ninja Forms. Would you like some help with your forms, instead of reading a technical article (if so submit the the short form ... Read more - [Create a portfolio section on Wordpress website using Custom Post Type (CPT) ](https://green-box.co.uk/creating-portfolio-section-wordpress-website-using-custom-post-type-cpt/): I’m going to show you how to create a portfolio section on your WordPress website. For any many companies (such as web design agencies) and freelancers that work with digital media its important to have a portfolio section on your WordPress website. I’ll show you how todo this using WordPress Custom Post Types, you’ll easily be able to update the portfolio via the WordPress admin interface without having to write extra html or css. As I’m a WordPress Developer my portfolio section will focus on showcasing WordPress programming and web design. See  the finished version here. - [Wordpress how to create a Custom Post Type (CPT) programmatically in php](https://green-box.co.uk/wordpress-create-custom-post-type-cpt-programmatically-php/): One of the most important developments of recent years in WordPress has been adding the ability to create our own Custom Post Types (CPT). - [Who are the best type of clients for Freelance Web Developers](https://green-box.co.uk/best-type-clients-freelance-web-developers/): Working for the right type of clients for you, will allow you to focus on what you do best: Web Development. - [3 Ways to easily stop wordpress caching your stylesheets](https://green-box.co.uk/3-ways-easily-stop-wordpress-caching-styles/): In this post I’m going to tell you how to easily stop WordPress from caching your css styles, so changes you make are instant. It can be very handy todo this while you are testing your new website. - [How to choose a Theme for your Wordpress Website](https://green-box.co.uk/choose-theme-wordpress-website/): Choosing a Theme for your WordPress website is one of the most important steps of getting your website setup. - [How to do Columns in HTML and CSS](https://green-box.co.uk/responsive-columns-html-css/): Recently my mate Dave asked me how to do Responsive columns in html and css using Divs. Dave was used to doing columns in frameworks like the Twitter Bootstrap framework. I must admit I was abit rustly myself so I wrote this for myself as much as Dave. - [How to get clients contacting you by using Wordpress](https://green-box.co.uk/get-clients-contacting-using-wordpress/): Recently I have been trying different forms of marketing from Twitter to face-to-face networking to Search Engine Optimisation - [Email marketing your business online](https://green-box.co.uk/email-marketing-business-online/): I’m a freelance email marketing expert, I’m going to tell you about Email Marketing and how it can be a valuable tool for marketing your business. - [How to use Twitter to market your Business or Website](https://green-box.co.uk/newbie-guide-to-using-twitter-to-market-your-business/): In this article I’m going to explain some of the ways to use Twitter to market your business. Twitter can be a great way for a business to market their products and services, if used effectively. - [How to automatically market your website on social networks](https://green-box.co.uk/automatically-market-your-website-on-social-networks/): In this post I’m going to describe how to automatically market your website on social networks (using WordPress). Social media networks are a great way to tell the world about your website. However posting to various social media networks like twitter, facebook, google plus and so on can be a time consuming process. Wouldn’t it be great if you could just create great posts on your website and automatically promote your website on multiple social networks. Well you can ! And I’m going to tell you how. - [How to add an email signature in gmail](https://green-box.co.uk/add-email-signature-gmail/): I use gmail for my email and its very handy. I wanted to add a signature to my email as its useful to promote your business (never miss an easy opportunity to market your business). Showing things like your phone number , website address, twitter address and so. Its very easy todo just login to your gmail then click the Cog wheel icon in the top right of the screen to show the settings option (and click that too). As in the image above. - [See whos not following me on Twitter (using Javascript)](https://green-box.co.uk/see-whos-not-following-me-on-twitter-using-javascript/): Recently I was looking for a way to see whos not following me on Twitter ( who I was following on Twitter that wasn’t following me back). There seem to be a few websites that do this but you need to sign up for an account and so on. I just wanted something I could quickly type in the browser and be done (I’m rather impatient sometimes). So a quick search of the web threw up some code that I could copy and paste to let me see whos not following me on Twitter. I’m going to run through how ... Read more - [Speed Up Wordpress](https://green-box.co.uk/speed-up-wordpress/): Recently I’ve been looking at ways to make my website load more quickly (its a WordPress website so i needed to speed up WordPress). I’ll talk generally about some of the main ways to increase the download speed of websites and how I applied this to WordPress (the specific plugins and so on that I used to achieve the speed increases). - [What makes a good website](https://green-box.co.uk/makes-good-website/): In this article I’m going to focus on what makes a good business website. The kind of website local businesses need (but many of the features described are relevant to most websites). The aim of asking ‘What makes a good website’ is highlight some of the features that can help local business websites to generate more sales , a good website makes this as easy as possible for a potential customer to see the information they need (be it products, phone number , location , type of service etc ) , to make a purchase. - [Installing ChromeDriver for WebDriver - For the Techies (Java)](https://green-box.co.uk/installing-chromedriver-webdriver-techies-java/): If your using Webdriver to automate your web testing you’ll already know what a great tool it is. This is a quick note on installing ChromeDriver for WebDriver (to test using the Chrome Browser). 1. get the latest version of chrome driver from this url http://chromedriver.storage.googleapis.com/index.html 2. unzip this and place it whenever you want 3. next in your java code tell it where to find the unzipped file (replace ‘path goes here’ with your location). And thats it job done 🙂 System.setProperty(“webdriver.chrome.driver”,     “/path goes here/chromedriver”);  driver = new ChromeDriver();    I highly recommend installing ChromeDriver for WebDriver , especially if ... Read more - [How to SEO your website](https://green-box.co.uk/seo-your-website/): In this series of articles I’m going to tell you how to SEO your website.  There are 2 parts to SEO (onsite and offsite), this article discusses onsite SEO. Onsite Search Engine Optimisation (SEO) Keyword Analysis   The first thing we need to do is decide on which keywords to target for this its useful to do some keyword research. There are tools to do (such as good adwords tool) but another good way to do this is to look at what your competition is doing. For example if your a plumber in London google plumber london and then use ... Read more - [Java Generics (2008)](https://green-box.co.uk/java-generics/): Notes on SCJP I did in 2008 Generics   Straight forward Type Safe Collections   List<Animal> myList = new ArrayList<Animal>();   the generic type in the declaration must match on both side of = , in this case <String> (unless a wildcard is used to the left of the equals OR the ref has no gen type eg List myList).   can only add <Animal> or subtypes to myList eg   myList.add(new Animal()); // GOOD myList.add(new Dog()); // GOOD   myList.add(new Integer()); //ERROR   Passing / Returning from method void myMeth(List<Animal> animals){ …   can accept List<Animal>, Vector<Animal> // GOOD   ... Read more ## Pages - [Spektrix API integration for WordPress](https://green-box.co.uk/spektrix-api-integration-for-wordpress/): Connect your WordPress website to Spektrix to sell tickets, capture donations, and sync audience data — securely and seamlessly. Our integrations help arts organisations deliver a smooth, branded purchase journey and keep everything in sync between your website, box office, and CRM. Book a free technical review to discover how your site could work smarter with Spektrix. Why choose a WordPress Spektrix integration Spektrix is a leading ticketing and CRM platform designed for arts and entertainment organisations. It powers box office, marketing, fundraising, and audience insight — all in one system. By connecting WordPress and Spektrix, you can: A well-built ... Read more - [Professional Wordpress Web Design For Painters & Decorators](https://green-box.co.uk/professional-wordpress-web-design-for-painters-decorators/): Get a high-quality, conversion-focused WordPress website designed specifically for painters and decorators. Show off your craftsmanship with before-and-after galleries, capture more leads with an intelligent quote estimator, and build trust with integrated Google Maps reviews and accreditations. Whether you work across London or cover jobs nationwide, your new site will look premium, perform fast on mobile, and act as your best sales rep — 24/7. If you’re a painting and decorating business — sole trader or a team — and you want a website that actually wins jobs, this is for you. I build clean, professional WordPress sites tailored to ... Read more - [Tradesmen Website Design That Builds Trust and Generates Leads](https://green-box.co.uk/tradesmen-website-design/): Your trade business deserves a website that works as hard as you do. Whether you’re a plumber, painter, carpenter, builder, or electrician, we design websites that showcase your skills, attract new customers, and help your business grow locally. Why Every Tradesman Needs a Professional Website In today’s market, people find trades online first. A well-built website helps you stand out from competitors, shows you’re legitimate, and makes it easy for customers to contact you. We create high-quality, SEO-friendly websites tailored to tradesmen — built to convert visitors into paying clients. Showcase Your Work with Before & After Galleries Give potential ... Read more - [Instant Quote and Estimate Calculators for Trades](https://green-box.co.uk/instant-quote-and-estimate-calculators-for-trades/): Are you a painter, plumber, electrician, or tradesperson looking to get more leads from your website? An instant quote calculator could be the game changer your business needs. I’m a UK-based freelance web developer specialising in building interactive quote and estimate forms for trade businesses. These tools are designed to capture leads instantly, boost trust, and improve your Google ranking. Whether you install boilers, paint houses, wire extensions, or hire out equipment, I can create a custom, mobile-friendly quote system that fits your services perfectly. Why Instant Quote Calculators Work Most visitors leave a trade website without calling or filling ... Read more - [Claude Code Expert London](https://green-box.co.uk/claude-code-expert-london/): Looking for a Claude Code expert in London to bring your web or software idea to life? I specialise in building fast, functional, and scalable MVP web apps and modern websites that help businesses validate ideas, attract users, and grow. Why Work With Me? Services My Approach This ensures you save time, reduce costs, and launch with confidence. Who I Work With Why Claude Code? Claude is a cutting-edge AI that accelerates development and improves code quality. By combining AI-powered coding with my experience, I deliver faster turnaround times without compromising reliability. Let’s Build Your MVP Ready to launch your ... Read more - [WordPress Gutenberg Development Expert – London, UK](https://green-box.co.uk/wordpress-gutenberg-development-expert-london-uk/): Custom Block Development | Full-Site Editing | WordPress Block Themes Are you looking for a WordPress Gutenberg expert in London, UK to bring your site into the modern era of block-based editing? I specialise in custom Gutenberg development, helping businesses, agencies, and entrepreneurs create fast, flexible, and fully editable WordPress websites using the latest block editor technologies. Whether you’re building a new site from scratch or need help extending your existing setup with custom blocks, block themes, or FSE (Full-Site Editing) capabilities, I can help. Why Work With a Gutenberg Developer? Gutenberg (also known as the WordPress Block Editor) is ... Read more - [I'm no longer taking on freelance work](https://green-box.co.uk/im-no-longer-taking-on-freelance-work/): This is my own freelance site. - [Build Powerful Directory Websites with WordPress – Custom Development for Your Niche](https://green-box.co.uk/build-powerful-directory-websites-with-wordpress-custom-development-for-your-niche/): Are you looking to launch a professional, scalable, and fully-customizable directory website? Whether you want to create a local business listing site, a real estate directory, a job board, or a niche-specific marketplace – I specialize in building custom WordPress directory websites tailored to your unique goals. As a WordPress developer with years of experience, I help entrepreneurs, agencies, and startups bring their directory ideas to life with responsive, SEO-optimized, and user-friendly solutions. Why Choose a Directory Website? Directory websites have become one of the most effective online business models. They offer recurring income, attract high volumes of traffic, and ... Read more - [Improve Onsite SEO and Technical SEO to Rank Higher](https://green-box.co.uk/improve-onsite-seo-and-technical-seo-to-rank-higher/): Boost Your Search Rankings with Onsite SEO Optimisation In today’s competitive digital landscape, appearing at the top of search engine results is crucial for driving traffic to your website. Onsite SEO, also known as on-page SEO, refers to the techniques used to optimise individual pages of your website to improve their visibility and ranking in search engines like Google. As a freelance WordPress developer in London, I offer professional onsite SEO services designed to help your website rank higher, attract more organic traffic, and ultimately grow your business. Whether you’re looking to optimise an existing website or launch a new ... Read more - [Speed up a WordPress Website to Improve Google PageSpeed Insights](https://green-box.co.uk/speed-up-a-wordpress-website-to-improve-google-pagespeed-insights/): Why Speed Matters for Your WordPress Website In today’s fast-paced digital world, website speed is a crucial factor in determining user experience and SEO performance. Slow-loading websites frustrate visitors, leading to higher bounce rates and reduced engagement. Additionally, search engines like Google prioritise fast websites, meaning a sluggish site can hurt your search rankings. Improving your website’s loading speed can directly impact your Google PageSpeed Insights score and your overall SEO performance. As a freelance WordPress developer in London, I specialise in optimising WordPress websites for speed and performance. Let me help you boost your website’s speed, enhance user experience, ... Read more - [Stripe Payment Gateway Integration for E-Commerce](https://green-box.co.uk/stripe-payment-gateway-integration-for-e-commerce/): Looking to enhance the payment process on your e-commerce website? As a freelance web developer, I offer a Stripe payment gateway integration service to provide your online store with a secure, efficient, and seamless payment solution. Stripe is one of the most popular choices for businesses of all sizes, known for its reliability, ease of use, and extensive functionality. Why Choose Stripe for Your E-Commerce Business? Stripe is a powerful and flexible payment gateway trusted by millions of businesses worldwide. It supports a wide range of payment methods, including credit and debit cards, digital wallets (such as Apple Pay and ... Read more - [Welcome to Your Expert Freelance WordPress Developer in London](https://green-box.co.uk/welcome-to-your-expert-freelance-wordpress-developer-in-london/): ** 2024/25 – not taking on work ** Are you looking for a professional and reliable freelance WordPress developer in London? You’ve come to the right place! With years of experience in designing and developing WordPress websites, I specialise in creating custom, high-performing websites that not only look great but also drive business growth. As a dedicated freelance WordPress developer based in London, I offer a full range of services tailored to your unique needs. From custom WordPress theme development to plugin customisation and website optimisation, I provide everything you need to build a powerful online presence. My goal is ... Read more - [London based Freelance Wordpress Developer (expert in booking systems)](https://green-box.co.uk/london-based-freelance-wordpress-developer/): Custom Booking and Scheduling Systems for Small Businesses Are you a small business owner looking to streamline your operations and enhance customer satisfaction? Look no further! As a freelance web developer specialising in creating and customising booking and scheduling systems, I am here to provide you with the tools you need to grow your business. In today’s fast-paced world, efficient and reliable booking systems are crucial for businesses of all sizes. Whether you run a Salon, Spa, Clothes Laundry service, or any other type of small business, a well-designed booking and scheduling system can make all the difference. By automating ... Read more - [Wordpress Booking forms and Booking systems expert](https://green-box.co.uk/wordpress-booking-forms-and-booking-systems-expert/): Transform Your Booking Experience with Expert WordPress Solutions Welcome to your premier destination for bespoke WordPress booking system solutions. As a seasoned WordPress expert with a specialisation in booking systems, I am dedicated to transforming the way your business manages appointments, reservations, and schedules. Whether you run a hotel, a spa, a fitness center, laundry, care home, or any service-based business, I can tailor a booking system that fits your unique needs perfectly. Why Choose a Custom WordPress Booking System? A robust booking system is the backbone of any service-oriented business. I can tailor off-the-shelf solutions integrate with your existing ... Read more - [WP Homecare Scheduling and Management: The plugin Revolutionising Home Care and Domiciliary Services](https://green-box.co.uk/wp-homecare-scheduling-and-management-the-plugin-revolutionising-home-care-and-domiciliary-services/): Are you managing a home care agency and looking to streamline your operations while enhancing the quality of care for your clients? Look no further. Introducing WP Homecare Scheduling and Management, a comprehensive WordPress plugin designed specifically for companies providing home care and domiciliary care services for the elderly. Our software brings together cutting-edge technology and user-friendly design to offer an unparalleled solution for your care home agency. Transform Your Care Services with WP Homecare Scheduling and Management WP Homecare Scheduling and Management is packed with features that simplify the management of home care services, ensuring efficiency, transparency, and peace ... Read more - [Password Reset](https://green-box.co.uk/password-reset/): [ultimatemember_password] - [Account](https://green-box.co.uk/account/): [ultimatemember_account] - [Logout](https://green-box.co.uk/logout/) - [Members](https://green-box.co.uk/members/): [ultimatemember form_id=”5928″] - [Register](https://green-box.co.uk/register/): [ultimatemember form_id=”5925″] - [Login](https://green-box.co.uk/login/): [ultimatemember form_id=”5926″] - [User](https://green-box.co.uk/user/): [ultimatemember form_id=”5927″] - [Freelance Raspberry Pi Developer in London, UK](https://green-box.co.uk/freelance-raspberry-pi-developer-in-london-uk/): Are you looking to harness the power of Raspberry Pi for your next project? Look no further – I’m your dedicated Raspberry Pi Developer based in the heart of London, ready to bring your ideas to life. Why Choose a Freelance Raspberry Pi Developer? In a world driven by innovation and customisation, having a freelance Raspberry Pi Developer on board can make all the difference. As a London-based freelancer, I understand the unique needs of businesses and individuals seeking tailored solutions. Raspberry Pi is a versatile and cost-effective platform, and I am here to leverage its capabilities for your specific ... Read more - [Multi Missing words test](https://green-box.co.uk/multi-missing-words-test/) - [Sound only](https://green-box.co.uk/sound-only/) - [Person and family](https://green-box.co.uk/person-and-family/) - [Person and interests](https://green-box.co.uk/person-and-interests/) - [Clocks and time](https://green-box.co.uk/clocks-and-time/) - [Countries and flags](https://green-box.co.uk/countries-and-flags/) - [Verb conjugation](https://green-box.co.uk/verb-conjugation/) - [Spanish Quizzes](https://green-box.co.uk/learn-spanish-quiz/): click the links to see the quizzes verb conjugation countries and flags clocks and time person and interests person and family sound only update 2023: if you like the quizzes checkout my new website Lingo Quiz for learning languages - [Git snippets](https://green-box.co.uk/git-snippets/): Diff changes to 1 file between 2 commits git diff [EARLIER COMMIT] [LATER COMMIT] — [FILE] e.g. git diff 5a19107 HEAD  — ./js/quiz/events.js   Diff all changes between 2 commits git diff 5a19107 7u7867iop     file name only      git diff –name-only 5a19107 7u7867iop Log – see commits between certain dates git log –since “DEC 21 2021” –until “JAN 30 2022” –oneline - [Flashcards](https://green-box.co.uk/wordpress-flashcard-plugin/): my Flashcards demo / prototype   [greenbox_flashcards] - [Who or What am I game](https://green-box.co.uk/wordpress-who-am-i-plugin/): [greenbox_whoami] - [Wordpress Quiz plugin with gamification](https://green-box.co.uk/wordpress-quiz-plugin/): This is a prototype of my WordPress Quiz plugin. With the following features: choose the missing word, select the right answer, and image and question.  The new version currently only on my hard drive is looking good and I hope to release it to the plugin directory soon. It will include integrated flash cards, I also intend to add many gamification features and integration with gamipress (although that will probably come at a later date in a later release). Another feature I will add is learning resources so quiz questions can be used as learning resources individually using a shortcode ... Read more - [Handy Wordpress quick bits](https://green-box.co.uk/handy-wordpress-quick-bits/): print which template is being used global $template; print_r( $template );   remember you might need to hook it something like: add_action(‘wp_footer’, ‘stick_in_function_for_above’) https://mekshq.com/which-wordpress-template-file-used/   Buddypress Template Hierachy   https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/ - [Useful Javascript snippets](https://green-box.co.uk/useful-javascript-snippets/): Test if an element exists before using it var someEle = document.querySelector("#some_id"); if(typeof (someEle) != "undefined" && someEle != null){ } Vanilla JS equivalent to jQuery.ready() // vanilla js equivalent of jquery.ready document.addEventListener("DOMContentLoaded", function() { // do stuff on page load });   Quickly Enable/Disable Javascript (Chrome) open developer tools Cmd + Shift + p type: javascript click enable / disable Javascript (writable) Global var   (writable) Global var (hack) in ES6 accessible from any file https://stackoverflow.com/questions/33875322/javascript-and-es6-global-variables An important note on Javascript modules and scope module features are imported into the scope of a single script — they aren’t available ... Read more - [Reflective Verbs](https://green-box.co.uk/reflective-verbs/): Good video (makes you think) another one and another one - [Useful Unix / Mac / Docker Commands](https://green-box.co.uk/unix/): See which version of unix we’re on (useful inside a Docker container) cat /etc/os-release get approx. size of a dir ( and everything in it) du -sh [DIRNAME] eg du -sh ./wherelara/ See what ports are open sudo lsof -i -P -n | grep LISTEN Kill all docker containers docker container kill $(docker ps -q) Show all files that contain certain text (in their body, not the filename) grep ‘Math.PI’ ./* -Rl this searches for the txt ‘Math.PI’ in all files in this directory (and any child directories), print only the filename (and path) on match -R recursive -l show ... Read more - [Countries and Nationalities](https://green-box.co.uk/spanish/countries-and-nationalities/): Countries and Nationalities – and some explanation ( all in Spanish – good ) Nationalities 1 quick Nationalities 2 quick - [Numbers and Dates (inc days and months)](https://green-box.co.uk/spanish/numbers-and-dates/): My Numbers Games   Mi cumpleaños es el 25 de mayo de 1978 Camino a Catford el 28 de septiembre de 2021 Comí en mi cocina el 27 de septiembre de 2021 La clase es el martes Month names rule January (Enero) to Agusto  – ends in ‘o’ except Abril Sept to Dec – ends in ‘bre’   Days of Week and Months of Year (start of video ) - [Rooms of the House](https://green-box.co.uk/rooms-of-the-house/):   Rooms of house - [Professions](https://green-box.co.uk/spanish/professions/) - [Verbs and Pronouns](https://green-box.co.uk/verbs-and-pronouns/): Personal Pronouns and Regular verbs http://Verbs – google sheet Yo, Tu, Ella, Nosotros etc… Comer (verb to Eat) Como patatas fritas ( I eat chips ) Comes ( You eat chips )   Querer ( to want – good ) - [Spanish Aphabet](https://green-box.co.uk/spanish-aphabet/): alphabet     - [Personal Questions](https://green-box.co.uk/spanish/spanish-personal-questions/) - [Concurrency](https://green-box.co.uk/concurrency/): Runnable Take no value Returns no value Runnable run = () -> System.out.println(“hello”); // compiles Runnable runBad = () -> “hello”; // doesn’t compile (as returns value) Remember often classes will implement directly (handy to use constructor to pass values). Pass a runnable to a Thread (and start it), to get thread functionality.  Calling run() method on Runnable alone, doesn’t give Thread functionality p846   ExecutorService.execute(runnable) same as using passing a runnable to a thread ExecutorService.submit(runnable / callable) like execute but abit better returns a Future object (and can also take a Callable )   - [Files OCP](https://green-box.co.uk/files-ocp/): java.nio.file.Paths Most methods. dont throw exceptions java.nio.file.Files Many methods that change things throw the checked IOExceptions. But Files.exists() does not (as must return boolean). java.nio.file.Path Path instances are immutable ( like strings ) pathinstance.relativize(otherpath) how to get from one place to another (both must be relative or both absolute else Exception ) https://www.youtube.com/watch?v=Mnvaqsz4Tts normalize() remove redundant parts of a path Path p = Path.of("/temp/../temp/another_dir/inside_another"); Path pAfter = p.normalize(); /* pAfter is /temp/another_dir/inside_another */   subpath(indexFrom, indexTo)    excellent (from is inclusive , to is exclusive ) https://www.youtube.com/watch?v=lkLEJHTsApQ   - [Random (Date Format etc)](https://green-box.co.uk/random-date-format-etc/): see (letter codes): https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html m = minute M = month eg 9 or 12 etc MM = 09, 10 ,01 MMM = jan, feb … MMMM = January , April … e.g. var formatter = DateTimeFormatter.ofPattern(“d MMMM y”); Would result in format like so: 31 August 2021 (note y defaults to 4y , d to 1 or 2 )   StringBuilder review append ( it adds to end ) return new StringBuilder(fullPhoneNumber).append(“xxxx”, 8, 12).toString(); substring() is only method that returns a String   Remember static method of Interface interface Pow{     static void wow(){         System.out.println("In Pow.wow");         } }   can only ... Read more - [Serialization OCP](https://green-box.co.uk/serialization-ocp/): When deserializing (loading object): Class must implement Serializable Constructors don’t run Instance inits don’t run But parent constructors and inits run (of a first class in parent hierarchy that doesn’t implement Serializable ) - [Functional Programming (OCP)](https://green-box.co.uk/functional-programming-ocp/): Optional is a return type Good Video on Collectors   Remember  Stream lazy evaluated (p718 cats)   - [Ocp Exceptions](https://green-box.co.uk/ocp-exceptions/): try with resources (don’t need catch or finally, as implicit finally) try(openResource file){} try (normal) MUST have a catch or a finally try{} A Catch can’t ever be empty e.g. catch(SomeException e){} catch {}   Hierarchy (this is not all the exceptions, just a subset to visualise ) All Exceptions that inherit from Exception (but don’t inherit from RuntimeException), are checked Exceptions. Inheritance Related Exceptions – careful ! // does NOT compile ( IOException catches all FileNotFoundException exceptions ) // unreachable code // FileNotFoundException is-a IOException try { throw new FileNotFoundException(); } catch(IOException io) {} catch(FileNotFoundException fn) {} // compiles(more ... Read more - [Collections](https://green-box.co.uk/ocp-collections/): Things to remember about collections: Deque interface ( implementations LinkedList and any Deque e.g. ArrayDeque ) my code see CollectionsPlay.deQueAsStack() , deQueAsQueue() Stack methods of Deque: push(E) pop(E) peek() // common to Stack and Queue (peek at head of stack or head of Queue ( both are the same ) )   HEAD of stack = top of stack (element at top of stack) e.g. for this stack [8,6,4,2] 8 = last onto the stack (top) 8 = HEAD   HEAD of queue = the first element in the Queue for this Queue (where 8 was added first into the ... Read more - [ocp Annotations](https://green-box.co.uk/ocp-annotations/): Good brief notes on: http://tutorials.jenkov.com/java/annotations.html youtube vid, create your own annotations ( at end of link above is also very good )   2. Also this is how you actually define your own annotation (below): @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) public @interface NonNull{ }   - [ocp modules](https://green-box.co.uk/ocp-modules/): Look for circular dependency on modules (each requiring the other), it won’t compile module a{ requires b } module b{ requires a }   All the code for the Modules (chapt 11) – important https://github.com/boyarsky/sybex-1Z0-815-chapter-11 See also [MY PATH]/docker_projects/ocp_modules_scotts_fullyworking   Know the syntax of the cmd line commands  End of chapter 11 ( last few pages , run them in the dir above ) jdeps , jar , java , javac etc Qs won’t really be on the output, but having used a few of them will help I think   - [ocp run thru](https://green-box.co.uk/ocp-run-thru/): unary operator ( –num etc ) private static void postPreEntuware() { int x1 = -1; //System.out.println("initially x1 = "+x1); int x2 = x1--; //System.out.println("now (x1--) x1 = "+x1); int x3 = ++x2; if(x2 > x3) { --x3; } else { x1++; --x3; } int answer = x1 + x2 + x3; System.out.println("answer = "+answer); }   Loops remember the 3rd operand is like last line of the loop ( e.g.  for(int i=0; i<10; ++i ) so i++ , ++i make no difference in this case as the loop is effectively: for(int i=0; i<10; ++i ){ do something ... ++i; } v. important – ... Read more - [Freemarker Cheatsheet](https://green-box.co.uk/freemarker/): <#– <#assign keys = number_scales?keys> <#list keys as key> <div style=”flex:1; “>  <div <#if number_scales[key]?string(‘yes‘, ‘no‘) == “yes“> style=”background-color: lightGreen;” </#if> > ${key} </div> </div> </#list> –> - [practice for ocp](https://green-box.co.uk/ocp/): Important: review code written in Eclipse (ocp package) Collections Generics Modules Various Code (very important to step through loops , –count etc… ) Annotations Exceptions Functional Programming Serialization Random (Date Formats etc ) Files Concurrency Enums An enum is allowed to implement interfaces Enum constants must be declared first (non-blank) line e.g. DOG, CAT, FISH; see my class EnumsPractice (eclipse) enum Title { MR("Mr."), MS1("Ms."), MS2("Ms."); private String title; private Title(String s){ title = s; } } public class TestClass{ public static void main(String[] args) { var ts = new TreeSet<Title>(); ts.add(Title.MS2); ts.add(Title.MR); ts.add(Title.MS1); for(Title t : ts){ System.out.println(t); } ... Read more - [consts](https://green-box.co.uk/consts/): LOUIS_REFACTOR to be refactored , search for string:   LOUIS_CAN_REMOVE code marked with this can be removed as it is duplicate ( but need to check the place where code to be removed can see the other code ). i.e. remove and test if I need todo anything   LOUIS_READY_FOR_REMOVAL can be removed (wont affect anything)   LOUIS_TEST_AFTER_REFACTOR handy for marking lines etc that could case an issue   - [Spanish](https://green-box.co.uk/spanish/): Personal Questions Spanish Aphabet Verbs and Pronouns Reflective Verbs Professions Rooms of the House Numbers and Dates Countries and Nationalities Todo practice spelling different words practice phone numbers spanish Dict I like the look of this: https://www.spanishdict.com/conjugate/ver?langFrom=es   https://www.123teachme.com/learn_spanish/translation_exercises_index https://www.123teachme.com/spanish_search/spanish_sentence_translation_practice   - [Freelance Kotlin Developer London](https://green-box.co.uk/freelance-kotlin-developer-london/): hi there ! I’m an experienced Java Developer and Web Developer. Although I’ve worked in many different programming languages over the years. Currently I’m learning Kotlin, as it seems to be a great language for increasing developer productivity. I created this landing page for curiosity to see how many people are searching for a Kotlin Developer in or around London. I’d love to hear your thoughts on Kotlin or Scala or indeed anything JVM related ! Please find free to leave a comment. I’d especially love to hear any thoughts on the future of Java, will it continue to dominate ... Read more - [Freelance AWS Consultant London](https://green-box.co.uk/freelance-aws-consultant-london/): I’m an expert in many areas of AWS (Amazon Web Services), and can help with your setups, configurations and so on. I’m also a Software Developer so my main focus with AWS is Web Server setups ( for example setup and configuration of EC2 servers ). But also comfortable with other Server services Amazon offers such as Elastic Beanstalk, AWS Lambda. Also I love building CI/CD piplelines ! ( CI/CD means Continuous Integration / Continuous Delivery , which basically means automating your deployment process, the ultimate goal being, when your developers checkin out to your repo it automatically goes onto ... Read more - [Freelance Software Developer London, UK](https://green-box.co.uk/freelance-software-developer-london-uk/): Do you need some bespoke Software developed ? Well you’ve come to the right place. I’m a freelance software developer based in London, UK.   I can help with Software projects, especially web based software. I’ve been coding 20 years and have worked on lots of different projects large and small (solo , in a team, leading a team over the years). Here are some of my skills: PHP Java Javascript (including React ) SQL HTML / CSS WordPress Laravel Have a look at some of my previous projects ( view some of my custom development work ). I’m an expert ... Read more - [Drupal - Web Development Company in London](https://green-box.co.uk/drupal-web-development-company-london/):   Do you need a web development company with the skills and experience in using Drupal?  This powerful website development platform is a great tool because of its great interface and its highly customizable functionality. It is also a very powerful content management system and a great website development platform when utilized well. Our team is highly skilled at Drupal and can help you with your website development needs. We are experienced in using this platform and maximizing its potential for our clients. You are important to us, so our process requires your input and insight every step of the ... Read more - [API Integration - Web Development Company in London](https://green-box.co.uk/api-integration-user-centric-web-development-company-london/):   Do you need to improve your website by adding in more useful information from other 3rd party sites?  Need to include a map onto your contact page?  We at Green Box are experts in API integration.  We can help you seamlessly include important and relevant data from other API’s into your site. Our team can help improve your website by API integration, making the user experience for your clients better since all the information they need is available to them. We can help you make sure that any API integrations will look great and will seamlessly match the look ... Read more - [Progressive Web Apps - Freelance Web Developer in London](https://green-box.co.uk/progressive-web-apps-web-development-company-london/):   When you need your business to have a great looking website with mobile-like features and the functionality of a mobile app, Progressive Web Apps are the way to go. These have the advantage of having the ease of use of mobile applications without too much strain on the memory. I have the expertise to help you with Progressive Web Apps.  I can help you from the very beginning up to supporting your company in keeping the PWA updated and always working at its best. As with any project, I want to know exactly what you need. I start with ... Read more - [Freelance Elasticsearch -Developer in London](https://green-box.co.uk/elasticsearch-web-development-company-london/):   When you are dealing with a lot of data for your business website, it helps when your data is kept well and within easy access. Elasticsearch is a great tool to handle your data and implement searches, analyze big volumes of data and manage all this in near-real-time. We, at Green Box, can help you with this as we are experts in Elasticsearch. I have extensive knowledge and experience in using this tool to help your business grow. A Discovery session with you the client is necessary, so we are always on the same page. This involves sitting down ... Read more - [Freelance Wordpress Developer London](https://green-box.co.uk/freelance-wordpress-developer-london/): Hi there, I’m Louis an experienced freelancer based in Bromley, South London. I love helping companies get the most from their website / web application or developing completely new websites. I also develop digital products and MVPs using WordPress or Laravel. I work mainly with UK clients. I provide the full range of WordPress web development services including: Website Development Plugin Development Theme Development Website Maintenance I’m an expert in full stack web development using a range of technologies such as HTML, CSS, Javascript, PHP, Databases and SQL. Having worked in web development for over 15 years I’m very knowledgeable ... Read more - [How to make a great Charity website](https://green-box.co.uk/how-to-make-a-great-charity-website/):   In this article I’m going to talk about how to create a great charity website for your users (I’m going to focus on user engagement). I’ll start with goals and knowing your audience ( supporters and service users ) and then talk in more depth about what large charities, that spend alot of time on digital are doing. I’ll discuss important areas such as page header and footer and the homepage. Finally I’ll talk about other things you can do on your website to engage your users. This article is aimed at charities that want to get more out ... Read more - [Digital Product Design and Development Agency in London](https://green-box.co.uk/digital-product-design-and-development-agency-in-london/): We love making things here at Green Box – The Digital product development people in London. If your looking to develop a digital product or a Digital Service, why not come and have a chat to us to see if we can help. We build in an agile, user centric fashion. Typically we work along these lines Research Design Build Test Iterate as required Research your Digital Product or Digital Service Maybe you’ve done this already, if not it’s important to look at the use cases for your Digital Product or Service and who will use it. This minimises the ... Read more - [Website Maintenance Packages](https://green-box.co.uk/website-maintenance-packages/):   [table id=2 /] - [Freelance React Developer London](https://green-box.co.uk/freelance-react-developer-london/): I’m a London based developer skilled in Javascript and the great React framework. I’m a front and backend developer (i.e. a Full stack developer ). I’ve been a working as a developer for 17 years, in that time I’ve worked in a number of different technologies but all of them with a focus on website and web application development. For the past 2 years I’ve been working with React (but I’ve been programming in Javascript for 17 years). If your looking to develop a SPA (Single Page Application) in React, I can help. If you want to back that with ... Read more - [hubspot gdpr form](https://green-box.co.uk/hubspot-gdpr-form/) - [hubspot test](https://green-box.co.uk/hubspot-test/): you fat pleb - [Charity Web Design](https://green-box.co.uk/charity-web-design/): We are specialists in helping Charities, Not for Profits, NGOs and Social Enterprises get the most from the Web. We design and build custom websites and web applications. Would you like a free website audit of your charities website (we’ll look at your website and give you a report of what you could be doing better). We understand the needs of charities and their digital presence, such as: Communicating the Charities mission and message Engaging Supporters such as Donors and Volunteers Making information easy to find for Service Users A good way of engaging users of your website is by ... Read more - [Free Website Audit (for Charities only)](https://green-box.co.uk/free-website-audit-charities/): I will look at your website from a number of angles, both technical and user centric. I’ll send you a report on these, that will help you improve your website ( engage users both service users and supporters and help increase donations ).       - [I'm no longer taking on freelance work](https://green-box.co.uk/): I’m a highly experienced Full stack web / software developer , with many years experience working in a variety of programming languages, databases and tools. I can develop custom / bespoke software or use existing off the shelf solutions and customise them, we will use the right tool for the job and not reinvent the wheel. I’m an expert in designing and building web applications in an agile, user centric fashion. From research and discovery to wire frames and building prototypes and final versions. As a full stack developer, I can handle all the front end development (html, css, javascript) ... Read more - [Freelance Wordpress Developer in London](https://green-box.co.uk/home-landing-page-greenbox/): I’m Louis a web and software developer. My favourite quote of all time: Premature optimization is the root of all evil ― Donald Knuth My WordPress Quiz Plugin for learning languages with gamification features: Quiz Plugin for Learning languages I work mainly in the following: Java – check out my side project in Spring Boot on Docker on AWS EC2 instance PHP Javascript SQL HTML CSS Unix I’ve also worked in many of the related techs ( eg AWS, Docker, Vue, Laravel, Spring, Struts, WordPress … to name but a few ) I also love working with the Raspberry Pi ... Read more - [Kookeli - online store](https://green-box.co.uk/kookeli-online-store/): This is an ecommerce website for Kookeli a Craft supplies company based London, UK. The website has a custom theme with branding, and many bespoke features (especially in the admin section, to facilitate easy order pickering etc). Kookeli a company with successful Ebay and Etsy stores, needed to develop their own online store to compliment their existing sales channels. Bespoke theme WordPress / Woocommerce (Ecommerce Online Store) Custom elements such as Tutorials section Custom programmed features Ongoing maintenance and development Consultancy on ongoing digital marketing   Outcome Kookeli are becoming one of the top online stores for the retail of ... Read more - [Weebox - Woocommerce](https://green-box.co.uk/weebox-woocommerce/): Weebox a company selling subscription boxes of Scottish products approached us to take over the ongoing maintenance and development of their website. They required the following New Worldpay online payment gateway Amend Subscriptions Ongoing maintenance and development Outcome The business is growing, and owners are happy they have a technical team behind them to help in all technical aspects. Visit Weebox, click here - [Nutri-Bombz - custom Woocommerce Subscriptions website](https://green-box.co.uk/nutri-bombz-custom-woocommerce-subscriptions-website/): Nutri-Bombz came to us as they wanted to redevelop their Health Foods subscription box website on the WordPress / Woocommerce platform. WordPress / Woocommerce (Ecommerce Store) Subscriptions Migration of customers and subscriptions from Legacy system Custom programming Integration with factory packing machine Ongoing maintenance and development Ongoing SEO (Search Engine Optimisation) Nutri Bombz are a company that sell healthy gluten free snacks made from natural ingredients. They do this by selling subscription boxes with a selection of their snacks. Nutri Bombz had a website already that was developed some years ago. They came to me as they wanted to refresh ... Read more - [Royal Society - Intranet custom development](https://green-box.co.uk/royal-society-intranet-custom-development/):   The Royal Society approached us to redevelop their Intranet for them, the key outcomes from the project were to be: to be more in keeping with their public facing website in terms of look and feel be able to feature company / news items ( and keep them at the top ) increase staff engagement with the intranet We met the Royal Society at their (very impressive) building just off the Mall, and talked to them about their requirements and also proposed some ideas myself at a Discovery session at the start of the project. The Existing intranet (before ... Read more - [Letu - Custom Web Application for Landlords](https://green-box.co.uk/letu-custom-web-application-landlords/):   The guys at Letu approached us to build their Website / Web Application. Letu is a tool for landlords to allow them to do a range of things, such as: Automatically list properties on Rightmove, Zoopla and Primelocation Organise Gas certificates Reference Tenants Organise Deposit registration and a range of other services We conducted a Discovery session at the start of the project to better understand the clients requirements. We also mocked up wireframes at the same time to allow us all to visualise the project, following on from this we developed a spec and build the website for ... Read more - [Royal Society Intranet Case Study](https://green-box.co.uk/royal-society-intranet-case-study/): The Royal Society approached us to redevelop their Intranet for them, the key outcomes from the project were to be: to be more in keeping with their public facing website in terms of look and feel be able to feature company / news items ( and keep them at the top ) increase staff engagement with the intranet I meet the Royal Society at their (very impressive) building just off the Mall, and talked to them about their requirements and also proposed some ideas myself at a Discovery session at the start of the project. The Existing intranet (before our ... Read more - [Freelance Laravel Developer London](https://green-box.co.uk/laravel-agency-london/): When you need to develop a website or web application, that requires alot of customisation / bespoke features, to achieve this level of customisation often alot of code needs to be written. This is where a modern web application framework is worth its weight in gold. The PHP framework Laravel is a great choice to develop custom web applications in. The main reason why: Speed of development The Laravel framework, contains many libraries and much pre-written code to help speed up development. What Laravel provides takes many months of development off a project. I’m an expert in the PHP Laravel ... Read more - [Custom Website or Web Application Development Process](https://green-box.co.uk/custom-website-web-application-development-process/): This is an outline of how we work. Deposit paid and contract signed -> Discovery -> Sitemap produced -> Signoff Wireframes produced -> Signoff High Quality Graphic Designs -> Signoff Website Development Bug Fixing, Testing and UAT (User Acceptance Testing) -> Final Signoff Website Release   - [Referral Program](https://green-box.co.uk/referral-program/): We’re often told by our customers that they are very happy with the work we’ve carried out. We love delivering great work, we’re passionate about what we do. We believe that those who refer should share in the reward of a new customer. That’s why we have a Referral Program. You can take advantage of our referral program and earn 10% commission for each referral. There is no limit to the number of referrals you can submit or the amount you can earn. How it works If anyone you know is interested in a custom web development such as Intranet development, ... Read more - [Project / Website Questionaire](https://green-box.co.uk/project-website-questionaire/) - [Intranet Website Developers, London UK](https://green-box.co.uk/intranet-website-developer-london-uk/): Internal company communications are an important function in any company, and once your organisation reaches a certain size, an Intranet can be a great way to communicate to your workforce. From employee news to information on procedures for annual leave and so on, your intranet can be a communication tool that will help your business run like a well oiled machine. We are experts in Intranet development using WordPress as the platform for development. If you are looking to develop your intranet using WordPress, we can help why not get in touch for a chat. We can help with all ... Read more - [PHP Web Application Development in London, UK](https://green-box.co.uk/web-application-developer-london-uk/): Do you want to develop a web application ? Do you have an existing application that you’d like to continue developing ? If the answer is yes, talk to us – We’re experts in Web Application Development, in software development for websites and Intranets. Whether you want complex system, a fully blown web application to fill a need or niche or take on one of the big players, or a simple web application with a few forms and a workflow tying them together. we can help. Creating Web Applications for Internet Startups Got an innovative idea or want to replicate the success of ... Read more - [Wordpress Plugin Development in London](https://green-box.co.uk/wordpress-plugin-developer-uk/): Do you want to extend the functionality of your WordPress website, using a custom developer plugin ? Do you want to customise an existing plugin ? Do you want to pull in data to your website via an API or web service ? If the answer to any of the above is yes, then we can help. We’re WordPress Plugin Developers. We have written lots of plugins for clients and customised many plugins also, to allow them to behaviour as a client as wanted. We have deep knowledge of the WordPress system and how it is structured under the hood, such ... Read more - [Wordpress Design and Development in London, UK](https://green-box.co.uk/wordpress-design-development-london/): We are 2 WordPress developers with an office in Catford, London. We work with companies from all over the world, but especially our home town of London, UK (and the surrounding counties such Middlesex, Kent, Buckinghamshire, Surrey, Essex, Berkshire and Hertfordshire). We have been developing in WordPress for many years and have built all types of websites with wordpress including ecommerce, subscriptions, membership systems to name but a few. All our websites are responsive as standard – this means that your website will look good in the different devices that people use to browse the internet these days such as ... Read more - [PHP Development company in London](https://green-box.co.uk/php-development-company-in-london/): Whatever you want to build with PHP, be it online forms, a large scale web application , a MVP (Minimum Viable Project) to test the waters, whatever your vision, we can help you make it become a reality. Our office is in Catford, London. I’m an expert in PHP and Laravel programming and Web Application Development (we have also worked with many other frameworks such as CodeIgniter and Symphony ). If your looking for a full stack developer (or a Back end developer) your in the right place. We experts in Software Development and Laravel is a great PHP framework ... Read more - [Wordpress Search Engine Optimisation company in London](https://green-box.co.uk/wordpress-search-engine-optimisation-london/): Typically if you want to seo your website you would research keywords, setup the standard tools (such as Google analytics), and then create content and build links to your website on an ongoing basis. If your looking for some of my Search Engine Optimisation packages please see here. First month Keyword research report (based on competitors and market research). Onsite SEO (titles and description ) 3 keyword phrases optimised on 1 to 3 pages Google analytics setup Google webmasters setup Subsequent months Keyword optimise 1 existing page (for E-commerce websites , we will alternatively keyword optimise 3 product pages) Create 1 ... Read more - [Agile User Centric - Full stack developer in London](https://green-box.co.uk/agile-user-centric-web-development-company-london/): I specialise in PHP and Javascript including WordPress and Laravel. Custom PHP Laravel and WordPress Development and Design and Web Application development (PHP, WordPress, Laravel, Javascript, HTML, CSS). Every client is important to me , with myself you are not a number, I build long term mutually beneficial relationships with our clients. Would you like to know about my web development working process, click here.   Some of our Clients     I can help with anything technical some examples would be Ecommerce subscription stores , Membership websites , MVPs (Minimum Viable Product) and custom/bespoke web applications of any description. ... Read more - [Ebay to Woocommerce Specialists](https://green-box.co.uk/ebay-woocommerce-specialists/): Would you like to have your own ecommerce store and be in more control of your sales and customer service ? We specialise in helping customers start to sell on their own Ecommerce platform as well as hosted solutions such as ebay and Amazon.   - [human sitemap](https://green-box.co.uk/human-sitemap/): [wp_sitemap_page] - [Ecommerce Professional £599 per month](https://green-box.co.uk/ecommerce-professional-499-per-month/): When you don’t use up the 10 hours of the retainer , I will make improvements (after discussing with you). The improvements I make are to 1. increase sales and 2. streamline processes to give you more time. So how do I do that you might ask ? Ecommerce improvements to drive sales Increase the speed of your page loads (slow loading websites = customers going to your competitors) Setup SSL (the padlock in the address bar), this gives Customers more confidence to buy from you (and also has SEO advantage) Display address and possibly Telephone number prominently on homepage Prominent email signup ... Read more - [Monthly Retainers - Web support and development](https://green-box.co.uk/monthly-website-technical-development-retainers-from-london-based-company/): Do you need to have guaranteed access to a UK based Web Development team? If the answer is yes, a retainer could be a great fit for you.  Monthly retainers are available from £599 per month All our retainers are bespoke and tailored to your companies needs. The kind of things that can be included in retainers include the following:  x number of hours per month guaranteed ( development or support, whatever you need)  Daily offsite backup (code and database)  Daily Security scans  Daily Uptime monitoring  Monthly website report ( containing details of uptime, backups and security )  Quarterly WordPress updates ... Read more - [New Ecommerce Client Questions](https://green-box.co.uk/new-ecommerce-client-questions/): Tell me abit about the Business and what products / services you sell. Do you have any USPs ? if so what are they ? Who are your customers ? Where are they located (local / national / international , or a mix of these) ? Do you know about how old they are , what are their interests ? Do you have some keywords in mind or have you done any keyword research ? Can you give me some examples of Websites you might like to draw inspiration from ? Can you give me 3 of your competitors websites ... Read more [comment]: # (Generated by Hostinger Tools Plugin)