Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
## SqliteFullTextSearch Concern | |
# | |
# The `SqliteFullTextSearch` concern provides a set of methods and triggers to enable full-text search capabilities for ActiveRecord models using SQLite's FTS5 extension. | |
# | |
# ### Key Features | |
# - **Full-Text Search Scope**: Adds a `search` scope to the model for performing full-text searches. | |
# - **Index Creation and Management**: Automatically creates and manages FTS5 tables and triggers for the model. | |
# - **Attribute Configuration**: Allows specifying attributes to include in the full-text search index. | |
# - **Trigger Management**: Sets up triggers to keep the search index up-to-date with model changes. | |
# |
# Adapted from StackOverflow answers: | |
# http://stackoverflow.com/a/8477067/1319740 | |
# and | |
# http://stackoverflow.com/a/18113090/1319740 | |
# With help from: | |
# http://technicalpickles.com/posts/parsing-csv-with-ruby/ | |
# A small rake task that validates that all required headers are present in a csv | |
# then converts the csv to an array of hashes with column headers as keys mapped | |
# to relevant row values. |
#!/bin/sh | |
# This file is `.git/hooks/format-ruby` and it has been `chmod +x`'d | |
# Assumption: https://github.com/testdouble/standard is in your Gemfile | |
set -e | |
rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "*.rake" "Gemfile" "Rakefile" | tr '\n' ' ') | |
[ -z "$rubyfiles" ] && exit 0 | |
# Standardize all ruby files |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
find . -name "*.epub" -exec sh -c 'ebook-convert "{}" "$(dirname "{}")/$(basename -s .epub "{}").mobi" &' \; |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |