Skip to content

Instantly share code, notes, and snippets.

@asyncnull
asyncnull / deployment_guide.md
Created February 12, 2020 18:19 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@asyncnull
asyncnull / forge.sh
Created June 1, 2020 14:49
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
@asyncnull
asyncnull / imagick3.4.4-PHP7.4-forge.sh
Created June 24, 2020 21:51 — forked from danielstgt/imagick3.4.4-PHP7.4-forge.sh
Install Imagick 3.4.4 on PHP 7.4 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz
@asyncnull
asyncnull / System Design.md
Created July 6, 2020 22:42 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@asyncnull
asyncnull / index.md
Created November 24, 2020 17:30 — forked from meigwilym/index.md
Notes on stitcher.io's Laravel beyond CRUD

Laravel beyond CRUD

stitcher.io

A blog series for PHP developers working on larger-than-average Laravel projects

Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.

Chapter 1: Domain oriented Laravel

@asyncnull
asyncnull / invisible recaptcha.md
Created January 1, 2021 10:57 — forked from ctf0/invisible recaptcha.md
invisible recaptcha with vuejs & laravel

Frontend "https://github.com/DanSnow/vue-recaptcha"

  • npm install --save vue-recaptcha

  • form

<my-form inline-template>
    <form action="{{ route('...') }}" @submit.prevent="FormSubmit($event)">
        // other inputs
@asyncnull
asyncnull / datastructures.md
Last active July 1, 2024 04:24
Collections

Data Structures

Trees

image

  • The root of a tree is the node with no parents. There can be at most one root node in a tree. (node A)
  • An edge refers to the link from parent to child (all links in the figure).
  • A node with no children is called leaf node (E, J, K, H and I).
  • Children of same parent are called siblings (B, C, D are siblings of A).
@asyncnull
asyncnull / python.md
Last active October 12, 2024 19:05
Collections

Python Cheatsheet for Coding Questions

Basics

Variables and Data Types

# Integer
x = 5

# Float
@asyncnull
asyncnull / algorithms.md
Last active July 22, 2024 02:35
Collections

Algorithms

Boyer–Moore majority vote algorithm

This algorithm works on the fact that if an element occurs more than N/2 times, it means that the remaining elements other than this would definitely be less than N/2. So let us check the proceeding of the algorithm.

First, choose a candidate from the given set of elements if it is the same as the candidate element, increase the votes. Otherwise, decrease the votes if votes become 0, select another new element as the new candidate.

Psudo Code

  • Initialize an element m and a counter c with c = 0
  • For each element x of the input sequence:
    • If c = 0, then assign m = x and c = 1