Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
clone remote repository
After installing
Git
on the server, we can clone remote repository
sudo git clone https://tandilashvili@bitbucket.org/tandilashvili/csmp.git
The command clones the remote repository of
csmp
project
by Valeri Tandilashvili
4 years ago
0
Linux
0
copy file
Duplicates
.env.example
file, names it
.env
and places it in the same directory
sudo cp .env.example .env
by Valeri Tandilashvili
4 years ago
0
Linux
0
delete file
Deletes specified file
sudo unlink /etc/nginx/sites-enabled/csmp.use.ge
by Valeri Tandilashvili
4 years ago
0
Linux
0
edit file
Opens
.env
file with edit mode using command line interface
sudo nano .env
We can specify the file with full address
sudo nano /var/www/csmp.ge/.env
by Valeri Tandilashvili
4 years ago
0
Linux
0
tinyint data type
In Laravel 8+
tinyInteger
method generates
tinyint(4)
data type in MySQL
$table->tinyInteger('column_name');
Whereas
boolean
method generates
tinyint(1)
data type
$table->$table->boolean('column_name');
by Valeri Tandilashvili
4 years ago
0
Laravel
MySQL
Data types
migrations
0
Difference between REPLACE and ON DUPLICATE KEY UPDATE
REPLACE
statement updates the listed columns if primary key (one of the listed columns) already exists. Otherwise inserts as a new record
REPLACE INTO students (id, first_name, points)
VALUES (41, 'ილიკო', 147)
Similar to the
REPLACE INTO
statement is
ON DUPLICATE KEY
. The only difference is that on duplicate key it updates only the listed columns but omitted values stays the same
INSERT INTO students (id, first_name, points) 
VALUES (41, 'გიორგი', 149) 

ON DUPLICATE KEY 

UPDATE first_name = 'გიორგი', points = 123
Note 1
: If primary key is not listed, it will insert the record, but if the primary key is one of the listed columns, it will update the specified row that matches the primary key.
Note 2
: If the primary key exists, all the other omitted columns will get the default values after updating the record.
by Valeri Tandilashvili
4 years ago
0
MySQL
Full MySQL Course for Beginners
0
php artisan make:component ComponentName
creates
ComponentName.blade.php
inside
resources/view/components
and controller
ComponentName.php
inside
App\View\Component
directory you can render component by
x-
syntax
<x-component-name />
pass variables to components use
var-name=
for normal strings and use
:var-name=
for variables
<x-component-name var-name="normal string" :var-name2="$some_variable"/>
make sure to use
kebab-case
as html attribute names and
camelCase
inside constructor argument and inside component controller file
ComponentName.php
namespace App\View\Components;
use Illuminate\View\Component;

class ComponentName extends Component
{
    public $varName1;
    public $varName2; 

    public function __construct($varName1, $varName2)
    {
        $this->varName1 = $varName1;
        $this->varName2 = $varName2;
    }

    public function customFunction($last)
    {
        return [1, 2, 3, 4, 5, 6, 7, $last]; // or data from db for example
    }

    /**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\View\View|\Closure|string
     */
    public function render()
    {
        return view('components.component_name');
    }
}
inside
ComponentName.blade.php
we can retrieve these variables like so
<div class="component-class">
    <div>{{$varName1}}</div>
    <div>{{$varName2}}</div>
    @foreach($customFunction('last line') as $line)
      <h1>{{$line}}</h1>
    @endforeach
</div>
by გიორგი უზნაძე
4 years ago
0
Laravel
laravel official doc
0
Converts radians back to degrees. Half of
PI
radians
1.5707963267948966
converted to degrees gives us
90
degrees.
PI
:
3.141592653589793
radians converted to degrees gives us
180
degrees.
SELECT
    DEGREES(1.5707963267948966),
    DEGREES(3.141592653589793)
by Valeri Tandilashvili
4 years ago
0
MySQL
Mathematical functions
Full MySQL Course for Beginners
0
Arrays VS Sets
const taskArrays = ['code', 'Eat', 'code'];
console.log(taskArrays);
//["code", "Eat", "code"]
Use when you need
ordered
list of values (might contains duplicates) Use when you need to
manipulate
data
const taskSets = new Set(['code', 'Eat', 'code']);
console.log(taskSets);
//{"code", "Eat"}
Use when you need to work with
unique
values Use when
High-performance
is really important Use to
remove
duplicates from arrays
by გიორგი ბაკაშვილი
4 years ago
0
0
Object VS Maps
Object
const taskObjects = {
  task: 'code',
  date: 'today',
  repeat: true
}
console .log(taskObjects)
//{task: "code", date: "today", repeat: true}
More "traditional" key/value Easier to write and access values with . and [ ] Use when you need to include
Functions
(methods) Use when working with JSON (can convert to map)
Maps
const taskMaps = new Map( [
   ['task', 'code'],
   ['date', 'today'],
   [false, 'start coding!'],
]);
console .log(taskMaps)
//{"task" => "code", "date" => "today", false => "start coding!"}
Better performance Keys can have any data type Easy to iterate Easy to compute size Use when you simply need to map key to values Use when you need key that are
not
strings
by გიორგი ბაკაშვილი
4 years ago
0
0
Results: 1580