This file contains 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
/** | |
The allocate_ids and remove_ids are from a multiselect so just an array of id's. | |
Trying to end up with a structure like : | |
[ | |
123 => ['is_accepted' => true], | |
345 => ['is_accepted' => true], | |
... | |
] | |
No matter how many variations of map/flatmap/values/blah I used I always either ended up | |
with a collection of collections, or had re-keyed the collection to something like : |
This file contains 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
For instance, say I have an 'annual review' form for people. Last year | |
they had to fill out training courses attended, this year they don't. | |
Next year the form changes completely but is still called an 'annual | |
review' as far as the business is concerned. The forms can change | |
pretty much any time - not just on a nice annual cycle (naturally). | |
There are also process/logic changes like one year a review has to be | |
signed off by the line manager. Next year it has to be also signed off | |
by their unit head. The year after there is an arbitration process | |
introduced so if the person appeals the decision of $whoever was supposed |
This file contains 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 | |
/* | |
This is a contrived example - but I'm working on a large PHPv4 style legacy codebase | |
and it's full of this kind of code (only much, much worse - c70,000 lines of raw | |
mysql calls etc). | |
So in this case I could use the 'namespace' mocking trick to mock all of the | |
functions - but to test things like "everything passes", "connection works, but TLS | |
fails", "password is wrong" etc, seems hard to do without the tests | |
getting really quite nasty. Combined with all the raw mysql* function calls it |
This file contains 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
twitter.com##body:not(.NotificationsPage) li.stream-item:has(.Icon--heartBadge) |
This file contains 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
# from : https://forum.libreelec.tv/thread/5074-wifi-issues-on-rpi-3-poor-speed-and-latency-solution/#codeLine_1_3e8919 | |
# first install the 'network tools' add-on from the kodi repository then create a /storage/.config/autostart.sh file with | |
# this as the contents. | |
# then reboot the pi. runnning 'iwconfig' should now show the power-management as being off. | |
/storage/.kodi/addons/virtual.network-tools/bin/iw wlan0 set power_save off |
This file contains 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
Notification::assertSentTo($user, MyNotification::class, function ($notification) use ($user) { | |
$markdown = app(\Illuminate\Mail\Markdown::class); | |
$mail = $notification->toMail($user); | |
dd($markdown->render($mail->markdown, $mail->data())); | |
}); |
This file contains 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
// npm install pikaday | |
// resources/assets/js/app.js | |
import Pikaday from "pikaday"; | |
import "pikaday/css/pikaday.css"; | |
Vue.directive("pikaday", { | |
bind: (el, binding) => { | |
el.pikadayInstance = new Pikaday({ | |
field: el, | |
onSelect: () => { |
This file contains 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
# /storage/.config/system.d/minio.service | |
[Unit] | |
Description=minio server | |
# if we do network mounts like here we *require* 'network-online.service' | |
# which checks if the network is online | |
Requires=network-online.service | |
# our scripts must start *after* 'network-online.service', on timeout and if |
This file contains 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
document.addEventListener("DOMContentLoaded", function () { | |
setInterval(keepTokenAlive, 1000 * 60 * 15); // every 15 mins | |
function keepTokenAlive() { | |
axios.get('/keep-token-alive') | |
.then(response => { | |
let token = response.data.token; | |
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = response.data.token; | |
const formFields = document.querySelectorAll('input[name="_token"]'); |
This file contains 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\Notifications; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Notifications\Notification; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Notifications\Messages\MailMessage; | |
use Illuminate\Notifications\Messages\SlackMessage; |
OlderNewer