Skip to content

Instantly share code, notes, and snippets.

View iurev's full-sized avatar
😸
🍚

Vitalii Yulieff iurev

😸
🍚
  • Lisbon, Portugal
  • 17:43 (UTC +01:00)
View GitHub Profile
@iurev
iurev / gems.md
Last active December 20, 2015 16:49 — forked from Nitrino/gems.md
Исправлена опечатка

Список используемых гемов:

  1. active_admin - создание админки
  2. better_errors - заменяет стандартные ошибки Rails
  3. bullet - помогает отследить моменты где происходит N+1 запросов и нужно использовать eager loading
  4. cancan - гем для авторизации и прав пользователя
  5. the role - авторизации для 4х рельс, мне нарвится больше чем cancan
  6. client_side_validations - автоматически создаёт JavaScript валидацию на клиенте из существующих серверных валидаций. Очень классная штука. скринкаст: http://railscasts.com/episodes/263-client-side-validations
  7. devise - аутeнтификация пользователей.
  8. factory_girl - создание фабрик, замена стандартным fixtures
@iurev
iurev / gist:7214019
Created October 29, 2013 12:47
Very good chunk of code for debug :)
def np(*args)
puts args
Notifier.notify(
image: '/home/wwju/logo.png',
title: 'Ruby',
message: "#{args.join(', ')}"
)
end
@iurev
iurev / designer.html
Created July 18, 2014 07:46
designer
<link rel="import" href="../cool-clock/cool-clock.html">
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@iurev
iurev / designer.html
Created July 18, 2014 08:26
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
<template>
FROM ubuntu
# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
RUN apt-get -yqq update
select e.*
from (
select department, max(salary) as max_salary
from employee
group by department
) d
join employee e
on e.salary = d.max_salary;
def translate(text)
text = 'Блокнот в клетку'
response = Faraday.post("https://translation.googleapis.com/language/translate/v2?key=#{ENV['GOOGLE_CLOUD_API_KEY']}") do |req|
req.headers['Content-Type'] = 'application/json'
req.body = {
q: text,
target: 'en',
}.to_json
end

Keybase proof

I hereby claim:

  • I am iurev on github.
  • I am wwjurew (https://keybase.io/wwjurew) on keybase.
  • I have a public key whose fingerprint is 5660 24FF E316 2BBF AEE8 1E3E 1C68 BA70 D0EA 9B85

To claim this, I am signing this object:

[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_