Skip to content

Instantly share code, notes, and snippets.

Working from home

Amitav Roy amitavroy

Working from home
View GitHub Profile
amitavroy / .php-cs-fixer.php
Created Dec 5, 2021
php cs fixer rules for Laravel
View .php-cs-fixer.php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
amitavroy / Dockerfile
Created Nov 23, 2021
Composer PHP 7.4 Docker file
View Dockerfile
FROM phpdockerio/php74-cli as php
RUN curl -sS | php -- --install-dir=/usr/local/bin --filename=composer
CMD ["composer"]
amitavroy / aws_ec2_start_stop.json
Last active Jan 11, 2022
AWS EC2 Start Stop Lambda
View aws_ec2_start_stop.json
"Version": "2012-10-17",
"Statement": [
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
amitavroy / TimeEntrySeeder.php
Created Aug 15, 2020
Get a lot of Time Entries
View TimeEntrySeeder.php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\TimeEntry;
use Faker\Generator as Faker;
$factory->define(TimeEntry::class, function (Faker $faker) {
$username = [
amitavroy / MySQL for Telescope tables
Created Jun 4, 2019
Create the table for Telescope to work
View MySQL for Telescope tables
CREATE TABLE `telescope_entries` (
`sequence` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`family_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`should_display_on_index` tinyint(1) NOT NULL DEFAULT 1,
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`sequence`),
amitavroy /
Created Apr 26, 2019 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

amitavroy / composer.json
Created Apr 20, 2019
Packages from local folder and private repo
View composer.json
"repositories": [
"type": "path",
"url": "./packages/test"
"type": "vcs",
"url": ""
amitavroy /
Last active Dec 4, 2021
Installing Docker on a new Ubuntu Server
sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
curl -fsSL | sudo apt-key add -
amitavroy / Fileupload.vue
Created Nov 19, 2018
Vue.js component for a File field which makes an Ajax request to server
View Fileupload.vue
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card card-default">
<div class="card-header">Example Component</div>
<div class="card-body upload-file-wrapper">
amitavroy / Dockerfile
Created Nov 18, 2018
Docker setup with Laravel
View Dockerfile
FROM php:7.2.10-apache-stretch
RUN apt-get update -yqq && \
apt-get install -y apt-utils zip unzip && \
apt-get install -y nano && \
apt-get install -y libzip-dev libpq-dev && \
a2enmod rewrite && \
docker-php-ext-install pdo_pgsql && \
docker-php-ext-install pgsql && \
docker-php-ext-configure zip --with-libzip && \