Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sam Ritchie sritchie

🎯
Focusing
Block or report user

Report or block sritchie

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 flatmap.clj
(defn flatmap<
"Takes a function and a source channel, and returns a channel which
contains the values in each channel produced by applying f to
each value taken from the source channel. f must return a
channel."
[f in]
(let [out (a/chan)]
(a/go-loop []
(let [item (a/<! in)]
(if (nil? item)
View signup.clj
(defn attempt-registration
"Friend workflow that tries to register a user; only works if a
user's gone to the signup page. Proper form validations are all
applied. If these all pass, the user is created and logged in, and
the redirection occurs."
[{:keys [uri request-method params session]}]
(when (and (= uri "/signup")
(= request-method :post))
(v/if-valid signup-validator
params
View transfer_response.clj
{:description "xxx Transfer",
:amount xxxxx,
:date 1400198400,
:recipient "recip",
:type "bank_account",
:created 1400110536,
:bank_account
{:disabled false,
:bank_name "WELLS FARGO BANK",
:last4 "xxxxx",
View ssl.clj
At Wed May 21 03:40:12 UTC 2014
prod.paddleguru.com ()
Tags: [exception]
Custom Attributes: {:request-id "14c631b8-027e-44f4-9ab4-3deba9843626", :exception "javax.net.ssl.SSLPeerUnverifiedException"}
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
sun.security.ssl.SSLSessionImpl.getPeerCertificates SSLSessionImpl.java: 371
org.apache.http.conn.ssl.AbstractVerifier.verify AbstractVerifier.java: 128
org.apache.http.conn.ssl.SSLSocketFactory.connectSocket SSLSocketFactory.java: 572
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection DefaultClientConnectionOperator.java: 180
View injection.swift
import Cocoa
let x = "Face"
protocol Injection<T, U> {
func apply(T) -> U
func invert(U) -> T?
}
class IntInjection: Injection {
View cursor.clj
(let [pricing (:pricing static)
cursor (map (fn [e]
{:event e
:pricing pricing
:selection (-> dynamic :entries (get (:id e)))
:payment-method :credit-card})
(:events static))]
(d/div {} (om/build-all event-row cursor
{:init-state {:update (:update @state)}})))
View autocomplete.cljs
(defcomponentk address-field
"The address field uses Google Places autocomplete
internally. Autocomplete has some issues with onChange and onBlur;
after clicking one of the options in the dropdown (instead of
tabbing away), the field won't update until after onBlur has
fired.
This component gets around that issue by waiting until the
`place_changed` event is fired by the Autocomplete widget, and only
then reading the value of the original input component.
View coupon.cljs
(sm/defn coupon-lookup
"If the code supplied is empty, sends a failed discount on
immediately. (This won't affect the rendering, since nothing's
shown if the code is blank.) If the code is NOT blank, fires off an
Ajax request to the server to look up the discount.
TODO: Ideally we'd have a channel that could signal a dissoc,
instead of only adding items to the state."
[title :- regatta/Title
code :- coupon/Code
View Facebook Login.md
  • user signs up with email and password:

    • if the email exists, validation error.
    • if the email is linked to a facebook account, they'll see the "merge?" box when they try to link later
    • if the email doesn't exist, create the account!
      • Username is auto-generated
      • we send a welcome! email
      • we send a verification email
  • user decides to link a Facebook account:

    • when the user clicks on the "Link Facebook" link in profile, login with javascript SDK
View error.clj
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:344)
at clojure.lang.RT.classForName(RT.java:2118)
at clojure.lang.RT.classForName(RT.java:2127)
at clojure.lang.RT.loadClassForName(RT.java:2146)
at clojure.lang.RT.load(RT.java:430)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5436.invoke(core.clj:5863)
at clojure.core$load.doInvoke(core.clj:5862)
You can’t perform that action at this time.