Skip to content

Instantly share code, notes, and snippets.

@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

@malle-pietje
malle-pietje / mongodb_storage_engine.txt
Created December 2, 2020 11:56
Determine MongoDB StorageEngine
$ mongo --port 27117
MongoDB shell version v3.4.14
connecting to: mongodb://127.0.0.1:27117/
MongoDB server version: 3.4.14
Server has startup warnings:
2018-07-17T10:06:31.923+0100 I CONTROL [initandlisten]
2018-07-17T10:06:31.923+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-07-17T10:06:31.923+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-07-17T10:06:31.923+0100 I CONTROL [initandlisten]
> use ace
@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 / 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 / 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 / index.html
Last active December 14, 2023 06:34
Redirection to a custom URL from the UniFi controller JSP-based captive portal
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title><unifi txt="Redirector" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="refresh" content="0;url=https://<YOUR CAPTIVE PORTAL URL>/<unifi var="mac" />/<unifi var="ap_mac" />">
</head>
<body>
</body>
</html>