Git Bash inside PhpStorm

Hits: 191

Go to: File -> Settings -> Tools -> Terminal

If you are using 64 Bit Git Bash(Git for Windows) put this in the Shell Path field.

"C:\Program Files\Git\bin\sh.exe" -login -i

Or for 32 Bit Git Bash put this in the field

"C:\Program Files (x86)\Git\bin\sh.exe" -login -i

Social Poster – A Simple Facebook Page and Twitter poster

Hits: 181

Social (Media) Poster

Social Poster is a simple Facebook Page and Twitt poster

  • Text Posting
  • Text with Image-\s Posting

Tech

Social Poster uses a number of open source projects to work properly:

  • facebook/graph-sdk – Facebook SDK for PHP (v5)
  • dg/twitter-php – Twitter for PHP is a very small and easy-to-use library for sending messages to Twitter and receiving status updates.
  • dillinger.io – Markdown editor for this readme.md creating/editing. Fast and easy to extend.
  • Twitter Bootstrap – great UI boilerplate for modern web apps
  • jQuery – duh

Integration

Facebook

  • Create Facebook Developer Account
  • Create Simple App
    • You not need Facebook Products other anything under Your App Settings, I have only Contact E-mail filled
    • Call https://developers.facebook.com/tools/explorer/
    • Select Your App under Application Select
    • Select Page Access Token under Get Token Button
    • Click i icon after Access Token Creating
    • Click Open in Access Token Tool from opened Internal Popup
    • Click Generate Long Lived Token

Twitter

  • Create Twitter Developer Account
  • Create Simple App
    • Click App Details
    • This Keys will be located under Keys and tokens Menu

How do Remove Element From an Array – Simple

Hits: 229

/**
Set - New Array
*/
const users = [];

/**
* Add - New Element/Item
*/
users.push({ id: socket.id, name: 'Visitor'});
 
/**
* Find - Index of Element
*/
var foundIndex = users.findIndex(x => x.id == socket.id);

/**
* Update/Add - New Data an Founded Element
*/
users[foundIndex].name = data.name;

/**
* Remove
*/
users.splice(foundeIndex, 1);

Example from My Home Hobby Project:

const users = [];

nsp.on('connection', (socket) => {
    console.log('Kullanici :' + socket.id + 'Baglandi');
    users.push({ id: socket.id, name: 'Visitor'});

    socket.on('sendUserData', (data) => {
        console.log('Server => ' + data.name + ' Connected.');
        var foundIndex = users.findIndex(x => x.id == socket.id);
        users[foundIndex].name = data.name;

        nsp.emit('updateUserList', users);
    });
    
    socket.on('sendMessage', (data) => {
        console.log(data);
    });

    socket.on('disconnect', ()=> {
        var foundIndex = users.findIndex(x => x.id == socket.id);
        users.splice(foundIndex, 1);
        nsp.emit('updateUserList', users);
    });

    console.log(users);
});

 

My Experiences with Laravel 5.5

Hits: 345

  1. First Project / Look : I have had some experience in module writing my company software solution for an Aid Organization. This project was with Laravel 5.1, what the customer wants as a correction or update…
    1. What have I had?
      1. First of all, some pre-installed plugins(from the old developer at company) need to be updated, because these plugins work not nicely or stable.. But isn’t possible, because XYZ Plugin needed higher version another ABC, DEF Plugins, this plugin needed higher version of laravel/framework.  If I framework updated, then you get several errors, because main core functions or classes changed or removed…
    2. Results
      1. My Idea: Bad/Unstable Relase Management.
        1. Solution 1: Dear Customer, these corrections not possible.
        2. Solution 2 : Writing/Modifying  with hand these Plugin Packages.
  2. Second Project : I have developed a Member and SMS Management Software with Laravel 5.5.
    1. What have I had?
      1. Creating a class and setting up Database Tables is very easy, with php artisan command you can easily insert or execute several things. For example:
        php artisan make:controller HomeController --resource

        then this command generated  a controller with CRUD Methods at app/Http/Controllers/HomeController.php.

      2. Mailable Class, Another useful and clean thing.
      3. Eloquent ORM, simple ActiveRecord implementation.
      4. Blade Templating Engine, simple templating engine.
    2. Results:
      1. My Idea: Good for new starting a new Project.
        1. but you need to update at any time, otherwise you have to develop again a project.

Last of all: Good for new Starting a new project, but you have to update at any time. If you can’t do that, choose another Frameworks.