Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Amitav Roy amitavroy

🏠
Working from home
View GitHub Profile
@amitavroy
amitavroy / .php-cs-fixer.php
Created Dec 5, 2021
php cs fixer rules for Laravel
View .php-cs-fixer.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
@amitavroy
amitavroy / Dockerfile
Created Nov 23, 2021
Composer PHP 7.4 Docker file
View Dockerfile
FROM phpdockerio/php74-cli as php
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /app
CMD ["composer"]
@amitavroy
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": [
"ec2:Start*",
"ec2:Stop*",
"ec2:DescribeInstanceStatus"
@amitavroy
amitavroy / TimeEntrySeeder.php
Created Aug 15, 2020
Get a lot of Time Entries
View TimeEntrySeeder.php
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\TimeEntry;
use Faker\Generator as Faker;
$factory->define(TimeEntry::class, function (Faker $faker) {
$username = [
'Amitav',
@amitavroy
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
amitavroy / curl.md
Created Apr 26, 2019 — forked from subfuzion/curl.md
curl POST examples
View curl.md

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
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": "https://github.com/amitavroy/package-name"
}
]
@amitavroy
amitavroy / docker_on_ubuntu.sh
Last active Dec 4, 2021
Installing Docker on a new Ubuntu Server
View docker_on_ubuntu.sh
sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@amitavroy
amitavroy / Fileupload.vue
Created Nov 19, 2018
Vue.js component for a File field which makes an Ajax request to server
View Fileupload.vue
<template>
<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">
<input
type="file"
@amitavroy
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 && \