This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function createImage (image, space) { | |
try { | |
const result = await space.createAsset({ | |
sys: { | |
createdAt: image.created_at, | |
updatedAt: image.updated_at, | |
}, | |
fields: { | |
title: { 'en-US': image.title }, | |
file: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function modifyWebpackConfig (config) { | |
// arrow-body-style rule doesn't recognize that the spread operator needs | |
// to be in an object literal | |
// eslint-disable-next-line arrow-body-style | |
config.loader('jpg', (cfg) => { | |
return { | |
...cfg, | |
test: /\.jpe?g$/i, | |
loader: 'file-loader?name=images/[name].[ext]', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apm install atom-ternjs | |
apm install autocomplete-modules | |
apm install utocomplete-paths | |
apm install autocomplete-ruby | |
apm install autocomplete-sass | |
apm install build | |
apm install emmet | |
apm install file-icons | |
apm install gist-it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function modifyWebpackConfig (config) { | |
// Object.assign is not picked up as mutation by immutable linter ?! | |
config.loader('jpg', (cfg) => Object.assign( | |
cfg, | |
{ | |
test: /\.jpe?g$|\.gif$|\.png$/i, | |
loader: 'file-loader?name=images/[name].[ext]', | |
} | |
)) | |
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line immutable/no-mutation,no-unused-vars | |
exports.modifyWebpackConfig = function (config, env) { | |
config.removeLoader('json') | |
config.loader('json', (cfg) => { | |
// eslint-disable-next-line immutable/no-mutation,no-param-reassign | |
cfg.test = /\.json/ | |
// eslint-disable-next-line immutable/no-mutation,no-param-reassign | |
cfg.loaders= ['markdown', 'json'] | |
return cfg | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env babel-node | |
require('dotenv').config() | |
import contentful from 'contentful' | |
import fs from 'fs-extra-promise' | |
// Contentful Config | |
const apiToken = process.env.CONTENTFUL_DELIVERY_API_TOKEN | |
const spaceId = process.env.CONTENTFUL_SPACE_ID | |
const client = contentful.createClient({ accessToken: apiToken, space: spaceId }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sys": { | |
"space": { | |
"sys": { | |
"type": "Link", | |
"linkType": "Space", | |
"id": "changeme" | |
} | |
}, | |
"id": "changeme", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cabal: Entering directory '/var/folders/85/c3khd5g15nq5yy8_1m0s40y00000gn/T/cabal-tmp-26301/herbalizer-0.4.9' | |
Configuring herbalizer-0.4.9... | |
Building herbalizer-0.4.9... | |
Preprocessing executable 'herbalizer' for herbalizer-0.4.9... | |
[1 of 1] Compiling Main ( src/Main.hs, dist/build/herbalizer/herbalizer-tmp/Main.o ) | |
src/Main.hs:152:5: error: | |
• Non type-variable argument in the constraint: Stream s m Char | |
(Use FlexibleContexts to permit this) | |
• When checking the inferred type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs-extra') | |
exports.postBuild = function ign (pages, callback) { | |
console.log('in IGN!') | |
const file = 'testing' | |
fs.outputFile(file, 'works', (err) => { | |
console.log(err) | |
}) | |
callback() | |
} |