Skip to content

Instantly share code, notes, and snippets.

View otengkwame's full-sized avatar
💭
Cooking some open source projects

Kwame Oteng Appiah-Nti otengkwame

💭
Cooking some open source projects
View GitHub Profile
<?php
function event(string $name, array $data = [],callable $action = null,int $priority = 0){
static $events = [];
if($action){
$events[$name][]=[
'priority' => $priority,
'action' => $action
];
return null;
}
@jeffreysbrother
jeffreysbrother / index.php
Last active March 11, 2020 10:22
Generators in PHP
<?php
$start_time = microtime(true);
$startMemoryUsage = memory_get_peak_usage();
/**********************************************
WITHOUT GENERATOR
**********************************************/
$array = [];
@wildshark
wildshark / index.html
Created April 3, 2019 00:16
POS Receipt Template Html Css
<div id="invoice-POS">
<center id="top">
<div class="logo"></div>
<div class="info">
<h2>SBISTechs Inc</h2>
</div><!--End Info-->
</center><!--End InvoiceTop-->
@thelevicole
thelevicole / README.md
Last active November 27, 2020 09:32
jQuery group selectors

Simple jQuery solution for grouping multiple selectors

Issue

Sometimes I have multiple jQuery variables that I want to perform the same action on. So I find myself doing something like...

var $header = $( 'body > header' );
var $nav = $( 'body > nav.burger-menu' );
@MehulBawadia
MehulBawadia / index.html
Created January 8, 2019 12:03
Vertical Navigation in Admin Panel. Uses Tailwind CSS and jQuery
<!-- Don't forget to include the Tailwind css file -->
<div class="flex w-full">
<div class="bg-grey-darkest h-screen">
<img src="https://jeroen.github.io/erum2018/logo.png" alt="Random Logo" class="block w-16 p-2 mx-auto mb-5">
<div class="w-64 navigationMenu">
<div class="mb-5">
<div class="flex text-white">
<div class="w-12 ml-1 text-center"><i class="fas fa-tachometer-alt"></i></div>
<div class="navItem"><a href="javascript:void(0)" class="relative no-underline text-grey-light hover:text-grey-lightest hover:border-4 border-brand">Link 1</a></div>
@otengkwame
otengkwame / Email Server (Linux, Unix, Mac).md
Created September 2, 2018 20:58 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only Email Server (Linux, Unix, Mac)

Setup a Local Only Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@yidas
yidas / codeiginter-server-config.md
Last active March 1, 2024 01:30
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@gustavonecore
gustavonecore / jobs.php
Last active October 1, 2021 13:05
Codeigniter job server dispatcher
<?php
/**
* Class to handle job execution
*/
class Jobs extends Onecore_Controller
{
const STATUS_DONE = 'done';
const STATUS_QUEUED = 'queued';
const STATUS_RUNNING = 'running';
@ashokmhrj
ashokmhrj / MY_Router.php
Last active April 29, 2021 19:21
HMVC Router for handling moduler routing in Codeigniter 3.x
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
/**
* Router Class
*
* Parses URIs and determines routing
*
* @package CodeIgniter
* @subpackage Libraries
* @author ashokmhrj
@ngugijames
ngugijames / officetophp.php
Created January 11, 2016 10:42
DOC, DOCX, PPT, XLSX to TXT in PHP
/*determine th file extension
$file_name = $_FILES['image']['name'];
$file_extn = end(explode(".", strtolower($_FILES['image']['name'])));
if($file_extn == "doc" || $file_extn == "docx"){
}elseif($file_extn == "rtf"){
}
*/