Skip to content

Instantly share code, notes, and snippets.

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@riddla
riddla / RefreshContent.js
Last active Feb 21, 2020
Triggering Gatsbys __refresh webhook via a React component (ENABLE_GATSBY_REFRESH_ENDPOINT=true)
View RefreshContent.js
import React, { useState } from 'react'
import { setConfig } from 'react-hot-loader'
let style = {
position: 'fixed',
cursor: 'pointer',
top: 0,
right: 0,
background: 'green',
color: 'white',
@riddla
riddla / SketchSystems.spec
Last active Feb 18, 2020
User Registration
View SketchSystems.spec
User Registration
Pending*
startConfirmationFlow -> Confirmation Flow
deny -> Denied
Confirmation Flow
Fetch Customer Brands
brandsReceived -> Approved
empty -> Partner has no brands
failed -> Api Error
@riddla
riddla / gs-xpswd
Created Jun 11, 2019 — forked from wigging/gs-xpswd
remove password from pdf file using ghostscript
View gs-xpswd
# Ghostscript command to remove the password from an encrypted pdf document.
# Replace ENCRYPTED.pdf with the path to your password protected pdf file.
# The unencrypted file is created as OUTPUT.pdf in the same directory.
# Install Ghostscript on the Mac with brew install gs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f ENCRYPTED.pdf
@riddla
riddla / SketchSystems.spec
Last active Mar 20, 2019
BulkPurchaseInquiryForm&
View SketchSystems.spec
BulkPurchaseInquiryForm&
data
invalid*
VALID_DATA -> valid
valid
INVALID_DATA -> invalid
RESET -> invalid
input
pristine*
USER_INPUT -> dirty
@riddla
riddla / .eslintrc.js
Created Feb 27, 2019
ESLint config for TypeScript and Vue
View .eslintrc.js
module.exports = {
root: true,
env: {
node: true
},
extends: [
'prettier',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
@riddla
riddla / app.conf
Last active Feb 27, 2019
Switch between localhost and container node application in "dockered" NGINX
View app.conf
upstream node-app {
# Enable this to use theserver running inside docker
# server node-app:3000;
# Enable this to use the (development) server running on your localhost
server host.docker.internal:3000;
}
server {
location / {
View products.json
{
"1": {
"entity_id": "1",
"type_id": "simple",
"sku": "dress_test",
"status": "1",
"visibility": "4",
"tax_class_id": "2",
"weight": "1.0000",
"price": "1500.0000",
@riddla
riddla / index.html
Created Nov 6, 2017 — forked from kentcdodds/index.html
The one true react boilerplate
View index.html
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
@riddla
riddla / docker-compose.yml
Created May 5, 2017
Develop Jekyll sites via Docker (and Jekyll::Livereload)
View docker-compose.yml
version: '2'
services:
blog:
image: jekyll/jekyll
command: jekyll serve --livereload
ports:
- "4000:4000"
- "35729:35729"
volumes:
- .:/srv/jekyll