I hereby claim:
- I am jamonholmgren on github.
- I am jamon (https://keybase.io/jamon) on keybase.
- I have a public key whose fingerprint is D738 5A6B BFCE 3E63 A066 7EE4 97DC 65B8 5AAC A688
To claim this, I am signing this object:
| class FailureApp < Devise::FailureApp | |
| def respond | |
| # We override Devise's handling to throw our own custom errors on AJAX auth failures, | |
| # because Devise provides no easy way to deal with them: | |
| if request.xhr? && (warden_message == :unconfirmed || warden_message == :invalid) | |
| if warden_message == :unconfirmed | |
| flash.now[:alert] = "You need to confirm your account before continuing." | |
| elsif warden_message == :invalid | |
| user = Store::User.where(email: params[:user][:email].to_s).first |
I hereby claim:
To claim this, I am signing this object:
| require 'benchmark' | |
| def with_if_else(symbol) | |
| if symbol == :success | |
| 'alert-success' | |
| elsif symbol == :error | |
| 'alert-danger' | |
| elsif symbol == :warn | |
| 'alert-warning' | |
| elsif symbol == :info |
| school.schools_users | |
| .joins("LEFT JOIN users ON users.id = schools_users.user_id") | |
| .where(self.filters) | |
| .where(self.search_string) | |
| .order(order) |
| ESPN_MOCK_RESPONSE = { | |
| "resultsLimit"=>10, | |
| "resultsCount"=>271, | |
| "resultsOffset"=>0, | |
| "timestamp"=>"2014-05-18T01:50:05Z", | |
| "status"=>"success", | |
| "feed"=>[{"id"=>10310, | |
| "source"=>"ESPN.com", | |
| "premium"=>true, | |
| "links"=>{"web"=>{"href"=>"http://insider.espn.go.com/blog/ncbrecruiting/on-the-trail/post?id=10310&ex_cid=espnapi_public"}, |
| class MyObj | |
| def now(&callback) | |
| return callback.call @my_ivar if @my_ivar | |
| Dispatch::Queue.new("a").async do | |
| sleep 0.1 # simulate an http response | |
| Dispatch::Queue.main.sync do | |
| @my_ivar = { result: "real" } | |
| callback.call @my_ivar | |
| end |
| import UIKit | |
| import ProSwift | |
| class HomeScreen: ProSwiftScreen { | |
| let title = "Home Screen" | |
| func onLoad() { | |
| open(OtherScreen(navBar: true)) | |
| } | |
| } |
| class TeamsScreen < PM::GroupedTableScreen | |
| title "NBA Teams" | |
| def table_data | |
| [{ | |
| title: "Atlantic", | |
| cells: [ | |
| { title: "Boston Celtics", action: :select_team, arguments: { team: "Boston Celtics" } }, | |
| { title: "Brooklyn Nets", action: :select_team, arguments: { team: "Brooklyn Nets" } }, | |
| { title: "New York Knicks", action: :select_team, arguments: { team: "New York" } }, |
| class Object | |
| def set_if(prop, val) | |
| send "#{prop}=", val unless val.nil? | |
| end | |
| end | |
| r = Struct.new(:item).new("wat") | |
| r.set_if(:item, "no") | |
| r.item # => "no" | |
| r.set_if(:item, nil) |