Skip to content

Instantly share code, notes, and snippets.

@riddla
riddla / machine.js
Created June 16, 2021 10:36
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@riddla
riddla / RefreshContent.js
Last active February 21, 2020 16:50
Triggering Gatsbys __refresh webhook via a React component (ENABLE_GATSBY_REFRESH_ENDPOINT=true)
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 February 18, 2020 09:31
User Registration
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 June 11, 2019 11:23
remove password from pdf file using ghostscript
# 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 March 20, 2019 09:30
BulkPurchaseInquiryForm&
BulkPurchaseInquiryForm&
data
invalid*
VALID_DATA -> valid
valid
INVALID_DATA -> invalid
RESET -> invalid
input
pristine*
USER_INPUT -> dirty
@riddla
riddla / .eslintrc.js
Created February 27, 2019 07:28
ESLint config for TypeScript and Vue
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 February 27, 2019 07:30
Switch between localhost and container node application in "dockered" NGINX
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 / {
{
"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 November 6, 2017 08:15 — forked from kentcdodds/index.html
The one true react boilerplate
<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 08:43
Develop Jekyll sites via Docker (and Jekyll::Livereload)
version: '2'
services:
blog:
image: jekyll/jekyll
command: jekyll serve --livereload
ports:
- "4000:4000"
- "35729:35729"
volumes:
- .:/srv/jekyll