Skip to content

Instantly share code, notes, and snippets.

View saniyathossain's full-sized avatar

Saniyat Hossain saniyathossain

View GitHub Profile
@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]
@saniyathossain
saniyathossain / to-do-after-ubuntu-setup-note.txt
Created March 5, 2021 08:22
Install-able software in Ubuntu for Development
1. open terminal after desktop comes.
2. run
sudo apt update
3. sudo apt upgrade
4. sudo apt autoremove
5. next install docker
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
6. install docker-compose
https://docs.docker.com/compose/install
note: in this page select linux option, then follow instructions.
@saniyathossain
saniyathossain / readme.txt
Created February 15, 2021 11:28
Install zsh in ubuntu
https://medium.com/@shivam1/make-your-terminal-beautiful-and-fast-with-zsh-shell-and-powerlevel10k-6484461c6efb
https://www.realjenius.com/2020/01/12/kde-neon-snap-apps-missing/
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 😨
example.policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetBucketPolicy",
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
@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 / docker-project-start.sh
Created December 1, 2020 07:24
Init project docker-compose commands from shell file - Linux
#!/bin/bash
USER="saniyathossain"
DOCKER_COMMONS_DIR="/home/$USER/app/docker/www/commons/docker-commons"
PROJECT_DIR="/home/$USER/app/docker/www/company/project/microservice"
PROJECT_DOCKER_DIR="$PROJECT_DIR/docker"
echo "USER: $USER"
sleep 2
echo "DOCKER COMMONS DIRECTORY: $DOCKER_COMMONS_DIR"
@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.