Skip to content

Instantly share code, notes, and snippets.

View saniyathossain's full-sized avatar

Saniyat Hossain saniyathossain

View GitHub Profile
@saniyathossain
saniyathossain / readme.md
Last active April 4, 2020 04:32
Git Tweaks
@saniyathossain
saniyathossain / postman-pre-request.js
Created May 6, 2020 09:50 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@saniyathossain
saniyathossain / settings.json
Created June 28, 2020 04:11
VS Code Settings
{
"editor.fontFamily": "JetBrains Mono",
"editor.fontSize": 15,
"editor.fontLigatures": true,
"files.trimTrailingWhitespace": true,
"editor.wordWrap": "off",
"editor.formatOnPaste": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.cursorStyle": "line-thin",
@saniyathossain
saniyathossain / DataTable.vue
Created June 29, 2020 09:49 — forked from yajra/DataTable.vue
VueJS DataTables Snippets with Delete Button Component
<template>
<table>
<thead>
<tr>
<th v-for="column in parameters.columns" v-html="title(column)"></th>
</tr>
</thead>
<tfoot v-if="footer">
<tr>
<th v-for="column in parameters.columns" v-html="column.footer"></th>
@saniyathossain
saniyathossain / AppServiceProvider.php
Created July 11, 2020 07:04 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@saniyathossain
saniyathossain / TagTrait.php
Last active July 30, 2020 03:45
Trait for A Virtual Field to Laravel Model Collection
<?php
namespace App\Eloquents\Traits;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Str;
use ReflectionClass;
/**
* Generates prefixed column along with padded specific model attribute (e.g. model table primary key attribute)
@saniyathossain
saniyathossain / Dockerfile
Created September 13, 2020 09:20 — forked from BretFisher/Dockerfile
WIP sample Laravel php_fpm plus nginx plus supervisor Docker setup with npm, composer, bower, and more
FROM yourdockername/base-php-nginx:latest AS build
# BUILD STAGE
# the primary reason we have two build stages is so SSH key of private repo's will never
# be in final image
# COPY IN BUILD SSH KEY
# It won't be copied to final image
# add this build arg to compose file
ARG BUILDKEY
RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi
@saniyathossain
saniyathossain / description.txt
Last active December 9, 2020 06:54
VS Code Extensions
JetBrains Mono Font: Just a Programming Font
Ayu Theme: Theme for vscode
Docker: for view, run, inspect docker image, container, network, volume etc.
Bracket Pair Colorizer 2: for coloring bracket pairs for better visualization inside code
File Utils: for sidebar enhancement -> (like duplicate file etc.. from left panel)
Editor Config: For editor configs
DotENV: for easier linting and syntax highlighting .env files
PHP Intellisense: This extension is very important for PHP lint, format, autocomplete class, Import class, go to class, method directly from code etc..
Inline Parameters for VSCode: optional: phpstorm like method argument highlighting
PHP Docblock: useful for adding method, class etc. top inline documentation
Can I Remove MySQL Binary Log Yes, as long as the data is replicated to Slave server, it’s safe to remove the file. It’s recommend only remove MySQL Binary Log older than 1 month.
Besides, if Recovery of data is the main concern, it’s recommend to archive MySQL Binary Log.
There are several ways to remove or clean up MySQL Binary Log, it’s not recommend to clean up the file manually, manually means running the remove command.
Remove MySQL Binary Log with RESET MASTER Statement Reset Master statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.
To clean up Binary Log on Master Server
sudo update-locale LC_CTYPE=en_US.UTF-8;
sudo update-locale LC_NUMERIC=en_US.UTF-8;
sudo update-locale LC_TIME=en_US.UTF-8;
sudo update-locale LC_COLLATE=en_US.UTF-8
sudo update-locale LC_MONETARY=en_US.UTF-8;
sudo update-locale LC_MESSAGES=en_US.UTF-8
sudo update-locale LC_PAPER=en_US.UTF-8;
sudo update-locale LC_NAME=en_US.UTF-8;
sudo update-locale LC_ADDRESS=en_US.UTF-8;
sudo update-locale LC_TELEPHONE=en_US.UTF-8;