Skip to content

Instantly share code, notes, and snippets.

View benmiles's full-sized avatar

Ben Miles benmiles

View GitHub Profile
@mock-article
Feature: Jobs box on article pages [JOBS-3540]
In order to see recently posted jobs
As a user
I want to see a standard jobs box in the right hand column of article pages
Scenario: Viewing jobs box
Given a viewable article has been syndicated
And more than one page of active jobs exists
@mock-article
@wip
Feature: Jobs box on article pages [JOBS-3540]
In order to see recently posted jobs
As a user
I want to see a standard jobs box in the right hand column of article pages
Scenario: Viewing jobs box
Given a viewable article has been syndicated
And more than one page of active jobs exists
!!! 5
%html
=render :partial => 'layouts/redesign/head'
%body
.container
.header
.nav nav
.ad banner ad
%h1 Naturejobs
.main
@wip
Feature: Consolidated 'My Profile' page
In order to make my profile information more accessible and usable
As a user
I want to be able to view all of my profile related info from a single page
Scenario: My profile page contains navigation tabs
Given I am logged in
When I go to my profile page
Then I should see the following tabs: "Profile | Alerts | Subscriptions | Saved Searches | NatureJobs"
@benmiles
benmiles / gist:1391790
Created November 24, 2011 16:52
user#show main content
%nav
.nav
%ul
%li.first
%a{:href => "http://www.nature.com/nams/svc/myaccount"} Profile
%li
%a{:href => "http://www.nature.com/nams/svc/myaccount/show/ealerts"} Alerts
%li
%a{:href => "http://www.nature.com/nams/svc/myaccount/show/subs"} Subscriptions
%li
[9] pry(main)> "10.1038/nj.hafalla.2007.json"[%r{10\.1038/.+(?=\.json)}]
=> "10.1038/nj.hafalla.2007"
Job.active.find_in_batches(:include => [:packages, :sites, :addresses, :upgrades], :batch_size => 1000) do |batch|
Sunspot.index!(*batch)
end
Job.find_in_batches(:conditions => {:active => false}, :include => [:packages, :sites, :addresses, :upgrades], :batch_size => 1000) do |batch|
Sunspot.index!(*batch)
end
cd /home/naturejobs/apps/naturejobs/current
rvm use ree
nohup bundle exec rake sunspot:solr:reindex_jobs_in_place[b.miles@nature.com] RAILS_ENV=production &

Clojure for Rubyists

Philosophy

Rich Hickey: "you are able to write only code that matters."

Comments

;; 158. decurry [medium]
;; http://www.4clojure.com/problem/158
(fn decurry [f]
(fn [& args]
(reduce #(%1 %2)
f
args)))
;; 43. reverse interleave [medium]