Skip to content

Instantly share code, notes, and snippets.

View evansmwendwa's full-sized avatar
🎵
Not stopping

Evans Mwendwa evansmwendwa

🎵
Not stopping
View GitHub Profile

Setup PHP for Local and Production (Ubuntu 20.04 LTS)

Add PHP PPA Repository

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
#!/bin/bash
# A bash script to remove old versions of a Google App Engine instance.
#
# Inspiration of script taken from:
# https://almcc.me/blog/2017/05/04/removing-older-versions-on-google-app-engine/
# Original code by Alastair McClelland and Marty Číž.
# Assembled and modified by Johan Niklasson.
#
# To run this script, execute
version: "3.5"
services:
postgres:
container_name: docker-postgres
image: postgres:9.6
ports:
- "5432:5432"
environment:
POSTGRES_DB: "kong"

Creating a MySql Super user

CREATE USER 'dev'@'localhost' IDENTIFIED BY 'secret';

GRANT ALL PRIVILEGES ON *.* TO 'dev'@'localhost' WITH GRANT OPTION;

CREATE USER 'dev'@'%' IDENTIFIED BY 'secret';

GRANT ALL PRIVILEGES ON *.* TO 'dev'@'%' WITH GRANT OPTION;

Setting up Localhost Nginx Reverse Proxy to react app

This helps you develop react apps through a sub domain secured by ssl through nginx without much hassle. Current config from Laragon on Windows

server {
    listen 80;
    listen 443 ssl;

Wanted to report back on some research and success enabling middle click action.

deepin doesn’t use libinput-gestures nor gesture-manager, although this is probably the correct answer on vanilla arch.

Deepin uses a built in touchpad solution controlled by dde-daemon. All touchpad gestures are controlled by the file /usr/share/dde-daemon/gesture.json. To enable middle click via 3-finger tap, add the following entry in the json array:

   {
        "Name": "tap",
        "Direction": "none",
 "Fingers": 3,
{"lastUpload":"2019-12-18T16:34:36.775Z","extensionVersion":"v3.4.3"}

Docker installation on Ubuntu

Uninstall old versions

sudo apt-get remove docker docker-engine docker.io

Update the apt package index:

sudo apt-get update
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/afriscout.ihub.co.ke/before/*;
server {
listen 80;
listen [::]:80;
server_name afriscout.ihub.co.ke;
return 301 https://$host$request_uri;
}