Skip to content

Instantly share code, notes, and snippets.

@malle-pietje
malle-pietje / AjaxQueue.js
Created February 2, 2018 09:21 — forked from Terrance/AjaxQueue.js
Limit concurrent jQuery ajax requests to at most 3 at a time, and queue the rest.
var ajaxReqs = 0;
var ajaxQueue = [];
var ajaxActive = 0;
var ajaxMaxConc = 3;
function addAjax(obj) {
ajaxReqs++;
var oldSuccess = obj.success;
var oldError = obj.error;
var callback = function() {
ajaxReqs--;
@malle-pietje
malle-pietje / dpi_categories.json
Last active October 22, 2018 12:08 — forked from mwegner/categories.json
list of UniFi SDN controller DPI Categories
{
"categories":{
"0":{
"name":"Instant messaging",
"applications":[
1,
2,
3,
4,
5,
@malle-pietje
malle-pietje / postal-codes.json
Created October 14, 2019 10:19 — forked from jamesbar2/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@malle-pietje
malle-pietje / Backpack export operation (excel and csv) .md
Created October 4, 2022 17:58 — forked from AndreiTelteu/Backpack export operation (excel and csv) .md
Export operation for backpack admin panel, that exports the entire database table, not just the entries shown on page
  1. First install maatwebsite/excel package:
composer require maatwebsite/excel
  1. Copy export.blade.php from this gist in resources/views/vendor/backpack/crud/buttons/export.blade.php

  2. Copy ExportOperation.php from this gist in app/Traits/Operations/ExportOperation.php