21 April 2014

The Ruby Reflector

Topic

JavaScript

  Source Favicon
By Claudio of DevInterface Blog 2 years ago.
Email

s. type = 'text/ javascript' ;

s. src = 'http://' + disqus_shortname + '.disqus.com/count.js' ;

( document. getElementsByTagName ( 'HEAD' ) [ 0 ] || document. getElementsByTagName ( 'BODY' ) [ 0 ] ) . appendChild ( s ) ;

} ( ) ) ;

$ ( document ) . ready ( function ( ) {

$ ( ".dq_comment" ) . click ( function ( e ) {

e. preventDefault ( ) ;

var id = $ ( this ) . attr ( "id" ) ;

var href = $ …

blog.devinterface.com Read
  Source Favicon
Email

…the messages myself like I have always done. The difference being mostly in the language being used ( Javascript versus C#).

The other option is to take advantage of Azure's Notification Hubs which will handle distributing the messages to devices for me. Notification Hub has some advantages that stand out to me:

It works with all the platforms I care about: APNS, GCM, and WNS.

It handles platforms I don't care about, but might again someday: Kindle.

It does …

carpeaqua.com Read
  Source Favicon
By miraculous1 of mir.aculo.us 8 days ago.
Email

JavaScript loaders

The newest NoNoNoSQL database

Distributed anything

That cool new jQuery plugin

A custom-designed font

Multiple load-balanced "webscale" servers

All these things create the illusion of making things easier when in reality they create very complex dependencies and will be very hard to remove later if they don't turn out to be the silver bullets they promise to be. This doesn't mean these things are bad or evil. You may want some of them later, …

mir.aculo.us Read
  Source Favicon
Email

@ javascript Scenario: Given I visit "the home page" and the body is marked as wip When I press Control w Then the wip tags are visible When I press Control w Then the wip tags are not visible

First, we use jQuery to set the wip class on the document's body from within the step definition. Here's the implementation: Given /^I visit "([^"]*)" and the body is marked as wip$/ do |page_name| visit(path_to(page_name)) page.execute_script("$('body').addClass('wip');") …

robots.thoughtbot.com Read
  Source Favicon
By Chase Douglas of New Relic 10 days ago.
Email

When we set out to develop the JavaScript error reporting and AJAX timing features for the New Relic Browser, we had no idea what inanities we would find in the implementation details of various browsers. Sure, we assumed that by supporting everything from Internet Explorer 6 to the latest Chrome browsers we would be opening ourselves up to annoying edge-cases and the need for interesting work-arounds. What we didn't yet know was exactly where those issues would manifest themselves, …

newrelic.com Read
  Source Favicon
By Adam of Transcending Frontiers over 2 years ago.
Email

@ javascript

In regular RSpec code, you can do something like this:

feature "The signup page" do

scenario "should load", :js => true do

visit new_user_registration_path

page.should have_selector("form.user_new")

end

end

You could also use the :driver option to specify :webkit if you want to choose the driver on a per scenario / describe basis. The same applies to @ webkit in Cucumber.

If you're on OS X, when you first run tests using …

thefrontiergroup.com.au Read
  Source Favicon
By Asami Novak of New Relic 10 days ago.
Email

…Superhero.js offered a collection of helpful articles, videos, and presentations to help with your JavaScript projects.

New Relic software engineer Shiv Kumar shared a behind-the-scenes account of building New Relic's Community Forum .

HBO's Silicon Valley developer-centric comedy premieres with positive responses from critics and general audiences alike. The only thing missing was any depiction of the developers doing any actual …

newrelic.com Read
  Source Favicon
Email

We used Cucumber to make sure that users could apply formatting to blurbs: @ javascript Scenario: Apply formatting to blurbs Given the following blurb exists: | project | key | draft content | | name: Breakfast | test.key |

hello | When I go to the edit blurb page for "test.key" on "Breakfast" And I apply the "bold" editor function to "ell" And I apply the "italic" editor function to "el" And I press …

robots.thoughtbot.com Read
  Source Favicon
By Mike Gunderloy of A Fresh Cup 12 days ago.
Email

Rails 4.1.0: Spring, Variants, Enums, Mailer previews, secrets.yml - Yep, it's released. More than the particular features, I most like the smooth upgrade from 4.0 and the new determination to put out regular, solid releases.

Superhero.js - Resources for maintaining a large Javascript codebase.

RegExr 2.0 - Online tool for working with regular expressions.

afreshcup.com Read
  Source Favicon
On Viget.com Blogs almost 3 years ago.
Email

Convert a method to a lambda in Ruby: lambda(&method(:events_path)). OR JUST USE JAVASCRIPT.

It might not be clear what I was talking about or why it would be useful, so allow me to elaborate. Say you've got the following bit of Javascript: var ytmnd = function() { alert("you're the man now " + (arguments[0] || "dog")); };

Calling ytmnd() gets us you're the man now dog , while ytmnd("david") yields you're the man now david . …

viget.com Read