Skip to content

Instantly share code, notes, and snippets.

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

Abdelouahab Djoudi djoudi

🏠
Working from home
View GitHub Profile
@djoudi
djoudi / MY_Exceptions.php
Created May 27, 2012 07:44 — forked from zaherg/MY_Exceptions.php
using this file your error pages will be localized , but the error folder must contain folders like : english , arabic ... etc
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Exceptions extends CI_Exceptions {
var $ob_level;
public function __construct()
{
parent::__construct();
}

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users

I finally got the time to play around with unit testing in PHP. I've heard about the term months ago but I really never had the time to play around with it because I considered it as not absolutely necessary for my development workflow. I mean I can still produce useable programs without writing a test for it right?

But admit it, testing the program that you have written is not really that exciting as writing the program itself. Sometimes we even get lazy and not test the program at all only to find things breaking on production. (Note: I'm referring to in-browser testing here)

Creating Git server

Install git-core

$ sudo apt-get update
$ sudo apt-get install git-core

Create git user

$ sudo adduser git

Create the repo on the server

$ su git

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
package org.adempiere.webui.window;
import java.io.File;
import java.io.FileOutputStream;
import java.util.logging.Level;
import javax.servlet.http.HttpServletRequest;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperExportManager;
@djoudi
djoudi / 01_Laravel 5 Simple ACL manager_Readme.md
Created October 30, 2015 20:56 — 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

@djoudi
djoudi / BlogController.php
Created November 21, 2015 15:48 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@djoudi
djoudi / DataLogicIntegrarion.Java
Created December 2, 2015 03:56 — forked from TheEYL/DataLogicIntegrarion.Java
Key violation Issue solved
// Openbravo POS is a point of sales application designed for touch screens.
// http://www.openbravo.com/product/pos
// Copyright (c) 2007 openTrends Solucions i Sistemes, S.L
// Modified by Openbravo SL on March 22, 2007
// These modifications are copyright Openbravo SL
// Author/s: A. Romero
// You may contact Openbravo SL at: http://www.openbravo.com
//
// This file is part of Openbravo POS.
//
@djoudi
djoudi / MultipleEmailAttachments.php
Created February 13, 2016 00:11 — forked from optikalefx/MultipleEmailAttachments.php
Multiple Email Attachments PHP from scratch
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
if(isset($_FILES) && (bool) $_FILES) {
$allowedExtensions = array("pdf","doc","docx","gif","jpeg","jpg","png","rtf","txt");
$files = array();