Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@artem-mindrov
artem-mindrov / calc-table-size.py
Last active November 7, 2018 15:47
Rough estimation of a C* table size
#!/usr/bin/env python
import subprocess, shlex, re
from argparse import ArgumentParser
def tsize(type):
sizes = {
("text", "varchar", "inet", "varint", "blob", "uuid", "timeuuid"): 16,
("bigint", "date", "decimal", "double", "timestamp", "time"): 8,
@artem-mindrov
artem-mindrov / tags_controller.rb
Last active December 15, 2015 10:49
Helper for testing jquery tokeninput with Selenium & Capybara
class TagsController < ApplicationController
before_filter :authenticate_user!
respond_to :json
def index
q = params[:tag]
if q =~ %r{,|;}
q.gsub!(%r{(,|;).*}, "")
ActsAsTaggableOn::Tag.find_or_create_by_name(q)