Skip to content

Instantly share code, notes, and snippets.

View saniyathossain's full-sized avatar

Saniyat Hossain saniyathossain

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / readme.md
Last active April 4, 2020 04:32
Git Tweaks
@saniyathossain
saniyathossain / settings.json
Created March 25, 2020 14:31
VS Code Settings
{
"workbench.colorTheme": "Ayu Mirage",
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "JetBrains Mono, Roboto Mono, Inconsolata",
"editor.fontSize": 13,
"editor.fontLigatures": true,
"files.trimTrailingWhitespace": true,
"editor.wordWrap": "off",
"editor.formatOnPaste": false,
"editor.multiCursorModifier": "ctrlCmd",
@saniyathossain
saniyathossain / settings.json
Created March 25, 2020 14:31
Sublime Text Settings
{
"always_show_minimap_viewport": true,
"atomic_save": false,
"bold_folder_labels": true,
"color_scheme": "Packages/ayu/ayu-mirage.sublime-color-scheme",
"draw_minimap_border": true,
"font_face": "JetBrains Mono, Inconsolata",
"font_size": 11,
"highlight_line": true,
"highlight_modified_tabs": true,
@saniyathossain
saniyathossain / redme.txt
Created March 25, 2020 10:50
KDE Touchpad Restore Tap On Cick
// https://askubuntu.com/questions/1179275/enable-tap-to-click-kubuntu
// https://askubuntu.com/questions/949527/restore-tap-to-click-in-ubuntu-16-04-on-dell-xps-13
After some additional searching I found the solution to my problem here
I had to add Option "Tapping" "True" to the entry MatchIsTouchpad in the file /usr/share/X11/xorg.conf.d/40-libinput.conf. The exact name of the file might be different for other people.
You need to be root to edit the file!
@saniyathossain
saniyathossain / redme.md
Created February 20, 2020 06:58
Postman Test Script Set Environment Variable
var response    = pm.response.json(),
    accessToken = response.data.access_token;
    
if (response && accessToken) {
    pm.environment.set("access_token_admin", accessToken);   
}