Skip to content

Instantly share code, notes, and snippets.

View MisterMike's full-sized avatar

Nibiru MisterMike

View GitHub Profile
@MisterMike
MisterMike / gist:9b3ce860a5f1645294c9
Last active August 29, 2015 14:18
AJAX second SELECT population (Laravel Dynamic Dropdown)
// Routes.php :
/* AJAX Select DropDown Population */
Route::get('api/dropdown', function(){
$input = Input::get('catselect');
$cat = Category::find($input);
$subcategory = $cat->subcategory();
return Response::make($subcategory->get(['id','subcat_name']));
});
@MisterMike
MisterMike / craft3-cms-filter-entries-by-category-based-on-querystring
Created March 25, 2019 16:10
Craft CMS: Filter entries by category of QueryString is found
{# get url parameter 'filter' #}
{% set filterQuery = craft.request.getParam('filter') %}
{# if we have a query string, select these categories and find related entries #}
{% if filterQuery|length %}
{% set relatedCats = craft.categories.group('verguenstigungen').slug(filterQuery) %}
{# setup search parameters #}
{% set searchParams = {
relatedTo: relatedCats,
const canton = 'BS'
const apiUrl = (canton) => `https://data.bs.ch/api/records/1.0/search/?dataset=100077&q=&facet=date&facet=name&facet=abbreviation_canton_and_fl&refine.abbreviation_canton_and_fl=${canton}`
const apiUrlCH = `https://data.bs.ch/api/records/1.0/search/?dataset=100077&q=&facet=date&facet=name&facet=abbreviation_canton_and_fl`
const widget = await createWidget()
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
@MisterMike
MisterMike / api-widget-boilerplate.js
Last active October 24, 2020 20:23 — forked from marco79cgn/dm-toilet-paper.js
Scriptable iOS widget that shows the amount of toilet paper which is available at your next dm drugstore
// Thanks https://gist.github.com/marco79cgn/23ce08fd8711ee893a3be12d4543f2d2 for the code :-)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: magic;
let storeId = 178
let country
let param = args.widgetParameter
if (param != null && param.length > 0) {
storeId = param
}
@MisterMike
MisterMike / gist:e8f6cd3d8cfadb84c69c6979ca74d401
Created August 26, 2022 12:12
Craft Site Module Loginpage Custom CSS
/**
* Simple Site Module module for Craft CMS
*
* Simple Site Module CSS
*
* @author Mischa Sprecher
* @copyright Copyright (c) 2019 Mischa Sprecher
* @link https://www.marukka.ch
* @package SimpleSiteModule
* @since 1.1.1