Skip to content

Instantly share code, notes, and snippets.

View cannap's full-sized avatar
💥
Working from home

Marko Bolliger cannap

💥
Working from home
View GitHub Profile
export default function validate (fieldValidator) {
const parseValidators = haye.fromPipe(fieldValidator.rule).toArray()
let validatorList = []
parseValidators.forEach(function (validator) {
if (!validators.hasOwnProperty(validator.name)) {
throw new Error(`Validator not found: ${validator.name}`)
}
const message = get(fieldValidator, `messages.${validator.name}`)
@cannap
cannap / usingmap.js
Last active February 16, 2018 13:17
validate () {
let results = []
if (this.schema.validator) {
results = results.concat(
...validator(this.schema.validator).map(validator => {
return validator.validate(
this.value,
this.schema,
this.model,
validator.message
let inputErrors = []
if (this.schema.validator) {
inputErrors = inputErrors.concat(
...validator(this.schema.validator)
.map(validator => {
return validator.validate(
this.value,
this.schema,
this.model,
validator.message
@cannap
cannap / fefe.js
Last active February 16, 2018 19:18
function msg(text) {
if (text != null && arguments.length > 1) {
for (let i = 1; i < arguments.length; i++) {
text = text.replace('{' + (i - 1) + '}', arguments[i])
}
}
return text
}
import { generateModel } from './components/FormBuilder/utils'
const step1 = [
{
type: 'input',
inputType: 'text',
label: 'Firstname',
default: 'wtf',
model: 'personal.firstname',
placeholder: 'yoo',
@cannap
cannap / fefef
Created February 22, 2018 07:07
**Startseite**
- Der Intro text ist nun Einstellbar über Emistoff -> Emistoff
**Global**
- Der Back to top button wurde ein bisschen nach unten versetzt
**Internal**
- Es wird nun eine andere Funktion zum steuern der MwSt. für Kunden(incl)/Gewerbe(excl) ( nur für die Anzeige rest wird alles von WooCommerce gesteuert) verwendet. Es sollte nun kein Konflikt mehr enstehen da die Einstellungen nicht mehr Global geupdated werden
**Übersicht**
import firebase from './index'
const db = firebase.firestore()
export default db
.page-leave-active {
animation: blurOut 0.3s ease-in both;
overflow-y: hidden !important;
}
.page-enter-active {
animation: blurIn 0.3s ease-in both;
}
<?php /* Template Name: Blog Template */ ?>
<?php get_header(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>
some html
<?php /* Template Name: Blog Template */ ?>
<?php get_header(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>