Skip to content

Instantly share code, notes, and snippets.

View sajaddp's full-sized avatar

Sajad Dehshiri sajaddp

View GitHub Profile
@jonasgroendahl
jonasgroendahl / useWebSockets.tsx
Created October 29, 2020 21:48
useWebSockets()
import {useEffect, useRef, useState} from 'react';
import io from 'socket.io-client';
type Props = {
userId: number;
enabled: boolean;
onConnected?: () => void;
};
type Message = {
@ebihimself
ebihimself / README.MD
Last active March 15, 2023 08:04
Carbon month name localization with Laravel

Carbon months localization with Laravel translation files

Localization

Translate your desired month in the app.php translation file under its localization directory.

Methods

parseDate() method is responsible to format and translate the month name. In case you need to edit the input format or the returned format this method needs to be modified to meet your need.

getCurrentLocalizaedDate() method is just a test method to show the output.

@AzadGh95
AzadGh95 / import-sql-file-to-docker-mysql.sh
Created September 7, 2021 10:48
Import SQL file to docker MySQL
docker exec -i site_mysql_1 mysql -u root -p secret --init-command="set autocommit=0" dbname < ~/sample.sql