Skip to content

Instantly share code, notes, and snippets.

View samalapsy's full-sized avatar
🏠
Working from home

Oluwatimilehin Samuel Alapakristi samalapsy

🏠
Working from home
View GitHub Profile
@samalapsy
samalapsy / functions.php
Created February 2, 2022 15:16 — forked from cliffordp/functions.php
The Events Calendar: Remove the Organizers post type from Events
<?php
/**
* The Events Calendar: Remove the Organizers post type from Events.
*
* Replace instances of ORGANIZER_POST_TYPE with VENUE_POST_TYPE if you
* want to do so for Venues instead.
*
* @link https://theeventscalendar.com/knowledgebase/linked-post-types/
* @link https://gist.github.com/a521d02facbc64ce3891c9341384cc07
@samalapsy
samalapsy / nginxproxy.md
Created September 11, 2019 16:56 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@samalapsy
samalapsy / Instructions.sh
Created July 3, 2019 14:09 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@samalapsy
samalapsy / build.sh
Created June 20, 2019 17:30
Script for building Ubuntu 16.04 server + LAMP + Redis, Memcached, Lets Encrypt, Git, Composer + Optimisations
## Builder for Ubuntu 16.04 ##
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoclean
sudo apt-get --purge autoremove
# Install dependancies
sudo apt-get install curl git unzip
@samalapsy
samalapsy / gist:7431b656cf32c85037effe1a2e36fc4a
Last active June 23, 2019 19:48
Creating a symm link of laravel storage folder in public_html on shared hosting
This is to show how to create shortcut from your laravel storage folder into your public folder. The simlest way to get this done is to write a cron job having this command
First Note that you laravel folder must be in the root path
If this main public_html is your main website folder
STEP 1
Set the cron job to run time to be * * * * *,
STEP 2
@samalapsy
samalapsy / inc_id_rules.js
Created November 21, 2016 20:50 — forked from katowulf/inc_id_rules.js
Security rules for creating an incremental, numeric ID in Firebase. See http://jsfiddle.net/firebase/xLq7grcc/
{
"rules": {
".read": true,
".write": false,
"incid": {
"counter": {
// this counter is set using a transaction and can only be incremented by 1
// the total number of records must be less than 10,000 simply for demo purposes
".write": "newData.isNumber() && ((!data.exists() && newData.val() === 1) || newData.val() === data.val()+1) && newData.val() <= 10000"
},
@samalapsy
samalapsy / 01_Laravel 5 Simple ACL manager_Readme.md
Created July 24, 2016 20:14 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php