Skip to content

Instantly share code, notes, and snippets.

View zymawy's full-sized avatar
🐛
Debugging

Hamza Ironside zymawy

🐛
Debugging
View GitHub Profile
@mpociot
mpociot / CanBeReplicated.php
Created June 12, 2019 12:32
Add the ability to replicate Laravel models to other models.
<?php
use Illuminate\Support\Arr;
trait CanBeReplicated
{
public function replicateTo(string $model, array $with = null, array $except = null)
{
$defaults = [
$this->getKeyName(),

We can see we have php 7.0 available out of the box:

sudo apt-cache show php-cli

Instead of using that, we'll start by installing the latest PHP 7.1, via the populate PHP repository.

@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@paulredmond
paulredmond / UsersIndex.vue
Last active April 20, 2020 16:04
UsersIndex component for use with vue-router - https://laravel-news.com/building-vue-spa-laravel-part-3
<template>
<div class="users">
<div v-if="error" class="error">
<p>{{ error }}</p>
</div>
<ul v-if="users">
<li v-for="{ id, name, email } in users">
<strong>Name:</strong> {{ name }},
<strong>Email:</strong> {{ email }}
@kt2763
kt2763 / nuxtjs-pagination-component.vue
Created November 24, 2017 21:35
Nuxt.js Pagination
<template>
<nav id="pagination">
<ul class="page-numbers" v-if="$store.state.totalPageCount">
<li v-for="num in this.pageNumbers" v-if="num != null" v-bind:style="{ width: (100 / pageNumberCount) + '%' }">
<nuxt-link v-if="num != $route.query.page && num != currentPage" :to="{ path: '/', query: { page: num } }">{{ num }}</nuxt-link>
<span v-else>{{ num }}</span>
</li>
</ul>
<ul class="page-guides" v-if="this.$store.state.totalPageCount != 1">
<li>
@ivanvermeyen
ivanvermeyen / !NOTE.md
Last active March 15, 2023 05:25
Setup a Laravel Storage driver with Google Drive API
@abhi9bakshi
abhi9bakshi / laravel_setup_ubuntu_1610.md
Last active October 7, 2018 12:06
How to install Laravel in Ubuntu 16.10

How to install Laravel in Ubuntu 16.10

===================================

Open your terminal using Ctrl+Alt+T and type the following commands

##Step 1: Update & Upgrade

sudo apt-get update
sudo apt-get upgrade
<?php
///////////////////////////////////////////////////
// STEP 1 - CREATE CLASS THAT WILL BE USED GLOBALY
///////////////////////////////////////////////////
namespace App\MyApp;
class MyApp {
public function sayHello($data = [])
{
echo "Hello World from Facade!";
}
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active February 24, 2024 13:40
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active May 27, 2024 22:57
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on