Skip to content

Instantly share code, notes, and snippets.

@janjiss
janjiss / convert-png-to-webp
Created November 6, 2017 08:11 — forked from jonjensen/convert-png-to-webp
Batch convert PNG files to WebP in 1 directory
#!/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
# cd to the directory of the image so we can work with just filenames
dir="$(dirname "$1")"
cd "$dir" || exit 1
base="$(basename "$1" .jpg)"
# create a WebP version of the PNG
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { Raw, Editor } from 'slate'
const initialState = {
nodes: [
{
kind: "block",
type: "paragraph",
nodes: [
// Join together lists that don't have
// any blocks in-between
{
match: (node) => {
return node.kind == 'document'
},
validate: (document) => {
const joinableNode = document.nodes.find((node, key) => {
if (!['ordered-list', 'unordered-list'].includes(node.type)) { return false }
{
match: (node) => {
return node.kind == 'document'
},
validate: (document) => {
let previousNodeType = null
const joinableNode = document.nodes.find((node, key) => {
if (node.type === 'ordered-list' || node.type === 'unordered-list') {
console.log(node.type)
➜ massager git:(master) rspec spec
Massager
has a version number
Regular attributes
does not conflict with two classes with same attributes
works without type conversions
works with type checking
does the typechecking after the block has been executed
supports multiple attributes
WebSocket connection to 'ws://vlablabla.elb.amazonaws.com/socket/websocket?token=abc&vsn=1.0.0' failed: Error during WebSocket handshake: Unexpected response code: 400
1) SERVICE - AccountManager #createOrFindUser sad path should fail because of inviting himself:
AssertionError: expected {} to deeply equal { Object (email) }
+ expected - actual
-{}
+{
+ "email": "You are trying to invite yourself."
+}
Chain.call(
[
function(chain){
// this gets called
chain.continue();
},
function(chain){
// this gets called
chain.stop();
},
describe Notifier do
it "sends a message to a gateway" do
gateway = instance_double(Gateway)
expect(gateway).to receive(:call)
input = "My random input again"
Notifier.new(input: input, gateway: gateway)
end
end
input = "SOME INPUT FORM WHATEVER"
Notifier.new(input: input).call