Skip to content

Instantly share code, notes, and snippets.

View strotgen's full-sized avatar
🎯
Focusing

Alfonso Strotgen strotgen

🎯
Focusing
View GitHub Profile
@strotgen
strotgen / DownloadLatestRelease.md
Last active May 24, 2020 22:18
Download latest release from a github repo

Download the latest release file from a github repo

I am using the anki repo as an example. Change accordingly.

  • Change ankitects/anki for the repo you need.
  • Change amd64 for the file name you need. In my case, the Linux files in the Anki repo have amd64 in their name.
  • Change Anki.tar.bz for the name of the file you want.
  • Run as needed.
@strotgen
strotgen / .php_cs.laravel.php
Created July 17, 2019 15:03 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
@strotgen
strotgen / CanBeReplicated.php
Created June 14, 2019 13:46 — forked from mpociot/CanBeReplicated.php
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(),
@strotgen
strotgen / video-controls-mobile.js
Last active July 29, 2018 19:45
Display the <video> element controls when the user is browsing on a mobile device. Uses jQuery.
if (/Mobi|Android/i.test(navigator.userAgent)) {
$('video').attr('controls', 'controls');
}