Skip to content

Instantly share code, notes, and snippets.

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

Anthony Addae maaddae

🏠
Working from home
  • Remote
  • 11:48 (UTC)
View GitHub Profile
@maaddae
maaddae / index.php
Created May 28, 2017 01:02 — forked from drizzentic/index.php
Sample USSD Application
<!-- MIT License
Copyright (c) 2016 Derrick Rono
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@maaddae
maaddae / README-Template.md
Created August 22, 2018 06:36 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@maaddae
maaddae / wordpress_backup.py
Created August 24, 2018 08:47
A simple backup python script.
#!/usr/bin/env python
"""
Title: WordPress backup script
"""
import sys,os,statvfs
import tarfile
import time
# --- Variables --- #
backup_path = '/home/eklhenam/backup'
source_directorie = '/var/www/html/my-site-name'
@maaddae
maaddae / validate_form.js
Created August 24, 2018 09:02
An asynchronous validation of registration form using jquery-validate plugin.
var searchVisible = 0;
var transparent = true;
var mobile_device = false;
$(document).ready(function(){
$.material.init();
/* Activate the tooltips */
//$('[rel="tooltip"]').tooltip();
@maaddae
maaddae / send_file.php
Created August 24, 2018 09:14
PHP post using the curl
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
ini_set('display_errors',true);
ini_set('display_startup_errors',true);
$target_url = 'http://my-other-domain/phpspreadsheet/receive.php';
$return_url = 'http://127.0.0.1/webfiles/phpspreadsheet/receive.php';
@maaddae
maaddae / receive_file.php
Created August 24, 2018 09:18
PHP receive post from curl example.
<?php
//include the file that loads the PhpSpreadsheet classes
require 'spreadsheet/vendor/autoload.php';
$secret_key = 'ddf9dcbb413630dd650a9615c921b12d1dbe3e203b8f5d4d08bef5e47cd88979';
$uploaddir = realpath('./') . '/';
$uploadfile = $uploaddir . basename($_FILES['phyle']['name']);
$filename = $_POST['prefix'].".csv";
$key = $_POST['key'];
@maaddae
maaddae / phonenumbers.php
Last active July 29, 2022 13:21
Simple-Ghana-Phonenumber-Regex
<?php
// Regex quick reference
/*******************************************************************************
[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
@maaddae
maaddae / .gitconfig
Created October 24, 2018 10:10 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
dmerged = "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
st = status
@maaddae
maaddae / get-excerpt.php
Created October 27, 2018 00:14 — forked from timneutkens/get-excerpt.php
Get excerpt of string
<?php
/**
* Small utility function to get an excerpt. Standard length is 100 characters
*
* @param $string
* @param int $start_postion
* @param int $max_length
*
* @return string
*/
@maaddae
maaddae / deploy-django.md
Created June 19, 2022 09:43 — forked from rmiyazaki6499/deploy-django.md
Deploying a Production ready Django app on AWS

Deploying a Production ready Django app on AWS

In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
  • Continuous deployment with Github Actions/SSM Agent