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
// Helper for Select2, since bind.js uses input events and select2 uses onchange. | |
var inputChangeEvent = new Event('input'); | |
$('select').on("select2:select", function(e){ | |
e.currentTarget.dispatchEvent(inputChangeEvent); | |
}); |
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
<style> | |
#background-overlay { | |
cursor: zoom-out; | |
position: fixed; | |
top: 0; | |
left: 0; | |
background-color: rgba(0, 0, 0, 0.75); | |
width: 100%; | |
height: 100%; | |
z-index: 1000; |
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\Providers; | |
use Illuminate\Support\Facades\Blade; | |
use Illuminate\Support\ServiceProvider; | |
class BladeExtensionServiceProvider extends ServiceProvider { | |
/** | |
* Bootstrap the application services. | |
* |
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
// Takes an array of data, then a comparator, then returns a function that will search for the item given some key | |
const finder = <T>(arr: T[]) => | |
<K>(comparator: (key: K, item: T) => boolean) => | |
(key: K) => arr.find(v => comparator(key, v)); | |
// Wraps the input function to throw on undefined while keeping it type safe | |
const throwOnUndefined = <F extends Function>(f: F): F => { | |
return <any>function (...args: any[]): F { |