Skip to content

Instantly share code, notes, and snippets.

View villander's full-sized avatar

Michael Villander villander

View GitHub Profile
#!/bin/sh
URL_BASE="https://my.example.com"
basename="web-app"
for js in dist/assets/*.map; do
# $js has the full path. Chop it down to just the file name.
filename=$(basename ${js})
# Production requires a little more work because of Ember CLI's fingerprinting.
# First, remove the ember-generated fingerprint and .js extension. This prefix is common between JS and MAP file.
@villander
villander / quote.txt
Created June 14, 2018 13:06 — forked from OnesimusUnbound/quote.txt
Programming Quotes
[T]he difference between a bad programmer and a
good one is whether he considers his code or his
data structures more important. Bad programmers
worry about the code. Good programmers worry about
data structures and their relationships.
-- Linus Torvalds
~~~
Clarity and brevity sometimes are at odds.
When they are, I choose clarity.
-- Jacob Kaplan-Moss
@villander
villander / easing.js
Created May 10, 2018 13:53 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@villander
villander / ember-cli-build.js
Created February 23, 2018 15:32 — forked from lifeart/ember-cli-build.js
Ember-cli-es6-imports
// install ember-cli-es6-transform
function importFromNPM(app,moduleName) {
let relPath = `node_modules/${moduleName}`;
let nodePath = `./${relPath}`;
let config = require(`${nodePath}/package.json`);
if (config.style) {
app.import(`${relPath}/${config.style}`);
}
import Ember from 'ember';
const { run: { debounce } } = Ember;
export default Ember.Controller.extend({
appName:'Ember Twiddle',
runMe() {
console.log("I should be called once");
},
selectTime(item) {
meuArray.setEach('selected', false); // aqui tiro a classe de todos os itens
meuArray.findBy('id', item.id).set('selected', true); // aqui queria add só pro item clicado
}
<h1>Render Props</h1>
<br>
<br>
{{#x-toggle value=myValue onChange=(action (mut myValue)) as |state|}}
{{! The render prop gives us the state we need
to render whatever we want here. }}
{{#x-toggle-label
onClick=state.toggle
{{yield
(hash
checked=(readonly value)
toggle=(action "change")
uid=uid
)}}
{{yield (hash
switch=(component 'x-toggle-switch'
checked=checked zchange=(action "change") uid=uid)
label=(component 'x-toggle-label'
checked=checked zchange=(action "change") uid=uid)
)}}