Provider | Singleton | Instantiable | Configurable |
---|---|---|---|
Constant | Yes | No | No |
Value | Yes | No | No |
Service | Yes | No | No |
Factory | Yes | Yes | No |
Decorator | Yes | No? | No |
Provider | Yes | Yes | Yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! ConvertShouldToExpect() | |
let rspec_conversions = { | |
\ 'should': 'to', | |
\ 'should_not': 'not_to', | |
\ 'should_receive': 'to receive', | |
\ 'should_not_receive': 'not_to receive', | |
\ } | |
for [old, new] in items(rspec_conversions) | |
execute "normal! " . ':%s/\v^(\s+)(.+)\.' . old . '>/\1expect(\2).' . new . '/ge' . "\<CR>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "chosen"; | |
.chosen-container { | |
font-size: inherit; | |
margin-bottom: $form-spacing; | |
.chosen-single div { | |
background: none; | |
border-left: none; | |
position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Downloads and applies a patch from Drupal.org. | |
if [ -z "$1" ] | |
then | |
echo "You need to supply a URL to a patch file." | |
exit | |
fi | |
URL=$1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mobile-size: 320px | |
$tablet-size: 768px | |
$netbook-size: 1030px | |
$desktop-size: 1600px | |
$mobile: "all and (max-width: #{$mobile-size})" | |
$tablet: "all and (min-width: #{($mobile-size + 1)}) and (max-width: #{$tablet-size})" | |
$netbook: "all and (min-width: #{($tablet-size + 1)}) and (max-width: #{$netbook-size})" | |
$desktop: "all and (min-width: #{$netbook-size + 1}) and (max-width: #{$desktop-size})" | |
$big-desktop: "all and (min-width: #{$desktop-size + 1})" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
# Place in config/deploy.rb | |
namespace :rails do | |
desc "Open the rails console on each of the remote servers" | |
task :console do | |
on roles(:app) do |host| #does it for each host, bad. | |
rails_env = fetch(:stage) | |
execute_interactively "ruby #{current_path}/script/rails console #{rails_env}" |
Update: I no longer work for the company and this challenge is no longer used, but I'll leave the gist here in case people want to practice.
Using Ruby on Rails we would like you to create a simple expert search tool. The application should fulfill the requirements below. The source code must be placed in a public repo on GitHub. The application should be deployable on Heroku.
- I enter a name and a personal website address and a member is created.
- When a member is created, all the heading (h1-h3) values are pulled in from the website to that members profile.
- The website url is shortened (e.g. using http://goo.gl)
- After the member has been added, I can define their friendships with other existing members. Friendships are bi-directional i.e. If Sasha is a friend of Ash, Ash is always a friend of Sasha as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
module Views | |
class PaginatedCollection < ActiveAdmin::Component | |
protected | |
def build_pagination_with_formats(options) | |
div :id => "index_footer" do | |
build_pagination | |
div(page_entries_info(options).html_safe, :class => "pagination_information") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AuthFilter class file. | |
* @author Christoffer Niska <[email protected]> | |
* @copyright Copyright © Christoffer Niska 2012- | |
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |
* @package auth.components | |
*/ | |
/** |