Skip to content

Instantly share code, notes, and snippets.

View goozler's full-sized avatar

Krutov Alexander goozler

  • Castle Digital Partners
View GitHub Profile

Keybase proof

I hereby claim:

  • I am goozler on github.
  • I am goozler (https://keybase.io/goozler) on keybase.
  • I have a public key ASBjdzXFEF_d6RLqZ0RSOt1dvZMW2ySSImV9-WxSKsiEqwo

To claim this, I am signing this object:

@goozler
goozler / _form.html.haml
Created March 25, 2016 09:07
Create user with profile and role
.row
.col-xs-5
= simple_form_for(@manager, url: @url, as: :manager) do |f|
.form-inputs
= f.input :username
= f.input :email
= f.input :password, hint: password_hint
= f.input :password_confirmation
= simple_fields_for @manager.profile do |p|
= p.input :last_name

Keybase proof

I hereby claim:

  • I am Goozler on github.
  • I am goozler (https://keybase.io/goozler) on keybase.
  • I have a public key whose fingerprint is F98D F8DC 11B6 564E 75FF 538A 59ED C8D5 AC4E 585F

To claim this, I am signing this object:

@goozler
goozler / staticbar.chartjs.coffee
Created June 26, 2015 08:05
StaticBars for charts.js (undescore need)
Chart.types.Bar.extend
name: 'StaticBar'
draw: ->
if _.isNumber(@options.barWidth)
datasets = @datasets.length
columns = @datasets[0].bars.length
bars = columns * datasets
barsWidth = bars * @options.barWidth
datasetSpacing = @options.barDatasetSpacing * columns * (datasets - 1)
paddings = @scale.xScalePaddingRight + @scale.xScalePaddingLeft
@goozler
goozler / application.scss
Created February 17, 2015 07:25
Rails 4 fonts (webfonts.ru roboto example)
//= require fonts
@goozler
goozler / example.coffee
Last active September 20, 2019 05:49
JQuery helper for ActiveRecord errors with Bootstrap & SimpleForm
$form = $('form')
$formHelper = new FormHelper($form, 'foo')
$.ajax
type: 'post'
url: Routes.foos_path()
data: $form.serialize()
success: ->
$formHelper.clean()
$formHelper.reset()