Skip to content

Instantly share code, notes, and snippets.

// About
// This script exports all stories as XML in a specific folder
// -------
// How to install?
// 1. Create a folder for the project and inside a "data" folder
// 2. $ npm init
// 3. $ npm install storyblok-js-client --save
// 4. Exchange SPACE_ID and TOKEN and startWith
// 5. $ node index.js
@onefriendaday
onefriendaday / backup.js
Last active January 22, 2018 18:26
Nodejs backup example
// Simple backup example in node.js
//
// How to use:
// npm install storyblok-js-client
//
// Create the folder 'backup'
//
// Create the file 'backup.js' and execute
// node ./backup.js
const StoryblokClient = require('storyblok-js-client')
let Storyblok = new StoryblokClient({
accessToken: 'YOUR_TOKEN'
})
let lastPage = 1
for (var i = 1; i <= lastPage; i++) {
await Storyblok.get('cdn/stories', {
module.exports = {
watch: {
'model': {
handler: function (value) {
this.$emit('changed-model', value)
},
deep: true
}
},
created: function() {
@onefriendaday
onefriendaday / html
Created November 22, 2017 16:16
Storyblok Standalone
<!DOCTYPE html>
<html>
<head></head>
<body>
<link href='//app.storyblok.com/css/index-latest.css' rel='stylesheet' type='text/css'></link>
<div id="root"></div>
<div id="page-load"><div><div></div></div></div>
<script type="text/javascript" src="//app.storyblok.com/js/app-latest.js"></script>
</body>
</html>
@onefriendaday
onefriendaday / regex-slug
Created November 10, 2017 13:22
Regex that destroys everything
/\A[A-Za-z0-9]+(?:(_*|-*|:)[A-Za-z0-9]+)*\z/
@onefriendaday
onefriendaday / 01_install_dynatrace.config
Created October 5, 2017 11:39
Dynatrace ElasticBeanstalk Config with Rails Stack and Nginx
container_commands:
01_install_dynatrace_oneagent:
command: "[ -d /opt/dynatrace/oneagent ] || /tmp/Dynatrace-OneAgent.sh"
cwd: /tmp
02_reload_nginx:
command: "service nginx restart"
files:
"/tmp/Dynatrace-OneAgent.sh":
mode: "000755"
owner: root
@onefriendaday
onefriendaday / gulpfile.js
Created February 21, 2017 13:25
Uikit scss transform
var pkg = require('./package.json'),
fs = require('fs'),
path = require('path'),
glob = require('glob'),
mkdirp = require('mkdirp'),
gulp = require('gulp'),
gutil = require('gulp-util'),
concat = require('gulp-concat'),
ignore = require('gulp-ignore'),
rename = require('gulp-rename'),
@onefriendaday
onefriendaday / Rails
Created September 17, 2016 16:33
Rails
Completed 100 requests
Completed 200 requests
Finished 200 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3002
Document Path: /pages
Server Software:
Server Hostname: localhost
Server Port: 3000
Document Path: /de/home/
Document Length: 11180 bytes
Concurrency Level: 20
Time taken for tests: 7.859 seconds
Complete requests: 200