Skip to content

Instantly share code, notes, and snippets.

View mbriggs's full-sized avatar

Matt Briggs mbriggs

View GitHub Profile
@mbriggs
mbriggs / git.vim
Last active November 5, 2019 02:17
nmap <leader>gg :Gstatus<cr>
nmap <leader>gb :Gblame<cr>
nmap <leader>gr :Grebase<cr>
nmap <leader>gp :Gpush<cr>
nmap <leader>gu :Gpull<cr>
nmap <leader>gw :Gbrowse<cr>
vmap <leader>gw :Gbrowse<cr>
nmap <leader>gb :Merginal<cr>
" gist
@mbriggs
mbriggs / fixture.rb
Created December 12, 2018 23:55
Take 2 on handler fixtures
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
@mbriggs
mbriggs / event_written.rb
Created September 3, 2018 18:27
Fixtures
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
@mbriggs
mbriggs / install-graphite
Created April 3, 2014 17:25
install graphite on mavericks
#!/usr/bin/env bash
# download and install xquartz https://xquartz.macosforge.org
# so deps
brew install cairo memcached
@mbriggs
mbriggs / redis.ex
Created April 12, 2016 03:08
redis client
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.rb
Created January 17, 2016 00:51
my rails helper for webpack dev server, and compiled into public
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}"
@mbriggs
mbriggs / anonymous-gist.js
Created January 17, 2016 00:52
production webpack config
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',
function bindRange(scope, el, attrs){
var getFrom = $parse(attrs.pickFrom);
var setFrom = getFrom.assign;
var getTo = $parse(attrs.pickTo);
var setTo = getTo.assign;
var time = hasTime(attrs);
function updateField(){
var from = getFrom(scope);
var to = getTo(scope);

Thoughts on Angular

Overall, very impressed by how far the have come in the last year and a half or so. They have addressed probably the biggest issue I had with it last time I looked (how clunky it was to create even simple directives), the community is MUCH larger then it was, which has mitigated the second biggest issue (insufficient documentation)

The things I don't like thing is kind of big, but thats because its a combination of "dont like" with "don't understand" and "doing completely wrong", and at this point I don't really know enough about it to tell the difference :)

Things I Like

  • The view reaching into the JS means there is a class of wiring up / coordination code that doesn't need to exist.
(ns scrape-kuvva.core
(:require [scrape-kuvva.kuvva :as kuvva])
(:require [scrape-kuvva.files :as files]))
(def timeout 2000)
(defn sync
"Download any wallpaper that is
a) downloadable
b) not already downloaded"