A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
#!/bin/bash | |
# Merge multiple repositories into one big monorepo. Migrates every branch in | |
# every subrepo to the eponymous branch in the monorepo, with all files | |
# (including in the history) rewritten to live under a subdirectory. | |
# | |
# To use a separate temporary directory while migrating, set the GIT_TMPDIR | |
# envvar. | |
# | |
# To access the individual functions instead of executing main, source this |
This diff is a modified version of a diff written by Rüdiger Sonderfeld. | |
The original diff can be found here: | |
http://emacs.1067599.n5.nabble.com/RFC-Add-tty-True-Color-support-tt299962.html | |
To enable the feature one must set one of 2 environment variables either | |
ITERM_24BIT or KONSOLE_DBUS_SESSION. The former will enable ITU T.416 mode, the | |
latter will use semi-colon seperators used by other terminals (and also | |
supported by iterm development branch). |
# Nginx proxy for Elasticsearch + Kibana | |
# | |
# In this setup, we are password protecting the saving of dashboards. You may | |
# wish to extend the password protection to all paths. | |
# | |
# Even though these paths are being called as the result of an ajax request, the | |
# browser will prompt for a username/password on the first request | |
# | |
# If you use this, you'll want to point config.js at http://FQDN:443/ instead of | |
# http://FQDN:9200 |
#!/bin/bash | |
# | |
# crashplanFixup.sh for Macintosh OS X 10.9 (and probably earlier versions) | |
# | |
# This script will prevent CrashPlan from de-duplicating data on files greater than 1k. | |
# Based on information from http://networkrockstar.ca/2013/09/speeding-up-crashplan-backups/ | |
# | |
# NOTE: Must be run with sudo! IE: $ sudo sh ./crashplanFixup | |
# | |
# v1.1 2014-03-13 by [email protected] |
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
$ /Developer/usr/bin/momc simpleTextMessageModel.xcdatamodel simpleTextMessageModel3.mom |