Skip to content

Instantly share code, notes, and snippets.

DominikAngerer DominikAngerer

Block or report user

Report or block DominikAngerer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DominikAngerer
DominikAngerer / now.json
Created Jun 5, 2019
Nuxt Builder for Now
View now.json
{
"version": 2,
"builds": [
{
"src": "nuxt.config.js",
"use": "@nuxtjs/now-builder",
"config": {}
}
],
"routes": [
View batman.txt
..........................................................................................................
..........................................................................................................
...............................*..........................................................................
............................Y@@@@Y.....................................E@@@@E.............................
...........................E@@WR@@@...................................E@@WW@@@*...........................
.........................E@@@GGGG@@W.................................:@@WGGGW@@Y..........................
........................Y@@WGGGGGR@@E................................@@QGGGGGW@@G.........................
.......................E@@WGGGGGGGW@@:..........*YEYEEEE*...........@@@GGGGGGGG@@@........................
......................R@@GGGGGGGGGGQ@@...EEG@@@@@@@@@@@@@@@@@REY:..Y@@GGGGGGGGGGQ@@.......................
.....................G@@GGGGGGGGGGGG@@@@@@WWWWGGGGGGGGGGGGGRW
View storyblok-import.js
const axios = require('axios')
const fs = require('fs')
const netrc = require('netrc')
const os = require('os')
const path = require('path')
const host = 'api.storyblok.com'
const args = process.argv
let space = ''
args.forEach((arg) => {
View _clear_cache.vue
<template>
<section class="util__container">
<h1>Cache Cleared</h1>
<br>
<p>Old Cache Version: {{oldCacheVersion}}</p>
<p>New Cache Version: {{newCacheVersion}}</p>
</section>
</template>
<script>
View storyblok-image-upload-function.js
methods: {
...
storyblokImageUpload(fileblob, filename, success, failure) {
this.api.client.post(
`/spaces/${this.spaceId}/assets`,
{ filename: filename },
{ headers: { Authorization: this.options.oauthToken } }, // uses the option with the name `oauthToken` which needs to be configured in the schema definition of the field you're using the plugin in.
).then((response) => {
let request = new XMLHttpRequest()
View get-stories-management-api-js-sdk.js
// npm install storyblok-js-client
const StoryblokClient = require('storyblok-js-client')
// Initialize the client with the oauth token so you're
// authenticated for the management API
const Storyblok = new StoryblokClient({
oauthToken: 'YOUR_OAUTH_TOKEN'
})
const spaceId = 'your_space_id'
let page = 1
View plugin-with-data.js
const Fieldtype = {
mixins: [window.Storyblok.plugin],
data() {
return {
ich_bin_eine_state_variable_die_nicht_im_model_beinhaltet_ist: true,
ich_darf_nicht_model_heissen: true
}
},
template: `<div>
<input class="uk-width-1-1" v-model="model.example" />
View demo-plugin.js
const Fieldtype = {
mixins: [window.Storyblok.plugin],
template: `<div>
<markdown-field :uid="uid" :model="model.original" :schema="schema" @changed="update" key="original"></markdown-field>
</div>`,
methods: {
initWith() {
return {
plugin: 'markdown-html',
original: '',
View get-all-spaces.js
// npm install storyblok-js-client
const StoryblokClient = require('storyblok-js-client')
// Initialize the client with the oauth token so you're
// authenticated for the management API
const Storyblok = new StoryblokClient({
oauthToken: 'YOUR_OAUTH_TOKEN'
})
const start = async () => {
@DominikAngerer
DominikAngerer / index.vue
Created Feb 15, 2019
Nuxt _language/index.vue
View index.vue
<template>
<section class="util__container">
<component v-if="story.content.component" :key="story.content._uid" :blok="story.content" :is="story.content.component"></component>
</section>
</template>
<script>
export default {
data () {
return { story: { content: {} } }
You can’t perform that action at this time.