This file contains 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
.projects_stories_page .storyLabels a[title="blocked"] { | |
background-color: red; | |
color: white !important; | |
padding: 0 3px; | |
display: inline-block; | |
} |
This file contains 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
$ curl -I http://some.local.app.dev/?return=402 | |
HTTP/1.1 402 Payment Required | |
Server: nginx/1.2.2 | |
Date: Fri, 27 Jul 2012 19:08:19 GMT | |
Content-Type: text/html | |
Content-Length: 182 | |
Connection: keep-alive | |
Keep-Alive: timeout=10 |
This file contains 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
" --------------------------------------------------------------------------- | |
" Automagic Clojure folding on defn's and defmacro's | |
" | |
" Blog post: http://writequit.org/blog/?p=413 | |
function GetClojureFold() | |
if getline(v:lnum) =~ '^\s*(defn.*\s' | |
return ">1" | |
elseif getline(v:lnum) =~ '^\s*(def\(macro\|method\|page\|partial\).*\s' | |
return ">1" |
This file contains 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
class SignUpPage | |
def initialize | |
current_path.should == sign_up_path | |
end | |
def with_email(email) | |
fill_in "Login", :with => email | |
end | |
def with_password(password, confirmation = password) |
This file contains 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
# When resque workers are no longer around, but records of them are still sitting around in Redis... | |
def remove_resque_workers worker, ips | |
ips.each do |ip| | |
eval(" | |
def worker.to_s | |
'#{ip}:*' | |
end | |
") | |
worker.unregister_worker |
This file contains 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
Resque::Failure.all(28044, Resque::Failure.count - 28044).each do |j| | |
next unless j["retried_at"].nil? | |
e = j["error"] | |
ids = e[(e.index('[')+1)...e.index(']')].split(', ').map(&:to_i) | |
Jobs::MigrateLegacyUsers.submit_job(ids) | |
end |
This file contains 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
numbers_to_delete = (10..20).to_a # or any array of numbers you need to operate on | |
name_prefix = 'server-name-prefix-' # will be used in a search, ie: "name:server-name-prefix-11" | |
names_to_delete = numbers_to_delete.map { |i| "#{name_prefix}#{i}" } | |
nodes_to_destroy = search(:node, names_to_delete.map { |n| "name:#{n}" }.join(" OR ")) | |
nodes_to_destroy.each { |n| n.destroy } | |
clients_to_destroy = search(:client, names_to_delete.map { |n| "name:#{n}" }.join(" OR ")) | |
clients_to_destroy.each { |c| c.destroy } |
This file contains 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
RSpec::Matchers.define :be_valid do | |
match do |model| | |
model.valid? | |
end | |
failure_message_for_should do |model| | |
"expected valid? to return true, got false:\n #{model.errors.full_messages.join("\n ")}" | |
end | |
failure_message_for_should_not do |model| |
This file contains 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
" --------------------------------------------------------------------------- | |
" Automagic Clojure folding on defn's and defmacro's | |
" | |
function GetClojureFold() | |
if getline(v:lnum) =~ '^\s*(defn.*\s' | |
return ">1" | |
elseif getline(v:lnum) =~ '^\s*(defmacro.*\s' | |
return ">1" | |
elseif getline(v:lnum) =~ '^\s*(defmethod.*\s' | |
return ">1" |
This file contains 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
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
NewerOlder