Skip to content

Instantly share code, notes, and snippets.

View noxify's full-sized avatar

Marcus Reinhardt noxify

View GitHub Profile
@noxify
noxify / file1.js
Last active September 7, 2019 14:05
test gist
//source https://gridsome.org/docs/taxonomies
api.loadSource(store => {
const posts = store.addContentType('Post')
const tags = store.addContentType('Tag')
// makes all ids in the `tags` field reference a `Tag`
posts.addReference('tags', 'Tag')
tags.addNode({
id: '1',
@noxify
noxify / Page.php
Created December 18, 2018 12:14
Twill pages - custom edit template
//app/Models/Page.php
<?php
namespace App\Models;
use A17\Twill\Models\Behaviors\HasBlocks;
use A17\Twill\Models\Behaviors\HasSlug;
use A17\Twill\Models\Behaviors\HasMedias;
use A17\Twill\Models\Behaviors\HasRevisions;
<?php
namespace App\Repositories;
use A17\Twill\Repositories\Behaviors\HandleBlocks;
use A17\Twill\Repositories\Behaviors\HandleSlugs;
use A17\Twill\Repositories\ModuleRepository;
use App\Models\Client;
use A17\Twill\Repositories\BlockRepository;
// thanks johnny for this awesome package <3
@noxify
noxify / twill.php
Created November 27, 2018 21:41
twill config
<?php
return [
'block_editor' => [
'blocks' => [
'text' => [
'title' => 'Body text 1',
'icon' => 'text',
'component' => 'a17-block-wysiwyg',
@noxify
noxify / gist:d24f02a5ab90f9291373c2968d0f85ac
Created April 19, 2018 15:27
enable/disable mandant in service manager
/**
* Reference: https://docs.microfocus.com/SM/9.60/Codeless/Content/programming/system_language/reference/rad_function_mandant.htm
* with type 2, we're using the defintion from scsecuritygroup
* This defintion is the base for the "security groups" in the operator file
*/
//set mandant to ADMIN, which is our global mandant see all records
var rcRad = system.functions.mandant(2, ["ADMIN"])
var file = new SCFile("probsummary");
<?php
declare(strict_types=1);
namespace Rinvex\Fort\Handlers;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Container\Container;
<?php
/*
* NOTICE OF LICENSE
*
* Part of the Rinvex Fort Package.
*
* This source file is subject to The MIT License (MIT)
* that is bundled with this package in the LICENSE file.
*
public function update(LessonCrudRequest $request)
{
$this->crud->hasAccessOrFail('update');
// replace empty values with NULL, so that it will work with MySQL strict mode on
foreach ($request->input() as $key => $value) {
if (empty($value) && $value !== '0') {
$request->request->set($key, null);
}
}
<!-- select2 multiple -->
<div @include('crud::inc.field_wrapper_attributes') >
<label>{!! $field['label'] !!}</label>
<select
name="{{ $field['name'] }}[]"
@include('crud::inc.field_attributes', ['default_class' => 'form-control select2_tags'])