Skip to content

Instantly share code, notes, and snippets.

View k-fish's full-sized avatar
🐟

Kev k-fish

🐟
  • Toronto, Canada
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
intl: Ember.inject.service(),
currency: Ember.inject.service(),
appName: 'Ember Twiddle',
price: '',
actions: {
savePrice() {
console.log(this.get('price').replace(',', '.'));
@k-fish
k-fish / components.fb-tooltip.js
Last active June 14, 2018 18:21 — forked from aaronmw/components.fb-tooltip.js
Tooltip with basic-dropdown - scroll
/**
TODO:
[ ] "OFFSET" should be replaced with computedStyles of the arrow element; margin of
the arrow will determine from how far away from the target the popover is drawn
**/
import Ember from 'ember';
const SUPPORTED_POSITIONS = {
import Ember from 'ember';
function getRandomElement(items) {
return items[Math.floor(items.length * Math.random())];
}
function getRandomBetween(min, max) {
return Math.random() * (max - min + 1) + min;
}