Skip to content

Instantly share code, notes, and snippets.

View alaomichael's full-sized avatar

Michael Alao alaomichael

View GitHub Profile
@alaomichael
alaomichael / main.yaml
Created August 5, 2024 08:31 — forked from kbariotis/main.yaml
Ansible playbook for deploying a Node.js app to DigitalOcean
- name: DO
hosts: localhost
vars:
project_name: "PUT A NAME FOR YOUR PROJECT HERE"
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens"
repository: "PUT YOUR REPOSITORY URL HERE"
tasks:
- name: LOCAL | Generate SSH key
shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N ""
@alaomichael
alaomichael / countries.json
Created December 12, 2023 13:12 — forked from devhammed/countries.json
Countries with Name, Dial Code, Emoji Flag and ISO Code
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",
@alaomichael
alaomichael / nigeria-state-and-lgas.json
Created December 12, 2023 13:11 — forked from devhammed/nigeria-state-and-lgas.json
Nigeria States and LGAs in one JSON file
[
{
"state": "Adamawa",
"alias": "adamawa",
"lgas": [
"Demsa",
"Fufure",
"Ganye",
"Gayuk",
"Gombi",
@alaomichael
alaomichael / _nigerian_states.xml
Created June 16, 2022 14:31 — forked from mofesolapaul/_nigerian_states.xml
Alphabetically ordered list of Nigerian states as array values XML, ready to use as android app resource. Also contains an xml for all Nigerian local government areas
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="nigerian_states">
<item>Abia</item>
<item>Adamawa</item>
<item>Akwa Ibom</item>
<item>Anambra</item>
<item>Bauchi</item>
<item>Benue</item>
<item>Borno</item>

This took forever for me to figure out, so I'm doing you a solid to ensure you don't spend as much time as I did.

I assume you have php7.1 installed already, the only ish is the -fpm

Run sudo apt-cache search php7.1 This will show you a lot of related packages you can grab

Now run sudo apt-get install php7.1-fpm And you're saved!

@alaomichael
alaomichael / world-continents.php
Created June 16, 2022 14:29 — forked from mofesolapaul/world-continents.php
PHP array of continents in the world and their countries
<?php
$continents = [
'Africa' => array('Algeria','Angola','Benin','Botswana','Burkina Faso','Burundi','Cabo Verde','Cameroon','Central African Republic','Chad','Comoros','Democratic Republic of the Congo','Republic of the Congo','Cote d\'Ivoire','Djibouti','Egypt','Equatorial Guinea','Eritrea','Ethiopia','Gabon','Gambia','Ghana','Guinea','Guinea Bissau','Kenya','Lesotho','Liberia','Libya','Madagascar','Malawi','Mali','Mauritania','Mauritius','Morocco','Mozambique','Namibia','Niger','Nigeria','Rwanda','Sao Tome and Principe','Senegal','Seychelles','Sierra Leone','Somalia','South Africa','South Sudan','Sudan','Swaziland','Tanzania','Togo','Tunisia','Uganda','Zambia','Zimbabwe'),
'NorthAmerica' => array('Antigua and Barbuda','Bahamas','Barbados','Belize','Canada','Costa Rica','Cuba','Dominica','Dominican Republic','El Salvador','Grenada','Guatemala','Haiti','Honduras','Jamaica','Mexico','Nicaragua','Panama','Saint Kitts and Nevis','Saint Lucia','Saint Vincent and the Grenadines','Trinidad and To
@alaomichael
alaomichael / nigeria-states.json
Created June 16, 2022 14:28 — forked from mofesolapaul/nigeria-states.json
List of all Nigerian states, alphabetically arranged in JSON array
[
"Abia",
"Adamawa",
"Akwa Ibom",
"Anambra",
"Bauchi",
"Bayelsa",
"Benue",
"Borno",
"Cross River",
@alaomichael
alaomichael / nigeria-states-and-local-govts.json
Created June 16, 2022 14:27 — forked from mofesolapaul/nigeria-states-and-local-govts.json
Json array containing objects of each Nigerian state, and their local governments
[
{
"state": "Abia",
"lgas": [
"Aba North",
"Aba South",
"Arochukwu",
"Bende",
"Ikawuno",
"Ikwuano",
@alaomichael
alaomichael / pdf.coffee
Created December 23, 2021 01:19 — forked from benshimmin/pdf.coffee
How to render a web page into a multi-page PDF with html2canvas and jsPDF
# Assumptions:
# 1. $("#pdf-download") is something you can click on (not really required).
# 2. $(".result-page") is something in your existing page that you want to turn into a PDF.
# 3. You want to add a class of `pdf-rendered` to it and then specify some CSS which applies when that class is added.
# 4. Your CSS for `.pdf-rendered` specifies a useful width for a PDF (795px is pretty good) and anything else you like
# (this is for portrait ("p") PDFs; obviously you'll need to make a few modifications for landscape PDFs!).
# How it works:
# 1. Take the requested element in your existing page, clone it, add a "pdf-rendered" class to it, and append to
# the body.