spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
/*-- Media query variables --*/ | |
$mq-small: 'media and (max-width: 767px)'; | |
$mq-large: 'media and (min-width: 768px)'; | |
/*-- Media query mixin --*/ | |
@mixin mq($mqString) { | |
@media #{$mqString} { | |
@content; |
#' Digest the Link header in a paginated result. | |
#' | |
#' Converts the Link header from a monolithic string to a usable data.frame. | |
#' | |
#' The GitHub API automatically paginates when the number of requested items | |
#' exceeds the number of items per page. When this occurs, the result returned | |
#' by the server will include a Link header that provides the URLs for other | |
#' pages of results, such as the next page and the last page. These assorted | |
#' URLs are catenated in a single string and this function converts that | |
#' information into a data.frame that is useful for traversing the pages. |
class Api::BaseController < ApplicationController | |
include Rivalry::OrganizationScope | |
respond_to :json | |
private | |
def self.paginated_action(options = {}) | |
before_filter(options) do |controller| | |
if request.headers['Range-Unit'] == 'items' && | |
request.headers['Range'].present? |
<!DOCTYPE HTML> | |
<html lang="en" ng-app="myApp"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dynamic Pagination w/ Filtering</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content="Kim Maida"> | |
<!-- JS Libraries --> |
var app = angular.module('myApp', []); | |
/* Set up a simple controller with a few | |
* examples of common actions a controller function | |
* might set up on a $scope. */ | |
app.controller('MainCtrl', function($scope, someService) { | |
//set some properties | |
$scope.foo = 'foo'; | |
$scope.bar = 'bar'; |
apps = `heroku apps`.split("\n\n")[0].lines[1..-1].collect{|l| l.strip } | |
printf("%-20s %4s %4s\n", 'APP', 'WEB', 'BG') | |
apps.each{|a| | |
astats = `heroku ps -a #{a}` | |
info = `heroku apps:info -a #{a}` | |
access = `heroku access -a #{a}` | |
stack = info.scan(/Stack:\s+(.*)/).first.last rescue 'NA' | |
web, workers = (astats.match(/web\.\d/).size rescue 0), (astats.match(/worker\.\d/).size rescue 0) | |
printf("%-20s %4s %4s %20s\t#{access}\n", a, web, workers, stack) | |
} |
set -g prefix C-a # Make C-a the prefix instead of default | |
bind C-a send-prefix # Send to application | |
unbind C-b # Unbind C-b | |
set -sg escape-time 1 # Remove delay for keystrokes | |
setw -g mode-keys vi # Use vi mode | |
### Mouse mode ### | |
setw -g mode-mouse on # Toggle mouse mode globally | |
set -g mouse-select-pane on # Select pane using mouse |
[Describe ambitions: type of work, attributes of team, what you want to learn & teach]
[in reverse chronological order, list at most 5 positions or 10 years back, whichever is fewer]
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.