bonus tip: for more darkness > https://darkreader.org/
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CGPDeviceCategory</key> | |
<string>GamePad</string> | |
<key>CGPDeviceType</key> | |
<string>PS3</string> | |
<key>CGPDisplayNameOvr</key> | |
<string>DualShock3 Analogue Triggers</string> |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
class JsonMiddleware | |
{ | |
public function handle(Request $request, Closure $next) |
============ Este post se encuentra publicado en https://pybaq.co/blog/el-zen-de-python-explicado/ ===========
Si alguna vez abren la consola de python y escriben import this
verán que les aparecerán las líneas con el famoso Zen de Python:
- Beautiful is better than ugly.
- Explicit is better than implicit.
/* global module, exports, require, process, console */ | |
'use strict' | |
const Airtable = require('airtable') | |
// Configure Airtable database | |
const base = new Airtable({ | |
apiKey: process.env.AIRTABLE_API_KEY} | |
).base(process.env.AIRTABLE_DATABASE) |
<?php | |
namespace App\Traits; | |
/** | |
* Traits that eases the use of ORDER BY FIELD with an eloquent model. | |
* https://github.com/laravel/ideas/issues/1066 | |
*/ | |
trait OrderByField | |
{ |
The Laravel explination, shown below is confusing.
Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
Many examples use Cache::get('key')
to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.
<?php | |
namespace App\commands; | |
trait ProgressionBarOutput | |
{ | |
public function runProcess(\Countable $countable, callable $callback) | |
{ | |
$bar = $this->output->createProgressBar(count($countable)); | |
$bar->start(); |