Skip to content

Instantly share code, notes, and snippets.

@antidis
antidis / components.inner-component.js
Last active October 23, 2017 15:46
passing component reference
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
this._super(...arguments);
this.callFunctionOnReferencedObject();
},
callFunctionOnReferencedObject() {
console.log('api', this.get('api'));
let executionContext = this.get('api.outerComponentReference');
Color name:
Length of string (byte)
+ Name of color (string)
+ '86'
White:
94 84 - 01 2B - color_name
Red:
@antidis
antidis / gist:4435753
Last active December 10, 2015 12:38
Mobile Safari screwing up your position: fixed content when you blur out of a form field? This will solve it.
fix_mobile_scrolling = function() {
var current_body_scroll_top = $('body').scrollTop();
window.setTimeout(function (s) {
$('body').scrollTop(s + 1);
window.setTimeout(function (s) {
$('body').scrollTop(s);
}, 10, s)
}, 10, current_body_scroll_top);
};
@antidis
antidis / gist:1343907
Created November 7, 2011 00:42
The Ordell Robbie reset. For when you absolutely positively got to reset every property in the room.
#selectors_to_reset {
alignment-adjust: auto;
alignment-baseline: baseline;
-webkit-animation: none 0 ease 0 1 normal;
-moz-animation: none 0 ease 0 1 normal;
-ms-animation: none 0 ease 0 1 normal;
animation: none 0 ease 0 1 normal;
-webkit-animation-play-state: running;
-moz-play-state: running;
-ms-animation-play-state: running;
// Detect CSS mask support and hack it into Modernizr
if ( document.body.style[ '-webkit-mask-repeat' ] !== undefined ) {
Modernizr.cssmasks = true;
$('html').addClass('cssmasks');
} else {
Modernizr.cssmasks = false;
$('html').addClass('no-cssmasks');
}