Skip to content

Instantly share code, notes, and snippets.

@karmi
karmi / prices.sh
Last active December 15, 2015 16:09 — forked from imotov/prices.sh
curl -XDELETE "localhost:9200/test"
curl -XPUT "localhost:9200/test" -d '{
"mappings": {
"doc": {
"properties": {
"price": {
"type": "long"
},
"colour": {
"type": "string",
@karmi
karmi / index.html
Last active December 18, 2015 15:19 — forked from clintongormley/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" />
<title>Elasticsearch stats analyzer</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="rules.js"></script>
<script type="text/javascript" src="stats.js"></script>
<script type="text/javascript" src="parser.js"></script>
<script type="text/javascript">

Store file uploads in the database

This gem allows to store carrierwave uploads in the database, eg. on platforms with ephemeral filesystems like Heroku.

Installation

# In: Gemfile
gem 'carrierwave-blob', git: "https://gist.github.com/f1dc8c75d67b92b23a55.git"
#!/usr/bin/env sh
# I've adapted this from the following, which was in turn adapted from the link
# below it:
# * https://raw.github.com/gist/2108403/hack.sh
# * https://github.com/mathiasbynens/dotfiles/blob/master/.osx
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
# defaults write NSGlobalDomain AppleKeyboardUIMode -int 3