Skip to content

Instantly share code, notes, and snippets.

View saniyathossain's full-sized avatar

Saniyat Hossain saniyathossain

View GitHub Profile
If you don't want to activate and just want to reset the trial,
please delete the
~/.config/dconf/user files and the
~/.config/navicat folder.
Pay attention to the backup data. If conditions permit, please support genuine.
@saniyathossain
saniyathossain / laravel-ddd-approach.md
Created August 16, 2022 11:20 — forked from ibrunotome/laravel-ddd-approach.md
A Domain Driven Design (DDD) approach to the Laravel Framework
/app
├── /Application
|  ├── /Exceptions
|  ├── /Middlewares
|  ├── /Providers
|  ├── /Requests
├── /Domain
|  ├── /MyDomainA
| | ├── /Contracts
@saniyathossain
saniyathossain / ValidationResponseWithRuleName.php
Created May 1, 2021 23:27 — forked from a-h-abid/ValidationResponseWithRuleName.php
Laravel Validation Response for API with Rule Key
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class ValidationResponseWithRuleName
{
/**
@saniyathossain
saniyathossain / vue-datatable.md
Created April 22, 2021 00:19 — forked from Bunix/vue-datatable.md
Datatable component for Vue and Tailwind CSS

Keep in mind that this implementation requires an api for fetching data, and assumes the following response schema:

{
    "perPageOptions": [
        15, 50, 100
    ],
    "actions": [
        "Delete all", "Publish All", "Unpublish All"
    ],

The new postman native app for linux is great! On Ubuntu though, it doesn't create any symbolic links to your app — I link to launch all my apps via Synapse, the simple but powerful application launcher. Follow these short steps to launch your Postman instance via Synapse/any other application launcher:

  • Copy the app directory to a folder of your choice
  • Download the image from here and place it in the same folder.
  • Create a *.desktop file in /home/username/.local/share/applications/postman.desktop
  • Copy paste the contents:
[Desktop Entry]
DROP TABLE IF EXISTS `things`;
CREATE TABLE `things` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nbr` int(11) NOT NULL,
`thing` varchar(255) NOT NULL,
`createdAt` datetime NOT NULL DEFAULT NOW(),
`updatedAt` datetime NOT NULL DEFAULT NOW() ON UPDATE NOW(),
PRIMARY KEY (`id`),
UNIQUE KEY `nbr_unique` (`nbr`)
@saniyathossain
saniyathossain / axios-catch-error.js
Created January 9, 2021 17:01 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@saniyathossain
saniyathossain / stream_file.php
Created January 2, 2021 08:26 — forked from fideloper/stream_file.php
Stream file from S3 to browser, assume Laravel Filesystem usage
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';
@saniyathossain
saniyathossain / ValidGmailAddress.php
Created December 1, 2020 04:47 — forked from m1guelpf/ValidGmailAddress.php
A Laravel rule to ensure Gmail emails actually exist
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class ValidGmailAddress implements Rule
{
/**
* Determine if the validation rule passes.
@saniyathossain
saniyathossain / main.go
Created October 25, 2020 18:43 — forked from retgits/main.go
Get the current date in Go
// Original source: https://gistpages.com/posts/go-lang-get-current-date
// Go playground: https://play.golang.org/p/gBO8rdKI6UF
// time.Format should use the layout, Mon Jan 2 15:04:05 MST 2006 to show the pattern
package main
import (
"fmt"
"time"
)