Skip to content

Instantly share code, notes, and snippets.

View ianwhite's full-sized avatar

Ian White ianwhite

View GitHub Profile
@ianwhite
ianwhite / README.md
Created November 30, 2020 03:11 — forked from leastbad/README.md
Choices.js Stimulus wrapper preview

Choices.js Stimulus wrapper

https://joshuajohnson.co.uk/Choices/

Soon, this will be published as an NPM package, but there's an absence of documentation right now. It supports almost all functions from the original library; soon it will support 100% of them.

This wrapper adds Ajax pre-fetch search. Happens if controller has a data-search-path attribute.

Stimulus controller targets use new v2 syntax. Controller attaches a reference to itself on the element so that you can access the internal state from external scripts.

@ianwhite
ianwhite / sphinx.rb
Last active May 12, 2016 14:11 — forked from leemeichin/sphinx.rb
Sphinx 0.9.9 OS X
require 'formula'
class Libstemmer < Formula
# upstream is constantly changing the tarball,
# so doing checksum verification here would require
# constant, rapid updates to this formula.
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz'
homepage 'http://snowball.tartarus.org/'
end
describe WarrantyClaimWorkflow do
it "yields a SuccessResult" do
should_receive :succeeded
subject.handle(event_that_succeeds) do |result|
result.on_success { succeeded }
end
end
it "yields a FailureResult" do
should_not_receive :succeeded
Smoke.feed(:twitter) do
url "http://twitter.com/statuses/user_timeline/14431882.rss"
discard :title, /(@|#)/
end
Smoke.feed(:delicious) do
url "http://feeds.delicious.com/v2/rss/bschwarz?count=15"
end
Smoke.data(:flickr) do
# just using ruby (see below) makes for a pretty easy fix in this case, but it could
# get pretty ugly pretty quick which a real world case. Having a 'One True Namespace'
# for conditions would keep the ugly at bay.
#
# So, I think I like the idea of using named_scope as a namespace for conditions (ie
# Luke's idea)
class Tag
has_many :taggings
end