Skip to content

Instantly share code, notes, and snippets.

@alaghu
alaghu / InteractiveBug.js
Created January 9, 2017 19:20
Two objects Unable to access an object from another object.
/**
* Created by anallaal on 09-Dec.
*/
// This pattern is completely inspired from
// https://www.youtube.com/playlist?list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
// This is object literal pattern
// This object will Analyze the Interactive Report and obtain the list of bugs
var interactiveReportRegion = {
init: function () {
Anand:learn_jquery/ (webkit_tests_have_error_failing*) $ rspec -f d [22:35:27]
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Home page
Finished "EnableLogging()" with response "Success()"
Wrote response true ""
Received "SetTimeout(-1)"
Started "SetTimeout(-1)"
Finished "SetTimeout(-1)" with response "Success()"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
 (0.1ms) BEGIN
Started GET "/" for 127.0.0.1 at 2015-12-01 22:59:58 -0800
Processing by HomeController#index as HTML
Rendered home/index.html.erb within layouts/application (1.8ms)
Completed 200 OK in 166ms (Views: 159.0ms | ActiveRecord: 0.0ms)
Started GET "/assets/application.css" for 127.0.0.1 at 2015-12-01 22:59:58 -0800
Started GET "/assets/home_index.js" for 127.0.0.1 at 2015-12-01 22:59:58 -0800
Started GET "/assets/home_index.css" for 127.0.0.1 at 2015-12-01 22:59:58 -0800
Started GET "/assets/application.js" for 127.0.0.1 at 2015-12-01 22:59:58 -0800
ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
 (0.1ms) BEGIN
Started GET "/" for 127.0.0.1 at 2015-12-01 22:53:21 -0800
Processing by HomeController#index as HTML
Rendered home/index.html.erb within layouts/application (2.0ms)
Completed 200 OK in 182ms (Views: 175.2ms | ActiveRecord: 0.0ms)
Started GET "/assets/application.css" for 127.0.0.1 at 2015-12-01 22:53:21 -0800
Started GET "/assets/application.js" for 127.0.0.1 at 2015-12-01 22:53:21 -0800
Started GET "/assets/home_index.css" for 127.0.0.1 at 2015-12-01 22:53:21 -0800
Started GET "/assets/home_index.js" for 127.0.0.1 at 2015-12-01 22:53:21 -0800
Anand:learn_jquery/ (webkit_tests_have_error_failing*) $ rspec -f d [22:35:47]
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Home page
Finished "EnableLogging()" with response "Success()"
Wrote response true ""
Received "SetTimeout(-1)"
Started "SetTimeout(-1)"
Finished "SetTimeout(-1)" with response "Success()"
Started GET "/book/intro" for ::1 at 2015-11-03 05:55:10 -0800
Processing by BookController#show as HTML
Parameters: {"chapter"=>"intro"}
Rendered book/show.html.erb within layouts/application (0.0ms)
Completed 200 OK in 58ms (Views: 57.4ms | ActiveRecord: 0.0ms)
Started GET "/book/intro" for ::1 at 2015-11-03 05:56:36 -0800
Processing by BookController#intro as HTML
Rendered book/intro.html.erb within layouts/application (0.3ms)
Started GET "/book/selection" for 127.0.0.1 at 2015-11-04 05:13:11 -0800
Processing by BookController#show as HTML
Parameters: {"chapter"=>"selection"}
Rendered book/show.html.erb within layouts/application (0.0ms)
Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)
 (0.1ms) ROLLBACK
 (0.1ms) BEGIN
Started GET "/" for 127.0.0.1 at 2015-11-04 05:13:11 -0800
Processing by HomesController#index as HTML
Rendered homes/index.html.erb within layouts/application (0.2ms)
@alaghu
alaghu / html_source.html
Created May 14, 2014 13:49
Output of ERB
This is the out put of https://gist.github.com/alaghu/e7d8b7fe66b9ebea224a#file-erb_not_rendering_html-erb
<h3>sent_array</h3>
&lt;span class=&#x27;det&#x27;&gt;A&lt;/span&gt; &lt;span class=&#x27;nn&#x27;&gt;fleet&lt;/span&gt; &lt;span class=&#x27;in&#x27;&gt;of&lt;/span&gt; &lt;span class=&#x27;nns&#x27;&gt;warships&lt;/span&gt;
<h3>Sanitized</h3>
<span class="det">A</span> <span class="nn">fleet</span> <span class="in">of</span> <span class="nns">warships</span>
@alaghu
alaghu / erb_not_rendering_html.erb
Created May 14, 2014 13:44
The sent_array.join does not render it as a HTML
<% end %>
<h3>sentxml2</h3>
<%= sentxml %>
<h3>sent_array</h3>
<%= sent_array.join('') %>
@alaghu
alaghu / transform_in_pry.rb
Last active August 29, 2015 14:01
Using nokogiri to transferom a tokenized string to html
[4] pry(main)> require 'nokogiri'
=> false
[5] pry(main)> sentence_tagged = '<det>A</det> <nn>fleet</nn> <in>of</in> <nns>warships</nns><stop>.</stop>'
=> "<det>A</det> <nn>fleet</nn> <in>of</in> <nns>warships</nns><stop>.</stop>"
[6] pry(main)> sentence_xml = '<root>' + sentence_tagged + '</root>'
=> "<root><det>A</det> <nn>fleet</nn> <in>of</in> <nns>warships</nns><stop>.</stop></root>"
[7] pry(main)> nok_sent = Nokogiri::XML(sentence_xml)