Categories
General

How to pull a coworker git branch ?

So it is very simple. To pull a coworker git branch, please executeg the following command.

git checkout --track origin/nameCoworkerBranch

The option “—track” allows you to do the pulling

Do not forget to sign up to my newsletter !

Subscribe

* indicates required
Categories
Technical

My Cronjob (restart database and apache clean logs cronjob configuration)

Find below cronjob that restart apache server, mysql server and clean httpd logs

 SHELL=/bin/bash
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 MAILTO=root
 HOME=/
 

 # For details see man 4 crontabs
 

 # Example of job definition:
 # .---------------- minute (0 - 59)
 # |  .------------- hour (0 - 23)
 # |  |  .---------- day of month (1 - 31)
 # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
 # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
 # |  |  |  |  |
 # *  *  *  *  * user-name command to be executed
   */30  *  *  *  *       root /etc/init.d/httpd restart > /dev/null 2>&1
   */30  *  *  *  *       root /etc/init.d/mysqld restart > /dev/null 2>&1
   */30  *  *  *  *       root /bin/find  /var/log/httpd/*.log -mtime +7 -exec rm -f {} \; 
Categories
MySql SqLite

SQLITE – update a column from another table

SQLITE – update a column from another table while concatenating a string

UPDATE table1
SET table1.businessOwner =  table1.prenom1UniteLegale || ' ' || table1.nomUniteLegale, 
BusinessNameDavid = table1.denominationUniteLegale ,
BusinessAddressDavid = table1.numeroVoieEtablissement || ' ' || table1.typeVoieEtablissement || ' ' || table1.libelleVoieEtablissement 
from table2 
WHERE table1.siren = table1.siren 
Categories
Laravel MySql

LARAVEL – auto increment a column with mysql – upsert

see example below of an upsert

Polls::updateOrInsert(['business_id'=> $business_id],
    [
        "$vote_value" => DB::raw('$vote_value + 1'),
        'polls_name' => $theBusiness->BUSINESSNAME,
        'source' => env('APP_CODE'),
        'updated_at' => $lastupdated
    ]);
Categories
Laravel SqLite

SQLITE – Auto-increment a column with Laravel

Example : for SQLITE the double quote is critical to make it work

Polls::updateOrInsert(['business_id'=> $business_id],
    [
        "$vote_value" => DB::raw('"$vote_value" + 1'),
        'polls_name' => $theBusiness->BUSINESSNAME,
        'source' => env('APP_CODE'),
        'updated_at' => $lastupdated
    ]);
Categories
General

SQL Table Creation Concept – Practical

 CREATE TABLE api.m2_track_file_submission_to_windsurfer (
 id serial NOT NULL,
 ...
 ...
 ...
 ...
 created_at timestamp(0) NULL,
 updated_at timestamp(0) NULL,
 deleted_at timestamp(0) NULL
 ); 

Categories
Laravel

Laravel Eloquent SQL query compare insensitive string

'ilike' or 'not ilike'
return $query->where('api_call', 'not ilike', '%TEST%');
Categories
Satori Architect

Error:80040419 Satori (SORTING) STO2=2 Satori (Dosort) output MRE1=54 -2147220455 CallDoProcess() failed. (error 80040419) Satori

Error:80040419 Satori (SORTING) STO2=2 Satori (Dosort) output MRE1=54 -2147220455 CallDoProcess() failed. (error 80040419) Satori

Not enough pieces

Categories
General

Mac Tips

defaults write -g InitiaKeyRepeat -int 10
defaults write -g KeyRepeat -int 1

Categories
Continuous Integration/Development Programming

SENIOR MOTTO

  • Is it going to fix something or make it more performant?
  • Can we afford it breaking what’s already working?
  • Does it require rewriting a lot of tests?
  • Do we really need to make that change?

From Mohamed Said – Laravel Team