Skip to content

Instantly share code, notes, and snippets.

View bzitzow's full-sized avatar

Brian Zitzow bzitzow

  • BRIAN ZITZOW
  • Roseville, California
View GitHub Profile
,-~ _ ^^~-.,
,^ -,____ ^, ,/\/\/\,
/ (____) | S~ ~7
; .---._ | | || _| S I AM THE Z
| | ~-.,\ | |!/ | /_ LAW! _\
( | ~<-.,_^\|_7^ ,| _//_ _\
| | ", 77> (T/| _/' \/\/\/
| \_ )/<,/^\)i(|
( ^~-, |________||
^!,_ / /, ,'^~^',!!_,..---.
class CategoriesUnitsTable < ActiveRecord::Migration
def self.up
create_table :categories_units, :id => false do |t|
t.references :category
t.references :unit
end
add_index :categories_units, [:category_id, :unit_id]
end
def self.down

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
Background:
Given I authenticate with the following user:
| user | license | type |
| test | 12354 | developer |
When I send a "POST" request to "/impressions/create?genre=male&glances=2"
Then the response should be JSON
And the response should contain "true"
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (jelbourn@google.com)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/