Skip to content

Instantly share code, notes, and snippets.

Matt Briggs mbriggs

Block or report user

Report or block mbriggs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mbriggs
mbriggs / fixture.rb
Created Dec 12, 2018
Take 2 on handler fixtures
View fixture.rb
require_relative "../../automated_init"
context "Handle Commands" do
context "Added" do
context "Writes Added event" do
id = Controls::Account.id
account = Controls::Account::New.example
add = Controls::Commands::Add.example
time = Controls::Time::Processed.example
View event_written.rb
module Fixtures
class EventWritten
include TestBench::Fixture
attr_accessor :stream_name
attr_accessor :values
attr_accessor :command
attr_accessor :expected_version
attr_accessor :command_attributes
View redis.ex
defmodule Autobot.Redis do
import Exredis
def start_link do
Agent.start_link(fn ->
{:ok, client} = Exredis.start_link
client
end, name: __MODULE__)
end
@mbriggs
mbriggs / anonymous-gist.js
Created Jan 17, 2016
production webpack config
View anonymous-gist.js
var webpack = require('webpack');
var path = require('path');
var ManifestPlugin = require('webpack-manifest-plugin')
function root(fragment){
return path.join(__dirname, "client", fragment);
}
module.exports = {
devtool: 'source-map',
@mbriggs
mbriggs / anonymous-gist.rb
Created Jan 17, 2016
my rails helper for webpack dev server, and compiled into public
View anonymous-gist.rb
def include_js(file)
@_js_includes ||= {}
@_js_includes[file] ||= begin
manifest_path = Rails.root.join('public', 'assets', 'manifest.json')
if File.exist?(manifest_path)
manifest = JSON.parse(File.read(manifest_path))
path = "/assets/#{manifest[file]}"
else
path = "http://127.0.0.1:8080/#{file}"
View add_to_globals.py
import sublime
import sublime_plugin
import re
"""
___ __ __ __ ________ __ __
/ | ____/ /___/ / / /_____ / ____/ /___ / /_ ____ _/ /____
/ /| |/ __ / __ / / __/ __ \ / / __/ / __ \/ __ \/ __ `/ / ___/
/ ___ / /_/ / /_/ / / /_/ /_/ / / /_/ / / /_/ / /_/ / /_/ / (__ )
/_/ |_\__,_/\__,_/ \__/\____/ \____/_/\____/_.___/\__,_/_/____/
View gist:998d21a8de8719229e2b

Probably needs to be seed tables

spree_zones
spree_zone_members
spree_wrap_surface_aspect_ratios
spree_trackers
spree_tax_rates
spree_tax_categories
spree_styles
spree_states
View gist.vim
let g:gist_clip_command = 'pbcopy'
let g:gist_detect_filetype = 1
@mbriggs
mbriggs / anonymous-gist.clj
Created Sep 18, 2014
websockets with core.async and http-kit
View anonymous-gist.clj
(defn build-routes
[{:keys [bus queues] :as app-data}]
(routes
(GET "/data" req
; get an http-kit websocket channel for this request
(http/with-channel req req-ch
; make a channel for subscriptions to the data updated event bus
(let [metrics (async/chan)]
; subscribed to all messages in the updated topic
(async/sub bus :updated metrics)
View anonymous-gist.clj
(defn- deref2 [_ p] @p)
(defn gather!
[{:keys [queues]}]
(send queues deref2 (rabbit/get-queues)))
You can’t perform that action at this time.