Skip to content

Instantly share code, notes, and snippets.

View valdemarua's full-sized avatar

Volodymyr valdemarua

View GitHub Profile
@mpeteuil
mpeteuil / rubocop_pre_commit_hook
Created August 3, 2013 17:44
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
uk:
devise:
confirmations:
confirmed: "Ваш обліковий запис підтверджено. Ви увійшли в систему."
send_instructions: "Ви отримаєте лист з інструкціями по підтвердженню вашого облікового запису протягом декількох хвилин."
send_paranoid_instructions: "Якщо Ваша email адреса існує в нашій базі даних, то протягом декількох хвилин Ви отримаєте лист з інструкціями по підтвердженню Вашого облікового запису."
failure:
already_authenticated: "Ви вже увійшли в систему."
inactive: "Ваш обліковий запис ще не активований."
invalid: "Невірний email чи пароль."
@rainchen
rainchen / admin_user.rb
Created November 16, 2012 02:05
add auto complete in ActiveAdmin
ActiveAdmin.register AdminUser do
# define routes for "autocomplete :admin_user, :email"
collection_action :autocomplete_admin_user_email, :method => :get
controller do
autocomplete :admin_user, :email
end
index do
column :email
@madeinspace
madeinspace / jQuery UI Autocomplete custom CSS
Created July 18, 2012 06:33
jQuery UI Autocomplete custom CSS
/* Autocomplete
----------------------------------*/
.ui-autocomplete { position: absolute; cursor: default; }
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/* Menu
----------------------------------*/
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection
@MicahElliott
MicahElliott / rbenv-howto.md
Created April 17, 2012 18:11
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@daz
daz / style.scss
Last active May 13, 2023 11:24 — forked from kevindavis/gist:1868651
Bootstrap styling for jQuery UI autocomplete
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
@rstacruz
rstacruz / index.md
Last active August 2, 2025 18:42
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@kolodiazhnyi
kolodiazhnyi / Devise.uk.yml
Created December 20, 2011 19:04
Ukrainian translation for Devise plugin
uk:
errors:
messages:
expired: "прострочено, створіть новий"
not_found: "не знайдено"
already_confirmed: "вже було підтверджено, спробуйте увійти"
not_locked: "не було заблоковано"
not_saved:
one: "Виникла помилка, через яку неможливо зберегти зміни:"
other: "Виникли помилки (загалом - %{count}), через які неможливо зберегти зміни:"
@cblunt
cblunt / Gemfile
Created October 21, 2011 08:55
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL