Skip to content

Instantly share code, notes, and snippets.

View racibaz's full-sized avatar

raci racibaz

  • Istanbul
View GitHub Profile
@diloabininyeri
diloabininyeri / chain_condition_bank.php
Last active February 15, 2023 14:05
the pick one a bank in the too complex conditions
<?php
class User
{
}
interface BankWithdraw
{
public function withdraw(User $user): array;
@whoisryosuke
whoisryosuke / laravel-assert-json-structure.php
Created August 7, 2018 22:46
Laravel - Testing / API - Assert JSON structure (instead of values)
<?php
$response
->assertStatus(201)
->assertJsonStructure([
'data' => [
'id',
'business_id',
'user_id',
'verified',
@ibrunotome
ibrunotome / laravel-ddd-approach.md
Last active August 25, 2023 23:25
A Domain Driven Design (DDD) approach to the Laravel Framework
/app
├── /Application
|  ├── /Exceptions
|  ├── /Middlewares
|  ├── /Providers
|  ├── /Requests
├── /Domain
|  ├── /MyDomainA
| | ├── /Contracts
@jeffochoa
jeffochoa / Response.php
Last active May 4, 2024 08:50
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@phackwer
phackwer / City Model
Created June 7, 2017 17:59
Laravel 5 - all cities, regions, states and countries from Gazeteer
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class City extends Model
{
/**
* @var array
@paulsturgess
paulsturgess / service.js
Last active February 2, 2024 17:24
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@identor
identor / vici_install.md
Last active February 19, 2024 04:26
Guide: Vici Dial Installation

Vici Dial Installation Guide

This guide shows a simple Vici Dial installtion on a debian6_x64 droplet in Digital Ocean.

Create the Droplet

General Guidelines:

  • Create the Droplet by selecting Create Droplet in the Droplet's UI.
  • Select the 64 bit image of debian 6.

Dependency installation

We need to install all dependencies before proceeding to install the astguiclient.