Skip to content

Instantly share code, notes, and snippets.

View lorisleiva's full-sized avatar

Loris Leiva lorisleiva

View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active December 23, 2024 10:35
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@cabloo
cabloo / DebouncedJob.php
Last active August 22, 2024 18:09
Debounced Laravel Jobs
<?php
namespace App\Support\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
class DebouncedJob implements ShouldQueue
{
use \Illuminate\Foundation\Bus\DispatchesJobs;
use \App\Support\Cache\PrefixedCache;
@paulund
paulund / phpcs.xml
Created August 20, 2017 16:50
PHP PSR-2 CodeSniffer Config for Laravel
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
<!--
The name attribute of the ruleset tag is displayed
when running PHP_CodeSniffer with the -v command line
argument. The description tag below is not displayed anywhere
except in this file, so it can contain information for
developers who may change this file in the future.
-->
@brunogaspar
brunogaspar / macro.md
Last active November 25, 2024 11:01
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@PCreations
PCreations / rxjs-diagrams.md
Last active September 26, 2024 01:44
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@dunglas
dunglas / example.php
Created April 19, 2018 06:25
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@lorisleiva
lorisleiva / phpcs.xml
Last active May 4, 2019 14:42
The default PHP Code Style of my Laravel projects.
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Laravel">
<description>The default PHP Code Style of my Laravel projects.</description>
<!-- Files to include. -->
<file>app</file>
<file>config</file>
<file>routes</file>
<file>tests</file>
@lorisleiva
lorisleiva / ArticleUpdateTest.php
Created August 5, 2019 10:16
✅ Set up traits dynamically for tests
<?php
namespace Tests;
use Tests\Authenticated;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ArticleUpdateTest extends TestCase
{