Skip to content

Instantly share code, notes, and snippets.

View amritms's full-sized avatar
🎯
Focusing

Amrit Man Shrestha amritms

🎯
Focusing
  • Toronto, ON, Canada
View GitHub Profile
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status.
set -e
# --- Configuration ---
SOURCE_VMID="911" # Template VM ID to clone from
VM_DISK_INTERFACE="scsi0" # Disk interface used (e.g., scsi0, virtio0). Must match the disk you want to resize/boot from.
ZFS_STORAGE_ID="rpool" # Proxmox Storage ID for your ZFS pool (or Pool/Dataset like 'rpool/data')
# --- Guest specific configuration - Critical to verify! ---
$schema = collect(DB::connection()->getDoctrineSchemaManager()->listTableNames())->map(function ($item, $key) {
return [
'name' => $item,
'colomns' => DB::getSchemaBuilder()->getColumnListing($item)
];
});
@amritms
amritms / gist:1038da7481889b3b3889df9cc711c71a
Created June 4, 2020 17:14 — forked from sreez/gist:c624b3e440b66f9d16a9dc39a2297ed1
taiwindcss default list of padding , font size and line height against equivalent pixels for font base 16px
0px 0rem .p-0
4px 0.25rem .p-1
8px 0.5rem .p-2
12px 0.75rem .p-3, .leading-3, .text-xs
14px 0.875rem .text-sm
16px 1rem .p-4, .leading-4, .text-base
18px 1.125rem .text-lg
20px 1.25rem .p-5, .leading-5, .text-xl
24px 1.5rem .p-6, .leading-6, .text-2xl
28px 1.75rem .leading-7
@amritms
amritms / query.sql
Created June 4, 2020 17:11 — forked from reinink/query.sql
Text search across multiple tables using MySQL
select
first_name,
last_name
from
users
left join
companies on companies.id = users.company_id
where (
companies.name like 'TERM%' or
first_name like 'TERM%' or
@amritms
amritms / query.php
Created June 4, 2020 17:11 — forked from reinink/query.php
Getting table totals using Laravel Eloquent
<?php
$totals = DB::table('subscribers')
->addSelect(DB::raw('count(*) as all'))
->addSelect(DB::raw("sum(case when status = 'confirmed' then 1 else 0 end) as confirmed"))
->addSelect(DB::raw("sum(case when status = 'unconfirmed' then 1 else 0 end) as unconfirmed"))
->addSelect(DB::raw("sum(case when status = 'cancelled' then 1 else 0 end) as cancelled"))
->addSelect(DB::raw("sum(case when status = 'bounced' then 1 else 0 end) as bounced"))
->addSelect(DB::raw("sum(case when status = 'inactive' then 1 else 0 end) as inactive"))
->get();
#The Elements of Style
0. Purpose: Achieve concision and Clarity.
1. Make the paragraph the unit of composition.
2. Begin each paragraph with a topic sentence; end it in conformity with the beginning.
• The topic sentence comes at the beginning;

Learning Plan for Design Patterns and Principles of Good Design

These learning resources primarily focus on programming using Good Design Principles and Design Patterns

  • There is an emphasis on learning using PHP, although most patterns are universal to every object orientated language.

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)
@amritms
amritms / zshrc
Created November 14, 2019 15:35 — forked from LukeSmithxyz/zshrc
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
# ATTENTION PLEASE!
# NOTE BY @riwazp7
# Note for future visitors of this gist: Mac OS has Apache Benchmark by default ab --help
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure && make && sudo make install
# brew install 'https://raw.github.com/simonair/homebrew-dupes/e5177ef4fc82ae5246842e5a544124722c9e975b/ab.rb'