Skip to content

Instantly share code, notes, and snippets.

View valdemarua's full-sized avatar

Volodymyr valdemarua

View GitHub Profile
@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
----------------------------------*/
@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
uk:
devise:
confirmations:
confirmed: "Ваш обліковий запис підтверджено. Ви увійшли в систему."
send_instructions: "Ви отримаєте лист з інструкціями по підтвердженню вашого облікового запису протягом декількох хвилин."
send_paranoid_instructions: "Якщо Ваша email адреса існує в нашій базі даних, то протягом декількох хвилин Ви отримаєте лист з інструкціями по підтвердженню Вашого облікового запису."
failure:
already_authenticated: "Ви вже увійшли в систему."
inactive: "Ваш обліковий запис ще не активований."
invalid: "Невірний email чи пароль."
@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
@rujmah
rujmah / rails_with_rspec_mongoid.md
Last active March 4, 2023 14:59
Quick setup for rails/rspec/mongoid spec_helper

dev bit of Gemfile

group :development, :test do
  gem "rspec-rails"
  gem 'capybara'
  gem 'factory_girl_rails'
  gem 'forgery'
  gem "database_cleaner"
  gem "mongoid-rspec"
@iamatypeofwalrus
iamatypeofwalrus / bootstrap_glyphs_in_rails.md
Last active November 30, 2024 00:22
Get Glyphicons up and running in Rails 3.2 without using a gem

Getting Glyphicons from Bootstrap 3.0 in Rails: the easy way

What

Bootstrap 3.0 gives you access to the awesome icon set icon set by these dudes but it's not obvious for a Rails newbie like myself to get it all working together nicely

How

  1. Download the bootstrap-glyphicons.css from here. Save that file to RAILS_ROOT/vendor/assets/stylesheet/bootstrap-glyphicons.css
  2. Save all the font files in /dist/fonts from the Bootstrap 3.0 download to a new folder in your Rails app RAILS_ROOT/vendor/assets/fonts
  3. Add this folder to the asset pipeline by appending config.assets.paths << Rails.root.join("vendor","assets", "fonts") to application.rb after the line that has class Application < Rails::Application.
  4. In bootstrap-glyphicons.css modify the the `url
@rahul100885
rahul100885 / screen_size.rb
Created October 13, 2013 18:44
Set browser screen size in rspec + capybara suite for responsive web design test.
# spec/support/screen_size.rb
module ScreenSize
SCREENS = {
small: { width: 590 , height: 768 },
medium: { width: 1025, height: 768 },
large: { width: 1280, height: 768 }
}
@XVilka
XVilka / TrueColour.md
Last active October 9, 2025 17:55
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@stevenyap
stevenyap / RailsAdmin.md
Created February 21, 2014 08:49
Rails Admin

Extracting model configuration

# app/models/booking.rb
class Booking
  include RailsAdmin::Booking
end

# app/models/concerns/rails_admin/booking.rb
module RailsAdmin::Booking