Skip to content

Instantly share code, notes, and snippets.

View gayansanjeewa's full-sized avatar

Gayan Sanjeewa gayansanjeewa

View GitHub Profile
@gayansanjeewa
gayansanjeewa / pint.json
Created September 22, 2025 11:48 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "per",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@gayansanjeewa
gayansanjeewa / rector.php
Created September 22, 2025 11:46 — forked from JustSteveKing/rector.php
Laravel Rector Config
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
@gayansanjeewa
gayansanjeewa / starship.toml
Created July 30, 2021 05:32 — forked from ryo-ARAKI/starship.toml
Starship configuration file
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"
[[battery.display]]
threshold = 30
style = "bold red"
@gayansanjeewa
gayansanjeewa / starship.toml
Created July 30, 2021 05:31 — forked from yerbestpal/starship.toml
Starship configuration file.
# Starship command prompt configuration file. Colour choice and over-use of emoji
# is to help blend in with Ubuntu MATE default theme, Ambiant-Mate.
# disable starship from forcing a new line to be taken. Solved the empty line
# at start of terminal
add_newline = false
[line_break]
disabled = true
@gayansanjeewa
gayansanjeewa / parse_dotenv.bash
Created June 22, 2020 14:11 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@gayansanjeewa
gayansanjeewa / USB-for-UEFI.md
Last active June 10, 2020 15:31
A command-line method to make a live USB for UEFI systems

A command-line method to make a live USB for UEFI systems

Please note: this deletes all data on the target device.

Install prerequisite:

sudo apt-get install p7zip-full

Assuming the target USB is at /dev/sdb

@gayansanjeewa
gayansanjeewa / renew-gpgkey.md
Created June 8, 2020 02:35 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@gayansanjeewa
gayansanjeewa / apache.config
Created May 27, 2020 11:54 — forked from dpup/apache.config
Simple apache config
<VirtualHost *:80>
ServerAdmin me@mydomain.com
DocumentRoot /var/www/site
<Directory /var/www/site/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order deny,allow
Allow from all
</Directory>
@gayansanjeewa
gayansanjeewa / Dockerfile
Created May 27, 2020 11:53 — forked from dpup/Dockerfile
Apache and PHP on Docker
FROM ubuntu:latest
MAINTAINER Dan Pupius <dan@pupi.us>
# Install apache, PHP, and supplimentary programs. openssh-server, curl, and lynx-cur are for debugging the container.
RUN apt-get update && apt-get -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -y install \
apache2 php7.0 php7.0-mysql libapache2-mod-php7.0 curl lynx-cur
# Enable apache mods.
RUN a2enmod php7.0
RUN a2enmod rewrite
@gayansanjeewa
gayansanjeewa / .gitconfig
Created May 14, 2020 18:36 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"