Skip to content

Instantly share code, notes, and snippets.

View cachrisman's full-sized avatar

Charlie Chrisman cachrisman

View GitHub Profile
[
{
"sys": "...",
"fields": {
"name": "Root",
"subcategory": [
{
"sys": "...",
"fields": {
"name": "Painting",
{
"sys": {
"type": "Array"
},
"total": 4,
"skip": 0,
"limit": 100,
"items": [
{
"sys": {
{
"sys": {
"type": "Array"
},
"total": 4,
"skip": 0,
"limit": 100,
"items": [
{
"sys": {
(function(extension) {
if (typeof showdown !== 'undefined') {
// global (browser or nodejs global)
extension(showdown);
} else if (typeof define === 'function' && define.amd) {
// AMD
define(['showdown'], extension);
} else if (typeof exports === 'object') {
// Node, CommonJS-like
module.exports = extension(require('showdown'));
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- UI Extensions CSS -->
<link rel="stylesheet" href="//contentful.github.io/ui-extensions-sdk/cf-extension.css">
<!-- UI Extensions SDK -->
<script src="//contentful.github.io/ui-extensions-sdk/cf-extension-api.js"></script>
<style>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title>Comments</title>
@cachrisman
cachrisman / index.js
Created June 5, 2018 09:02
Contentful Alexa Lambda Function
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = process.env.APP_ID;
const contentful = require('contentful')
const contentfulClient = contentful.createClient({
space: process.env.SPACE,
@cachrisman
cachrisman / contentful_delete_many_entries.js
Created October 27, 2020 14:48
A simple script to delete all the draft entries of the specified content type in Contentful
(async () => {
const contentful = require('contentful-management')
const parallel = require('async-parallel');
// change these to match your info
const space_id = 'your-space-id'
const environment_id = 'your-env-id'
const content_type = 'your-content-type-id'
const cmaToken = 'your-CMA-token'
const concurrency = 3 // adjust down if you are seeing many rate limit warnings
@cachrisman
cachrisman / fastly-datacenters.json
Created January 18, 2022 09:28
Fastly Datacenters JSON
[
{
"code": "AMS",
"name": "Amsterdam",
"group": "Europe",
"coordinates": {
"x": 0,
"y": 0,
"latitude": 52.308613,
"longitude": 4.763889
@cachrisman
cachrisman / data.csv
Last active February 10, 2022 14:59 — forked from grncdr/data.csv
Demo of importing a CSV file into a Contentful space
product name product description