Skip to content

Instantly share code, notes, and snippets.

@gemfarmer
gemfarmer / image_checker.rb
Last active March 28, 2017 18:23
File for checking if images are being used in a site. Best for static sites with build directories
# Find this on Github here: https://gist.github.com/gemfarmer/f3f2e35663b96cd3fa8d90b49e6216a0
require 'colorator' # Comment this out to run the script without colorator
built_path = '_site'
directory_name = 'tmp'
unique_path = 'check_images'
image_path = 'assets/img'
use_relative = false
ignore_removable = false
remove_all = false
@traumverloren
traumverloren / switch-to-rbenv.md
Last active March 29, 2024 00:54
Switch from RVM to rbenv

Switch from RVM to rbenv:

Get Rid of RVM if it's installed:

rvm implode

Cleanup your .bash_profile/.bashrc/.zshrc file to remove RVM from the path:

You should have something like this left from RVM. Delete it from the file. ``[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"```

@seanherron
seanherron / indexer.py
Created February 25, 2014 12:39
RIDB ES Indexer
from lxml import etree
from pyelasticsearch import ElasticSearch
es = ElasticSearch('http://localhost:9200/')
def RecArea(filename):
ns = etree.FunctionNamespace("http://www.recreation.gov/architecture/")
ns.prefix = "arc"
doc = etree.parse(filename)
for area in doc.xpath('//arc:RecArea'):