const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Symfony\Component\HttpFoundation\ParameterBag; | |
| /** | |
| * @author https://github.com/Stunext | |
| * |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Follow this instructions: | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Laravel takes a dead simple approach to your application environments | |
| | so you can just specify a machine name for the host that matches a | |
| | given environment, then we will automatically detect it for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Step 1. Create this class in the middleware folder. | |
| <?php namespace App\Http\Middleware; | |
| use Closure; | |
| class BeforeAutoTrimmer { | |
| /** | |
| * Handle an incoming request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Server file | |
| class PushNotifications { | |
| // (Android)API access key from Google API's Console. | |
| private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
| // (iOS) Private key's passphrase. | |
| private static $passphrase = 'joashp'; | |
| // (Windows Phone 8) The name of our push channel. | |
| private static $channelName = "joashp"; |
NewerOlder