Skip to content

Instantly share code, notes, and snippets.

View saniyathossain's full-sized avatar

Saniyat Hossain saniyathossain

View GitHub Profile
@saniyathossain
saniyathossain / note.txt
Created October 17, 2020 06:08
Install MAC OSX Fonts On Ubuntu
https://securitronlinux.com/debian-testing/install-mac-osx-fonts-on-linux-easily/
@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"
)
@saniyathossain
saniyathossain / scholars-list.txt
Created November 11, 2020 16:04
Islamic Pages, Apps References
Foreigners:
Ahmed Deedat (Late)
Dr. Zakir Naik
Mufti Menk
Nauman Ali Khan
Omar Suleiman
Bilal Phillips
Yusuf Estes
Abdur Raheem Green
@saniyathossain
saniyathossain / vim.txt
Created November 21, 2020 08:11
Vim Necessary Commands
:set paste -> copy as is
:set nopaste -> paste mode off
:set nu -> line number show
:set nonu -> no line number
@saniyathossain
saniyathossain / solved.txt
Created November 22, 2020 04:27
VSC unable to watch for file changes in this large workspace Linux
REFERENCE:
https://stackoverflow.com/questions/50901127/vsc-unable-to-watch-for-file-changes-in-this-large-workspace-weird
Open a new terminal.
cat /proc/sys/fs/inotify/max_user_watches (might be a number 8k+)
now (a) for vim-Editor
(a) sudo vim /etc/sysctl.conf
(a) go all the way down and add a new line with: fs.inotify.max_user_watches=524288 (make sure you DONT have a # in front of the command)
(a) type :wq! and press enter
@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 / 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 / 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';
example.policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetBucketPolicy",
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
@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 😨