Skip to content

Instantly share code, notes, and snippets.

View franzwilding's full-sized avatar

Franz Wilding franzwilding

View GitHub Profile
<html>
<head></head>
<body>
<input type="file" id="upload" />
<script>
const FIELD_NAME = 'image';
const MUTATION = 'createArticle';
const ENDPOINT = 'https:{ENDPOINT}/{DOMAIN}/api';
{
"validations": [
{
"expression": "data.title != ''",
"message": "Title is required",
"path": "title"
},
{
"expression": "data.company_name != '' OR (data.firstname != '' AND data.lastname != '')",
"message": "Either company name or firstname and Lastname must be filled out."
{
"condition": "event == 'update' AND data.status = 'published'",
"query": "query { type, id, text }",
"url": "http://example.com/hooks/update"
}
<template>
<section>
<article>
<div class="block">
<a href="#" class="back" v-on:click="navigateBack()">Go Back</a>
<div v-html="WebsiteSetting.about_text"></div>
</div>
</article>
</section>
</template>
# imports ...
// Install vue plugins
Vue.use(VueApollo);
Vue.use(VueMoment);
Vue.use(VueRouter);
// init graphql endpoint
const httpLink = new HttpLink({ uri: process.env.VUE_APP_UNITE_API_ENDPOINT });
## Install vue cli on your machine
yarn global add @vue/cli
## Create a new vue project
vue create unite-blog
cd unite-blog
## Install vue-router
yarn add @vue-router
query {
findArticles(sort: { field: "created", order: "DESC"}) {
total,
result {
id,
created
headline,
content
}
},
@franzwilding
franzwilding / unite-cms-example-blog.json
Last active July 24, 2018 13:31
unite cms blog domain schema example
{
"title": "Blog",
"identifier": "blog",
"content_types": [
{
"title": "Articles",
"identifier": "articles",
"content_label": "{headline}",
"fields": [
{
@franzwilding
franzwilding / sketch2svg-sprite.sh
Created December 11, 2015 12:10
Automatically convert a sketch file to a svg sprite. Each sketch artboard will be an icon and can be accessed by #ARTBOARD-ID
#!/bin/sh
sketchtool export artboards icons.sketch --formats=svg --output=./icons
svg-sprite --symbol ./icons/*.svg
sed 's/#000/currentColor/g; s/#000000/currentColor/g' ./symbol/svg/sprite.css.svg > icons.svg
rm -rf ./icons
rm -rf ./symbol