Skip to content

Instantly share code, notes, and snippets.

Dean Radcliffe deanius

Block or report user

Report or block deanius

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
deanius / YouTubeEventHandling.js
Last active Sep 8, 2018 — forked from jshaw/YouTubeEventHandling.js
YouTube Video Playing and Finished Event Handling
View YouTubeEventHandling.js
let player
let onYouTubeIframeAPIReady
const youTubeReady = new Promise(resolve => {
var tag = document.createElement('script');
tag.src = "//";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
deanius / background.js
Created Aug 16, 2018 — forked from omarstreak/background.js
Chrome API Extension
View background.js
//oauth2 auth
{'interactive': true},
//load Google's javascript client libraries
window.gapi_onload = authorize;
View words.clj
(defn score
(let [wc (count word)
uc (count (into #{} (map identity (clojure.string/lower-case word))))]
{:word word :score (if (= wc uc) wc 0)}))
(defn winner
(let [m (group-by :score (map score words))]
(m (apply max (keys m)))))
View meteor-subscription-promise-ready.js { = new ReactiveVar()
this.ready = new ReactiveVar( false )
this.subscribe( 'Restaurant', [ FlowRouter.getParam('restaurantId') ] )
.then(function() { Restaurant.findOne() )
this.ready.set( true )
deanius /
Last active Aug 29, 2015 — forked from CrabDude/
Node.js Callback Contract

#callback/errback contract

  1. Function that takes 2 arguments
    • first argument is an error
    • second argument is the result
    • Never pass both
    • error should be instanceof Error
  2. Must never excecute on the same tick of the event loop
  3. Must be passed as last argument to function
  4. Return value is ignored
  5. Must not throw / must pass resulting errors
View ibm_cb
#foot {padding-bottom:20px;}
.two_column #customer_service_links {
height: inherit;
display: inline;
position: relative;
You can’t perform that action at this time.