const a = Math.random().toString(36).substring(2);
console.log(a)
----------------------------
72pklaoe38u
If you want to check if something is running at some port, you may run the following command::
Get-Process -Id (Get-NetTCPConnection -LocalPort 3306).OwningProcess
If an error is returned, then, there is nothing to run on the given port. Otherwise, it displays what the program/service is running.
package main
import (
"fmt"
)
func main() {
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, playground")
$page = ! empty( $_GET['page'] ) ? (int) $_GET['page'] : 1;
$total = count( $yourDataArray ); //total items in array
$limit = 20; //per page
$totalPages = ceil( $total/ $limit ); //calculate total pages
$page = max($page, 1); //get 1 page when $_GET['page'] <= 0
$page = min($page, $totalPages); //get last page when $_GET['page'] > $totalPages
$offset = ($page - 1) * $limit;
if( $offset < 0 ) $offset = 0;
$tourist = Tourist::updateOrCreate([...]);
if(!$tourist->wasRecentlyCreated && $tourist->wasChanged()){
// updateOrCreate performed an update
}
if(!$tourist->wasRecentlyCreated && !$tourist->wasChanged()){
// updateOrCreate performed nothing, row did not change
}
SELECT json_agg(row_to_json(ROW)) AS treeeeeee
FROM (
SELECT * FROM table_name
) row
SELECT
json_build_object(
'id', u.id,
'name', u.name,
'email', u.email,
'user_role_id', u.user_role_id,
'user_role', json_build_object(
'id', ur.id,
Don´t forget to set up experimentalDecorators as a true value into the compileOptions attribute in the tsconfig.json file.
export function decoratorName(paramName : boolean = false) {
return function(target: any, propertyKey: string, descriptor: PropertyDescriptor) {
const originalMethod = descriptor.value;
NewerOlder