Skip to content

Instantly share code, notes, and snippets.


Madalin Tache niladam

View GitHub Profile
niladam / box-shadow.html
Created Oct 22, 2020 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
View box-shadow.html
<!DOCTYPE html>
<title>Box Shadow</title>
.box {
height: 150px;
width: 300px;
margin: 20px;
niladam / User.php
Last active Sep 24, 2020
Laravel 8 use gravatar as default profile photo
View User.php
namespace App\Models;
use Illuminate\Support\Str;
class User extends Authenticatable
// [...] Your other User methods/properties here
niladam /
Created Apr 19, 2020 — forked from premek/
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
niladam /
Created Mar 22, 2020 — forked from grenade/
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "" -f ~/.ssh/mozilla_rsa
View Resourceable.php
namespace App\Concerns;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
trait Resourceable
public function toResourceArray(?string $class = null, ?Request $request = null): array
View helpers.php
function faker($property = null)
$faker = Faker\Factory::create();
if ($property) {
return $faker->{$property};
niladam / Example.js
Created Sep 24, 2019 — forked from vaibhavpandeyvpz/Example.js
Laravel, Axios & Logout Over AJAX
View Example.js
import React from 'react';
import ReactDOM from 'react-dom';
const handleLogout = () => {'/logout')
.then(() => location.href = '/home')
function Example() {
return (
niladam / LICENSE
Created May 31, 2019 — forked from donnierayjones/LICENSE
Render Bootstrap as "small" layout when printing
Copyright (C) 2016 Donnie Ray Jones
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
niladam / .php_cs.laravel.php
Created May 6, 2019 — forked from laravel-shift/.php_cs.laravel.php
PHP CS Fixer - Laravel Ruleset
View .php_cs.laravel.php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
View eloquent_search.php
// Add this to the "boot()" method of your "AppServiceProvider"
\Illuminate\Database\Eloquent\Builder::macro('search', function ($name, $search) {
return $this->where($name, 'LIKE', $search ? '%'.$search.'%' : '');