Skip to content

Instantly share code, notes, and snippets.

@eddiefisher
eddiefisher / admin.css.scss
Last active December 14, 2015 12:59
Ruby on Rails: nice style for ActiveAdmin
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body.active_admin {
form {
#{$all-text-inputs},textarea,select[multiple="multiple"] {
border: 1px solid #c9d0d6; @include rounded(3px); font-size: 1em; outline: none; padding: 5px 5px 7px; margin-bottom: 5px;
brew install imagemagick
if: checking for wand/MagickWand.h... no
then:
mdfind MagickWand.h
/usr/local/Cellar/imagemagick/•.•.•-•/include/ImageMagick/wand/MagickWand.h
C_INCLUDE_PATH=/path gem install rmagick
if: pkg-config: command not found
then: brew install pkg-config
#settings_tabs {
.tabs.table_tools_segmented_control { margin-bottom: 10px; }
fieldset.inputs {
padding: 0;
background: transparent;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
box-shadow: none;
-moz-box-shadow: none;
@eddiefisher
eddiefisher / currency_in_words_helper.rb
Created June 21, 2013 14:49
перевод на русский был портирован отсюда: http://habrahabr.ru/post/53210/
module CurrencyInWordsHelper
ActionView::Helpers::NumberHelper.class_eval do
DEFAULT_CURRENCY_IN_WORDS_VALUES = {:currencies=>{:default=>{:unit=>{:one=>'dollar',:many=>'dollars'},
:decimal=>{:one=>'cent',:many=>'cents'}}},
:connector=>', ',:format=>'%n',:negative_format=>'minus %n'}
# Formats a +number+ into a currency string (e.g., 'one hundred dollars'). You can customize the
# format in the +options+ hash.
#
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
# In your app's root.
# Make Pow!! export all the env variables contained in the .env file used by Foreman.
export $(cat .env)
@eddiefisher
eddiefisher / _form.html.slim
Created March 22, 2015 15:16
refile multiply file upload
= semantic_nested_form_for @gallery, multipart: true do |form|
= form.input :file_multiple, as: :file, input_html: { multiple: true }
= form.actions do
= form.action :submit

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@eddiefisher
eddiefisher / digitalocean.md
Last active August 29, 2015 14:25 — forked from JamesDullaghan/digitalocean.md
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email