Skip to content

Instantly share code, notes, and snippets.

View stephencarr's full-sized avatar

Stephen Carr stephencarr

  • Yelp
  • Fredericton, NB
  • 07:00 (UTC -04:00)
View GitHub Profile
@stephencarr
stephencarr / cleanYTRemove.js
Last active December 25, 2015 03:29
Quick jQuery function to remove YT videos from the DOM without IE9 freaking out about memory leaks. The problem is detailed here: https://groups.google.com/forum/#!topic/youtube-api-gdata/2JcIaw43dco
/**
* Safely removes YT player from DOM
* @param {object} ytplayer
* @param {objext} $wrapper
* @return {bool}
*/
function cleanYTRemove(ytplayer, $wrapper) {
// Do shutdown so IE doesn't freak...
if (typeof ytplayer != 'undefined' && typeof ytplayer.div != 'undefined') {
// Destroy the Youtube player object
@stephencarr
stephencarr / application.js
Last active March 4, 2017 13:05
Ember authorizer for simple-auth + devise-auth-token
// `adapters/application.js`
import Ember from 'ember';
import DS from 'ember-data';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
const { service } = Ember.inject;
import config from '../config/environment';
export default DS.JSONAPIAdapter.extend(DataAdapterMixin, {
authorizer: 'authorizer:devise',
<div class="form-wrap">
{{#bs-form class="label-mb-10" formLayout=vertical model=user action="submit" as |form|}}
{{#form.element label="User Name" property="username" as |el|}}
<div class="input-group">
<input value={{el.value}} placeholder="Username" class="form-control" oninput={{action (mut el.value) value="target.value"}} id={{el.id}} type="text" autofocus="true">
<div class="input-group-addon"><i class="icon-user"></i></div>
</div>
{{/form.element}}
{{#form.element label="Email Address"property="email" as |el|}}
<div class="input-group">
Verifying my Blockstack ID is secured with the address 1EH49SpZ6osghFWUTPt9CwEVFDsBXnRxpQ https://explorer.blockstack.org/address/1EH49SpZ6osghFWUTPt9CwEVFDsBXnRxpQ