Skip to content

Instantly share code, notes, and snippets.

Alex Slade heeton

Block or report user

Report or block heeton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View prerender.rb
class AlbumForm < Reform::Form
property :title, prerender: ->(options) { self.title = options[:def_title] }
end
You can then pass arbitrary arguments to prerender!.
###
form.title #=> nil
form.prerender!(def_title: "Roxanne")
View gist:6d13eab30295865f98d7fdfebd8aa314
alias reb='git fetch origin && git rebase origin/master'
alias pub='git push origin HEAD'
View gist:18cba1d1f6068679b5da
(defn update-input [val input]
(reset! val (-> input .-target .-value)))
(defn new-contact []
(let [val (r/atom "")]
(fn []
[:div
[:input {:type "text"
:placeholder "Contact Name"
:value @val
View before.cljs
(defn new-contact []
(let [val (r/atom "")]
(fn []
[:div
[:input {:type "text"
:value @val
:on-change #(reset! val (-> % .-target .-value))}]])))
; Works fine
View rails_responder.rb
def create
card_saver = Billing::SaveCreditCard.new(user: current_user, card: card_params)
responder = respond do |r|
r.success { render :success }
r.failure { render :failure }
end
card_saver.call(responder)
end
View gist:9794286
class Postman
include Interactor
def perform(context)
create_message_log.perform(context)
CreateMessageSummary.perform(context)
EnqueueMessageJob.perform(context)
View gist:9793958
class Postman
include Interactor
def perform(context)
if member.push_token_registered?
send_via_push
else
send_via_sms
View gist:9664807
class Secretary
include Interactor
def perform
SmsMessage.create!(message.attributes)
Postman.perform(message: message)
end
private
View client-app.js.coffee
# client/app.js.coffee
Meteor.startup ->
Meteor.call "swag", (error, result) ->
console.log(result)
# => Object {}
# Where is the foo method??
You can’t perform that action at this time.