Skip to content

Instantly share code, notes, and snippets.

GIT
remote: https://github.com/ankane/searchkick.git
revision: 15bd651d9b872de5dbf050b49d9d43dd8640e8c4
specs:
searchkick (3.1.0)
activemodel (>= 4.2)
elasticsearch (>= 5)
hashie
GIT
select engine, count(*) as tables, concat(round(sum(table_rows)/1000000,2),'M') rows, concat(round(sum(data_length)/(1024*1024*1024),2),'G') DATA, concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx, concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(sum(index_length)/sum(data_length),2) idxfrac from information_schema.TABLES where table_schema not in ('mysql', 'performance_schema', 'information_schema') group by engine ORDER BY sum(data_length+index_length) DESC LIMIT 10 ;
@brettallred
brettallred / gist:10224733
Last active August 29, 2015 13:58
Search and Replace Image Tags
# Create Site
# Copy Theme
# Copy theme assets to /public/samples
# Copy theme html to /app/views/pages/theme
# Run scripts to replace all references to /samples/*
# Run site in wagon and correct any errors
# Change files from HTML to Liquid
@brettallred
brettallred / .vimrc
Last active December 27, 2015 00:39
vimrc
" colorscheme
syntax on
let g:solarized_termtrans = 1
set background=dark
colorscheme solarized
set tw=100
set colorcolumn=3,5,7,9,80,100
let mapleader = ","
nnoremap <leader>ev :vsplit /Users/brett/.vimrc.after<cr>
nnoremap <leader>sv :source /Users/brett/.vimrc.after<cr>
@brettallred
brettallred / Layout.cs
Last active December 10, 2015 04:28
Helpers
public static class Layouts
{
private const string Folder = "~/Views/Layouts/";
public const string Root = Folder + "_Root.cshtml";
}
public class AbstractController : Controller
{
[SetterProperty]
public IDocumentSession Raven { get; set; }
#region Commands
protected void Execute(Command cmd)
{
cmd.Raven = this.Raven;