Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bogdan/blog
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan committed Aug 23, 2014
2 parents 6cd6e23 + 0df0a53 commit d205496
Show file tree
Hide file tree
Showing 14 changed files with 176 additions and 79 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0
4 changes: 2 additions & 2 deletions _posts/2012-01-10-datagrid-reports-release-gem.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags:

[Datagrid](https://github.com/bogdan/datagrid) version 0.5.0 has been released.

Datagrid is a Ruby on Rails plugin that helps you to build and [represent table-like data](http://datagrid.heroku.com) with:
Datagrid is a Ruby on Rails plugin that helps you to build and [represent table-like data](http://datagrid.herokuapp.com) with:

* Customizable filtering
* Columns
Expand All @@ -23,7 +23,7 @@ Here are some major features from new release.

### Mongoid support

Previously Datagrid supported only ActiveRecord ORM. Now Mongoid is also available: [see the demo](http://datagrid.heroku.com/document_reports).
Previously Datagrid supported only ActiveRecord ORM. Now Mongoid is also available: [see the demo](http://datagrid.herokuapp.com/document_reports).

New datagrid driver architecture allows to add yet another ORM in less then [40 lines of code](https://github.com/bogdan/datagrid/blob/master/lib/datagrid/drivers/mongoid.rb).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $('#new_user').ajaxForm();
{% endhighlight %}

The main goal reached: Make super modern AJAX form is as easy as regular form.
If you still can't believe that it is so easy - check out [LIVE demo](http://ajaxsubmit.heroku.com).
If you still can't believe that it is so easy - check out [LIVE demo](http://ajaxsubmit.herokuapp.com).


## AjaxSubmit: Is it flexible?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ done
Before you commit:

* Check that database doesn't store any Class name that is under renaming. Apply migration in "Yes" case.
* Check for super-meta calls where class name or method name is constructed dynamically(you didn't do that, right?)
* Check for super-meta calls where class name or method name is constructed dynamically (you don't do it often, right?)
* Run your unit tests(you have some, yeah?) and check core pages before commit.
* Check diff with your version control system

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
layout: post
title: "Took part in a podcast with Alexey Vasiliev"
#published: false
tags:
- podcast
- opensource
- contribution
- datagrid
- ajaxsubmit
---

<p>
Last weekend I took part in the a podcast with Alexey Vasiliev. We talked about my path in Open Source, Rails and IT industry in ukraine.

</p>
<p>
It is all in Russian.
You can listen it here:
<br/>
<strong>
<a href="http://www.rwpod.com/posts/2014/05/24/cafe-002.html">http://www.rwpod.com/posts/2014/05/24/cafe-002.html</a>
</strong>
</p>

<!--more-->



14 changes: 14 additions & 0 deletions _posts/2014-07-25-rubyc-conference-video-parsers-slides.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: post
title: "My Talk from RubyC conference"
tags:
- slides
- video
- conference
- parsers
---

Here is a video from the excellent [Rubyc](http://rubyc.eu/) conference. Hope you will find this video funny as well:
[All about parsers in ruby](https://www.youtube.com/watch?v=OlXdngQUix8)
<!--more-->

43 changes: 25 additions & 18 deletions main.otl
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ Home
30x40
Large ceramic knife
Kran
Verevka
Tolkalka
drums
umbrella
Toschi
Places to go on weekend?
Umbrella
daily
Trade Center
Dreamtown
OceanPlaza
Lesnaya
Ukraina
Globus
Bolshevik
Skymall
Park
Mariinskiy
Feofania
Slavy
Dubki
Dorogozhichi


daily
Grelka
Hot water
masg
dfi
Shipachki + silicon


OSS
Expand Down Expand Up @@ -70,7 +82,7 @@ OSS
Want to let you know about ajaxsubmit library.
This library is aimed to convert any regular web form into ajax web form.

http://ajaxsubmit.heroku.com
http://ajaxsubmit.herokuapp.com

I think it's done with some new level of flexibility that wasn't done before: checkout configuration and API documentation.
Rails
Expand All @@ -83,22 +95,18 @@ OSS
/rails/rake db:migrate
Check SQL select * from pv where price <= Infinity
Make rails raise exception if asset is used directly but not precompiled
#valid! method
Move mass assignment attributes to activemodel
Make increment thread safe
DateTime blow up a log

AR::Base#can_be_deleted?
has_many :tags, :accepts_nested_attributes => true
Resolve changelog merge problem
has_many :tags, :accepts_nested_attributes => true
Resolve changelog merge problem
#update_column to support hash argument
rake db:migrate:down STEP=
as_json(:id, :email, :active) api
Pass binds to AR::Base.conn.select_value
Minify backtrace for exceptions in rails console
model.attributes.except(:id, :created_at, :updated_at)
Document out resource(s) :as option
#update_column to support hash argument
Move #create! to the right spot
Checkout ugly link in bid introduction email
employer_bid_url(@bid)
Application.yml
Expand All @@ -110,18 +118,17 @@ OSS
pluck a hash
valid! debug message
red sql
'_id'.humanize
AR::Base#param_key
Sqlite millisecond hunting
where(:created_at => Date.today.beginning_of_day)
Rollback changes on transaction rollback
select with nil choices
https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/tags/select.rb#L36
Instantiate sti association build with class
offer.rewards.build(type: 'ReferralReward').class # => ReferralReward
https://github.com/rails/rails/pull/13606/files
User.order(:id).last(3) don't use SQL limiting
4.0 -> 4.1 routes.sites_path(:zz => {})
class Model < ActiveRecord::Base
change_table should execute alter table only once
Inverse scope like Campaign.not(:active)
VisitorOffer.joins(:offer).where(offers: { campaign_id: Site.first.campaigns }).to_sql

Rspec-rails
Subshell on rake spec
Expand Down
2 changes: 1 addition & 1 deletion pages/ajaxsubmit.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3 style="float: left">
<a target="_blank" href="https://github.com/bogdan/ajaxsubmit">Source code</a>
</h3>
<h3 style="margin: 0px 24px; float: left">
<a target="_blank" href="http://ajaxsubmit.heroku.com">Live DEMO</a>
<a target="_blank" href="http://ajaxsubmit.herokuapp.com">Live DEMO</a>
</h3>
<h3 style="float: left">
<a target="_blank" href="http://gusiev.com">Author Blog</a>
Expand Down
2 changes: 1 addition & 1 deletion slides/ajaxsubmit/one/01_slide.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Different approaches
* Show errors on hover
* Show errors in popup-like box with close button

[http://ajaxsubmit.heroku.com/](http://ajaxsubmit.heroku.com/)
[http://ajaxsubmit.herokuapp.com/](http://ajaxsubmit.herokuapp.com/)

!SLIDE

Expand Down
2 changes: 1 addition & 1 deletion slides/ajaxsubmit/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ <h1>Three variants of design:</h1>
</ul>


<p><a href="http://ajaxsubmit.heroku.com/">http://ajaxsubmit.heroku.com/</a></p></div>
<p><a href="http://ajaxsubmit.herokuapp.com/">http://ajaxsubmit.herokuapp.com/</a></p></div>
</div><div class="slide" data-transition="none"><div class="content" ref="one/01_slide/19">
<p><img src="/image/pointer.png"/></p>

Expand Down
2 changes: 1 addition & 1 deletion slides/datagrid/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ <h3>
</h3>
<h2>Demo</h2>
<h3>
<a href='http://datagrid.heroku.com'>datagrid.heroku.com</a>
<a href='http://datagrid.herokuapp.com'>datagrid.herokuapp.com</a>
</h3>
</section>
</div>
Expand Down
2 changes: 1 addition & 1 deletion slides/datagrid/views/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
%a{href: "http://github.com/bogdan/datagrid/wiki"} github.com/bogdan/datagrid/wiki
%h2 Demo
%h3
%a{href: "http://datagrid.heroku.com"} datagrid.heroku.com
%a{href: "http://datagrid.herokuapp.com"} datagrid.herokuapp.com


%script{:src => "http://lab.hakim.se/reveal-js/lib/js/head.min.js"}
Expand Down
77 changes: 50 additions & 27 deletions slides/parsers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1>P-A-R-S-E-R-S</h1>
<section>
<h3>Why?</h3>
<h3>Because best way to pass data from one App to another is</h3>
<h2>Serialization</h2>
<h2 class='fragment highlight green'>Serialization</h2>
<h5>
<strike>COM</strike>
<strike>RMI</strike>
Expand All @@ -60,10 +60,11 @@ <h3>One more less obvious reason</h3>
<h2 style='font-family: arial'>
... сейчас обсуждаем возможность сделать конфу более технической.
</h2>
<h2>So this talk required to be hardcore</h2>
<h2>So this talk required to be</h2>
<h1 class='fragment highlight red'>hardcore</h1>
</section>
<section>
<h3>Plan</h3>
<h1>Plan</h1>
<ul>
<li>Easy Part</li>
<li>Classification</li>
Expand All @@ -86,12 +87,18 @@ <h3>Regular Expression</h3>
</section>
<section>
<h3>Each regular expression can parse particular grammar</h3>
<h2>What is a grammar?</h2>
<h2>
What is a
<div class='highlight green'>grammar?</div>
</h2>
</section>
<section>
<h3>Regular expressions are great!</h3>
<h3>Their power is huge.</h3>
<h2>But what is the limit?</h2>
<h2>
But what is the
<div class='highlight red'>limit?</div>
</h2>
</section>
<section>
<h3>
Expand All @@ -105,8 +112,13 @@ <h2>
</section>
<section>
<h3>Regular expression can only parse something that could be parsed with one iteration</h3>
<h4>in other words</h4>
<h1>From Left to Right</h1>
<br>
<br>
<br>
<div class='fragment'>
<h4>in other words</h4>
<h2>From Left to Right</h2>
</div>
</section>
<section>
<h3>Several obvious examples</h3>
Expand Down Expand Up @@ -159,32 +171,32 @@ <h3>Grammar is regular if it don't contain "recursive" generators.</h3>
<section>
<h3>So what to do?</h3>
<h2>Not sure</h2>
<h3>the only one thing we know is that regular expressions will not help</h3>
<pre><code class='ruby'>def match_aabb_pattern?(string)&#x000A; string.each_char.with_index.each do |c, i|&#x000A; case c&#x000A; when 'a'&#x000A; count_a += 1&#x000A; when 'b'&#x000A; return count_a == string.size - i - 1&#x000A; else&#x000A; return false&#x000A; end&#x000A; end&#x000A; return false&#x000A;end&#x000A;</code></pre>
<h4>the only one thing we know is that regular expressions will not help</h4>
<pre style='font-size: 0.4em'><code class='ruby'>def match_aabb_pattern?(string)&#x000A; string.each_char.with_index.each do |c, i|&#x000A; case c&#x000A; when 'a'&#x000A; count_a += 1&#x000A; when 'b'&#x000A; return count_a == string.size - i - 1&#x000A; else&#x000A; return false&#x000A; end&#x000A; end&#x000A; return false&#x000A;end&#x000A;</code></pre>
</section>
<section>
<h3>This is where we understand the power of Regex's</h3>
<h2>And their limits</h2>
<h3>Writing parsers for non-regular grammars is a big problem</h3>
<h2>Regular Expressions</h2>
<h1>
<span class='highlight green'>Powers</span>
<span>&amp;</span>
<span class='highlight red'>Limits</span>
</h1>
</section>
<section>
<h2>Grammars/Parsers can be</h2>
<ul>
<li>
<h3>Regular</h3>
</li>
<li>
<h3>Recursive</h3>
</li>
</ul>
<h1>
<span class='highlight green'>Regular</span>
<span>&amp;</span>
<span class='highlight red'>Recursive</span>
</h1>
</section>
<section>
<h2>Getting close to real world examples</h2>
<img src='http://monosnap.com/image/1BfsQy5LwfhC4khKNTLjvTvnx2M58A.png'>
<h2>Regex are still possible</h2>
</section>
<section>
<h2>Regex are still possible</h2>
<h3>But not really in the long term</h3>
<h2>But not really in the long term</h2>
<img src='http://monosnap.com/image/7wOQJ9xYqaX6oxeCvOUZGDjT4Gq8Ve.png'>
</section>
<section>
Expand All @@ -194,7 +206,7 @@ <h2>Start from Tokenizing</h2>
<section>
<h2>Builing Abstract Syntax Tree (AST)</h2>
<h4>The Hardest Part</h4>
<pre>['12', <span class='highlight yellow'>'*'</span>, <span class='highlight green'>[</span><span class='highlight red'>'('</span>, '2', '+', '8' '/', '(', '13.5', '+', '7', ')', <span class='highlight red'>')'</span><span class='highlight green'>]</span> ]&#x000A;[left = '12', <span class='highlight yellow'>operator</span>, right = <span class='highlight green'>[</span>...<span class='highlight green'>]</span>]&#x000A;&#x000A;['12', '*', [ '2', '+', '8' '/', '(', '13.5', '+', '7', ')'] ]&#x000A;Cleanup useless brackets&#x000A;&#x000A;['12', '*', [ '2', '+', [ '8' '/', '(', '13.5', '+', '7', ')' ] ] ]&#x000A;# Repeat for right and left node&#x000A;&#x000A;['12', '*', [ '2', '+', [ '8' '/', [ '13.5', '+', '7', ] ]]]&#x000A;# Repeat for right and left node</pre>
<pre>['12', <span class='highlight yellow'>'*'</span>, <span class='highlight green'>[</span><span class='highlight red'>'('</span>, '2', '+', '8' '/', '(', '13.5', '+', '7', ')', <span class='highlight red'>')'</span><span class='highlight green'>]</span> ]&#x000A;[left = '12', <span class='highlight yellow'>operator</span>, right = <span class='highlight green'>[</span>...<span class='highlight green'>]</span>]&#x000A;&#x000A;['12', '*', [ '2', '+', '8' '/', '(', '13.5', '+', '7', ')'] ]&#x000A;Cleanup useless brackets <span class="highlight red">( )</span>&#x000A;&#x000A;&#x000A;['12', '*', [ '2', <span class="highlight yellow">'+'</span>, <span class="highlight green">[</span> '8' '/', '(', '13.5', '+', '7', ')' <span class="highlight green">]</span> ] ]&#x000A;# Repeat for right and left node&#x000A;&#x000A;['12', '*', [ '2', '+', [ '8', <span class="highlight yellow">'/'</span>, <span class="highlight green">[</span> '13.5', '+', '7', <span class="highlight green">]</span> ]]]&#x000A;# Repeat for right and left node</pre>
<ol>
<li>Find lowest priority operator</li>
<li>Split Array into 3 parts: left operand, operator, right operand</li>
Expand Down Expand Up @@ -304,7 +316,7 @@ <h4>They are so severe that created their own syntax</h4>
</div></pre>
</section>
<section>
<h2>Parser markup is compilable to ruby</h2>
<h2>Parser markup is compiled to ruby</h2>
<pre><code>racc -l -o parser.rb parser.y&#x000A;</code></pre>
<h3>
<a href='https://github.com/tenderlove/racc'>github.com/tenderlove/racc</a>
Expand All @@ -315,14 +327,25 @@ <h3>
</section>
<section>
<h2>Ukraine is having a hard time</h2>
<h3>How we can help? What others can not do?</h3>
<h5>
<p>
Software developers have unique opportunity to support economics of our country.
We are the only one that can really bring money to Ukraine.
</h5>
</p>
<h2>So, lets do our work better</h2>
<h5>And waste less money on new Smart Phones</h5>
</section>
<section>
<h2>Thanks for your attension</h2>
<h3>
<a href='http://gusiev.com'>http://gusiev.com</a>
</h3>
<h3>
<a href='http://github.com/bogdan'>http://github.com/bogdan</a>
</h3>
<h3>
<a href='http://gusiev.com/slides/parsers'>http://gusiev.com/slides/parsers</a>
</h3>
</section>
</div>
</div>
<script src='http://lab.hakim.se/reveal-js/lib/js/head.min.js'></script>
Expand Down
Loading

0 comments on commit d205496

Please sign in to comment.