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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
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 voteMachine = Machine({ | |
id: "Phone Voting", | |
initial: "idle", | |
context: {}, | |
states: { | |
idle: { | |
on: { | |
CALL_ANSWERED: "greetingMsg" | |
} | |
}, |
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
set -g default-terminal "tmux-256color" |
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
# run `brew bundle --file=path/to/this/Brewfile` to install these deps for PHP | |
brew "bison" | |
brew "icu4c" | |
brew "libiconv" | |
brew "openssl" | |
brew "libpq" | |
brew "zlib" |
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
import React from "react"; | |
import { render } from "react-dom"; | |
import { ApolloClient, ApolloProvider } from "react-apollo"; | |
import UserProfile from "user-profile" | |
const client = new ApolloClient(); | |
const reactRoot = document.getElementById("react-root"); | |
// Wrap components at the top level with ApolloProvider - this allows us |
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
brew services stop postgresql | |
initdb /usr/local/var/postgres9.6 -E utf8 | |
pg_upgrade -d /usr/local/var/postgres -D /usr/local/var/postgres9.6 -b /usr/local/Cellar/postgresql/9.5.5/bin -B /usr/local/Cellar/postgresql/9.6.1/bin -v | |
mv /usr/local/var/postgres /usr/local/var/postgres9.5 | |
mv /usr/local/var/postgres9.6 /usr/local/var/postgres | |
brew services start postgresql |
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
class LetsEncryptResponse | |
ACME_ENDPOINT_REGEX = /\A\/\.well-known\/acme-challenge\/(?<challenge>.*)\z/ | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = Rack::Request.new env | |
if request.path.start_with?("/.well-known/acme-challenge/") | |
match = request.path.match ACME_ENDPOINT_REGEX |
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 POW_DST_PORT=19999 |
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
guard :rspec, cmd: 'bundle exec rspec', all_on_start: false, all_after_pass: false do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch(%r{spec/(spec|rails)_helper.rb}) { "spec" } | |
# Rails example | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] } | |
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } |
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
import { expect } from "chai"; | |
import reducer from "../../src/reducers/workspace"; | |
import { EDIT_ITEM } from "../../src/actions/workspace"; | |
describe("workspace reducer", () => { | |
it("handles EDIT_ITEM", () => { | |
const initialState = {}; | |
const action = { | |
type: EDIT_ITEM, | |
itemIndex: 1 |
NewerOlder