@distantnative asked me (well, anyone) to optimize a SQL query which generates an overview of Retour events.
#Programming/SQL
with recursive dates as (
select "2019-10-01" as date
union all| <?php | |
| use Kirby\Cms\App; | |
| App::plugin('adamkiss/simple-snippets', []); | |
| if (! function_exists('s')) { | |
| /** | |
| * Short, auto-return snippet call with support for auto-merging certain parameters | |
| * | |
| * @param string $snippetName |
| #!/usr/bin/env fish | |
| function nr -a script --description 'npm run shortcut with default script set to "start"' | |
| if not string length -q $script | |
| set script start | |
| end | |
| npm run $script | |
| end |
@distantnative asked me (well, anyone) to optimize a SQL query which generates an overview of Retour events.
#Programming/SQL
with recursive dates as (
select "2019-10-01" as date
union all| <?php | |
| use Kirby\Cms\App as Kirby; | |
| use Kirby\Data\Data; | |
| Kirby::plugin('adamkiss/dynamic-blueprint', [ | |
| 'hooks' => [ | |
| 'system.loadPlugins:after' => function() { | |
| // load base (this could be dynamic as well. Should even) | |
| $fakeBlueprint = Data::read(__DIR__ . '/fake-kirby-request.yml'); |
| module.exports = class Transform { | |
| constructor (opts) { | |
| this.opts = opts | |
| this.apply = this.apply.bind(this) | |
| } | |
| apply (compiler) { | |
| const transforms = (Array.isArray(this.opts)) ? this.opts : [this.opts] | |
| compiler.plugin('emit', function(compilation, done) { |
| extends(src='layout.sgr') | |
| block(name='styles' type='append') | |
| // normal link | |
| link(rel='stylesheet' href='/css/home-hero.css') | |
| // function for reshape-content | |
| style(inline) /css/home-hero.css | |
| // reshape custom element plugin |
| $breakpoints-list: ( | |
| ns: '>=44em' | |
| ); | |
| $ruleset: ( | |
| bg-r: ('background red'), | |
| bg-g: ('background green', top 10px) | |
| ); | |
| $breakpoints: ns; |
| 'use strict' | |
| module.exports = { | |
| require_fresh: function (file) { | |
| delete require.cache[require.resolve(file)] | |
| return require(file) | |
| } | |
| } |
| <?php | |
| $ee_switch_global = array(); | |
| function switch(){ | |
| global $ee_switch_global; | |
| $args = func_get_args(); | |
| $key = array_shift($args); | |
| if (array_key_exists($key,$ee_switch_global)){ | |
| $index = $ee_switch_global[$key]++; |