Skip to content

Instantly share code, notes, and snippets.

Isaac Su isaacsu

Block or report user

Report or block isaacsu

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
isaacsu /
Created Jul 17, 2018 — forked from swalkinshaw/
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.


Keybase proof

I hereby claim:

  • I am isaacsu on github.
  • I am isaacsu ( on keybase.
  • I have a public key whose fingerprint is 6A25 F38F 2BBF 1A98 98D5 D118 13E4 CCE5 4648 52C6

To claim this, I am signing this object:

isaacsu /
Created May 14, 2012
sim-distance in python
# Returns a distance-based similarity score for person1 and person2
def sim_distance(prefs,person1,person2):
# Get the list of shared_items
for item in prefs[person1]:
if item in prefs[person2]:
# if they have no ratings in common, return 0
if len(si)==0: return 0
isaacsu / sim-distance.clj
Created May 14, 2012
sim-distance in clojure
View sim-distance.clj
(defn sim-distance [critic1 critic2]
; work out movies that both critics have rated
(let [shared-movies
((fn [c1 c2]
(map #(first %) (filter #(c2 (first %)) c1))) critic1 critic2)]
; return 0 if they have no ratings in common
(if (= (count shared-movies) 0)
; compute distance
(/ 1 (+ 1 (reduce + (map #(expt (- (critic1 %) (critic2 %)) 2) shared-movies)))))))
View gatlinggun.php
* Gatling gun takes an array of valid params and returns every
* combination of invalid data caused by blanking out individual params.
* Example:
* $validData = array('firstName' => 'Gatling', 'lastName' => 'Gun', 'age' => 12);
* $ggData = gatlingGun($validData);
You can’t perform that action at this time.