Skip to content

Instantly share code, notes, and snippets.

View i-amolo's full-sized avatar

Innocent J. Blacius i-amolo

View GitHub Profile
@i-amolo
i-amolo / inTheLifeMediaSearch.php
Created October 25, 2022 10:56 — forked from johnschimmel/inTheLifeMediaSearch.php
PHP SOAP request using CURL to retrieve In The Life Station listings
<?php
function getListingsViaSoap($zipcode) {
$url = "http://www.tracmedia.com/lol/LOLService.asmx";
$soap_request = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<InTheLife xmlns="http://tracmedia.org/">
@i-amolo
i-amolo / Revealing-Module-Pattern.md
Created October 21, 2022 20:40 — forked from zcaceres/Revealing-Module-Pattern.md
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

What else can you do?
How to clone repository to a specific commit? (full clone)
# Create empty repository to store your content
git clone <url>
git reset <sha-1> --hard
More info:
How to clone single branch?
@i-amolo
i-amolo / #1_PostController.php
Created October 18, 2022 06:50 — forked from Naskalin/#1_PostController.php
Simple Doctrine Paginator and example usage for Symfony. Простейшая постраничная навигация в Symfony.
<?php
namespace App\Controller;
use App\Utils\Paginator;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@i-amolo
i-amolo / httpd-vhosts.conf
Created March 10, 2022 17:56 — forked from daveh/httpd-vhosts.conf
How to set up a virtual host in Apache (WAMP, MAMP, XAMPP) (code to accompany https://youtu.be/kRfo5OPUC2M)
<VirtualHost *:80>
DocumentRoot "/www/project1"
ServerName site1.localhost
<Directory "/www/project1">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
@i-amolo
i-amolo / udf_FormatBytes.sql
Created November 23, 2021 17:33 — forked from jozefizso/udf_FormatBytes.sql
Convert Bytes to KB, MB, GB, TB, PB or EB and format the output to human readable format
CREATE FUNCTION [dbo].[udf_FormatBytes]
(
@InputNumber DECIMAL(38,7),
@InputUOM VARCHAR(5) = 'Bytes'
)
RETURNS VARCHAR(20)
WITH SCHEMABINDING
AS
BEGIN
-- Declare the return variable here

Reset MySQL 8.0 root Password in Windows

  1. Stop the MySQL 8.0service from services
  2. Go to path C:\Program Files\MySQL\MySQL Server 8.0\bin and open cmd
  3. Run mysqld --console --skip-grant-tables --shared-memory
  4. Open new cmd in the same path
  5. Run following commands
  6. mysql -u root
  7. select authentication_string,host from mysql.user where user='root';
  8. UPDATE mysql.user SET authentication_string='' WHERE user='root';
====== Build your own PHP on Windows ======
===== Before you Begin =====
Building PHP on Windows will require three things
- A properly set up build environment, including a compiler with the right SDK's and some binary tools used by the build system
- Prebuilt libraries and headers for third party libraries that PHP uses in the correct location
- The PHP source
===== Compiler =====

Becoming a Spring Certified Professional without the Core Spring Course

Until recently, the only way you could become a Certified Spring Professional was to take Pivotal’s compulsory, 4-day, Core Spring training course. On completion of the course, participants received an exam voucher that allowed them to schedule an exam at a certification centre.

At approximately £2.5k per attendee, the course is not cheap putting certification out of the reach of many self-funded developers and those that work for organisations without generous training budgets.

In May 2017 Pivotal changed their policy. Spring Certification Exams became available for individual purchase without enrolling in the course. I set out to see if it was possible to pass the exam without the Core Spring course and only using publically available material.

I set myself a budget of £250, ap

@i-amolo
i-amolo / aws-certification.md
Created March 18, 2021 13:25 — forked from nitinreddy3/aws-certification.md
AWS Certification guide and notes on how to prepare for the aws associate certification architect, sysops and developer exams


AWS Certification notes

Those are my personal notes on AWS Solution Architect certification preparation. Hope you find them usefull.

To pass AWS certification, you should have:

  • Sound knowledge about most of the AWS services ( EC2, VPC, RDS, Cloudfront, S3, Route53 etc,)
  • Hands on experience with AWS services.