Skip to content

Instantly share code, notes, and snippets.

View Mahmoud-Alaa-Eldeen's full-sized avatar

Mahmoud Alaa Eldeen Mahmoud-Alaa-Eldeen

  • Cairo, Egypt.
View GitHub Profile
@Mahmoud-Alaa-Eldeen
Mahmoud-Alaa-Eldeen / nginx-php-windows-setup.md
Created January 15, 2024 22:43 — forked from odan/nginx-php-windows-setup.md
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

@Mahmoud-Alaa-Eldeen
Mahmoud-Alaa-Eldeen / stock_move.py
Created May 19, 2021 12:15 — forked from ahmedelbougha/stock_move.py
Example of Odoo Multi-Threading - Background Process
from odoo import api, fields, models
from odoo.tools import float_is_zero
from odoo.exceptions import UserError, ValidationError
import threading
import time
import logging
class StockMove(models.Model):
_inherit = 'stock.move'
@Mahmoud-Alaa-Eldeen
Mahmoud-Alaa-Eldeen / countries.sql
Created May 8, 2019 23:15 — forked from ereli/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes. PostgreSQL compatible
CREATE SEQUENCE country_seq;
CREATE TABLE IF NOT EXISTS country (
id int NOT NULL DEFAULT NEXTVAL ('country_seq'),
iso char(2) NOT NULL,
name varchar(80) NOT NULL,
nicename varchar(80) NOT NULL,
iso3 char(3) DEFAULT NULL,
numcode smallint DEFAULT NULL,
phonecode int NOT NULL,
* Stop Server
* Remove all odoo files
* Remove postgresql from system
STOP SERVER
sudo service odoo stop
or sudo service odoo-server stop (if odoo-server instead of odoo)
REMOVE ALL ODOO FILES
sudo rm -R /opt/odoo
REMOVE CONFIG FILES

Odoo - Rename an addon without losing data

Rename addon

  • Change __openerp__.py addon name field
  • Change README.rst file
#Odoo installation guide (on CentOS 7)
chungvh@resolve.com.vn
----------
##Operating system
@Mahmoud-Alaa-Eldeen
Mahmoud-Alaa-Eldeen / android-serviceToast.java
Created January 24, 2018 12:01 — forked from saggafarsyad/android-serviceToast.java
Android - Show Toast from Service
// If you Service with threads, e.g. a Chat Service
// You want to show a toast such as indicating the connection is lost or stuff when your service is running foreground
// Get main the main thread, you are only allowed to draw UI in the main thread
Handler mainHandler = new Handler(getMainLooper());
mainHandler.post(new Runnable() {
@Override
public void run() {
// Do your stuff here related to UI, e.g. show toast
@Mahmoud-Alaa-Eldeen
Mahmoud-Alaa-Eldeen / PhpFireBaseNotificationSample.php
Created December 6, 2017 13:20 — forked from MohammadaliMirhamed/PhpFireBaseNotificationSample.php
Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call http://sample.com/PhpFireBaseNotificationSample.php?id=THE_DEVICE_REGISTRATION_ID The main Code For GCM is https://gist.github.com/prime…
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.