This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// helpers | |
/////////////////////////////////// | |
function bench(fn) { | |
var t0 = new Date().getTime(), | |
res = fn(); | |
console.log("Time: ", new Date().getTime() - t0); | |
return res; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Vue | |
export default class I18nPlugin { | |
constructor(options) { | |
this.locale = options.locale | |
this.fallbackLocale = options.fallbackLocale | |
this.messages = options.messages | |
this.pluralizers = options.pluralizers | |
this.subscribers = [] | |
this.silentTranslationWarn = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@ember/component'; | |
import { computed } from '@ember/object'; | |
import { later, next } from '@ember/runloop'; | |
import $ from 'jquery'; | |
const TEMP_DELAY = 3000; | |
const SLIDE_DELAY = 300; | |
const FADE_IN_DELAY = SLIDE_DELAY * 1.3; | |
const FADE_OUT_DELAY = SLIDE_DELAY * 0.7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import { computed } from '@ember/object'; | |
// @prop tableModel | |
export default Ember.Component.extend({ | |
selectedColumn: null, | |
visibleColumns: computed('[email protected]', function() { | |
return this.tableModel.columns.rejectBy('options.hidden'); | |
}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@glimmer/component'; | |
import { inject as service } from '@ember/service'; | |
import { action } from '@ember/object'; | |
export default class extends Component { | |
@service lightbox; | |
@action | |
click(response) { | |
this.args.close(response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@glimmer/component'; | |
import { computed } from '@ember/object'; | |
export default class extends Component { | |
// filteredNames = []; | |
// selectedNames = []; | |
value = ''; | |
@computed.empty('value') isValueEmpty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
potentially useful features/ tweaks: | |
1. persistent node toggle across searches | |
2. node toggles expand AND highlight (alt color?) | |
3. opacity darken bg for nested containers | |
4. search expressions (key="foo" value=2 AND value=5) | |
// key is exactly "foo" OR value contains both 2 and 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# @see https://www.eea.europa.eu/data-and-maps/figures/forest-map-of-europe-1 | |
# @note uses imagemagick histogram to count unique colors | |
# | |
COUNTRY_IMAGE=ARGV[0] | |
COLOR_WEIGHTS={ | |
'#FFFFFF' => 0..1, |