Skip to content

Instantly share code, notes, and snippets.

@mkhuramj
mkhuramj / install-segoeui-fonts.sh
Created January 1, 2025 11:07 — forked from habernal/install-segoeui-fonts.sh
Install MS Segoe UI fonts on Ubuntu
#!/bin/bash
# We install the fonts locally, not into /usr/share/fonts/truetype to avoid unnecessary sudo rights
DEST_DIR="${HOME}/.fonts/segoeui"
mkdir -p $DEST_DIR
# Download 15 *.ttf files
VARIANTS='segoeui segoeuib segoeuii segoeuiz segoeuil seguili segoeuisl seguisli seguisb seguisbi seguibl seguibli seguiemj seguisym seguihis'
for VARIANT in $VARIANTS; do
app/Domain/Leaves/
├── Actions
├── QueryBuilders
├── Collections
├── DataTransferObjects
├── Events
├── Exceptions
├── Listeners
├── Contracts
├── Rules
@mkhuramj
mkhuramj / AccountDeletedUserState.php
Created January 28, 2022 19:22
AuthController with State Pattern
<?php declare(strict_types = 1);
namespace App\Domain\User\States;
use Exception;
use App\Models\User;
use App\Domain\User\Exceptions\AccountDeletedUserStateException;
use App\Domain\User\Actions\AccountRestorationEmailAction;
class AccountDeletedUserState extends UserState {
<?php declare(strict_types = 1);
use App\Http\Controllers\Controller;
class AuthController extends Controller
{
public function authenticate($request): JsonResponse
{
$this->validate($request, [
'email' => 'required|email',
@mkhuramj
mkhuramj / README.md
Created November 2, 2021 06:32 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

<?php
function myFunction() {
foreach ($itemsInFirsArray as $firstArrItem) {
// some code
foreach($itemsInOtherArray as $otherArrItem) {
// some code goes here
switch ($variableToMatch) {
@mkhuramj
mkhuramj / break_issue_example.php
Last active March 22, 2021 19:12
'break' in PHP when Switch is in Loops
<?php
function myFunction() {
foreach ($itemsInFirsArray as $firstArrItem) {
// some code
foreach($itemsInOtherArray as $otherArrItem) {
// some code goes here
switch ($variableToMatch) {
@mkhuramj
mkhuramj / employee.component.ts
Created September 3, 2020 15:45
Using Subject & Observable in Angular Service and Component
import {Component, Input, ViewChild} from '@angular/core';
import {Http} from "@angular/http";
import {ToastsManager} from "ng2-toastr";
import {Fetch, FetchedArrayResult} from "../shared/Fetch";
import {Payroll} from "./Payroll";
import {Confirm} from "../shared/components/confirm";
import {AuthService} from "../auth/auth.service";
import { Router, ActivatedRoute } from '@angular/router';
import { EmployeeService } from '../services/employee.service';
#!/bin/bash
# What it is: a script to compile and install Nginx manually in Ubuntu 14.04 server
# Author: Pothi Kalimuthu
# Author URL: http://pothi.info
# License: GPL v2
### VARIABLES ###
# Please know that this script should be executed as normal user with __sudo__ privileges.
@mkhuramj
mkhuramj / nginx.default.conf
Created August 13, 2016 19:43 — forked from santoshachari/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap