Skip to content

Instantly share code, notes, and snippets.

View Kerrick's full-sized avatar

Kerrick Long Kerrick

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
model: Ember.computed(function() {
const notifs = Array.from({ length: 5 }).map(() => this.store.createRecord('optin-notification'));
notifs.forEach((notif, i) => {
notif.set('name', `OptinNotification ${i}`);
if (i % 2 === 0) {
notif.send('becameInvalid');
notif.errors.add('name', [
import Ember from 'ember';
export default Ember.Component.extend({
});
@Kerrick
Kerrick / controllers.application.js
Created April 3, 2019 19:02
computed-decorators-problem
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
@computed('appName')
get screamingAppName() { return this.appName; }
});
import Ember from 'ember';
export default Ember.Component.extend({
html: `<div>
<img src="https://via.placeholder.com/350x150" width="350" height="150" alt="Placeholder" />
</div>`,
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
alert() {
alert('Oh no! The action bubbled.');
},
actions: {
returnEarly(event) {
console.log(arguments);
@Kerrick
Kerrick / emoji.ts
Created July 22, 2018 04:44
Slugify with Emoji Support
export const emojiMap: { [key: string]: string } = {
'💯': '100',
'🔢': '1234',
'😀': 'grinning',
'😬': 'grimacing',
'😁': 'grin',
'😂': 'joy',
// ...
};
@Kerrick
Kerrick / README.md
Last active March 11, 2018 19:46
ES2018 Dice Roller

Roll

Roll any number of dice on your command line, including modifiers!

Dependencies

Requrise node v8.x or higher.

Usage

@Kerrick
Kerrick / to-m4r.sh
Created November 23, 2017 03:48
macOS use FFMPEG to convert MP3 files into M4R iPhone Tones
# brew install ffmpeg --with-fdk-aac
find . -iname "*.mp3" | while read f
do
ffmpeg -i "$f" -acodec libfdk_aac -f ipod "${f:r}".m4r
done