Skip to content

Instantly share code, notes, and snippets.

Avatar

Kim Røen kimroen

View GitHub Profile
View machine.js
const initialContext = {
file: 'NO VALUE',
success: 'NO VALUE',
direction: 1,
error: 'NO VALUE',
validationError: 'NO VALUE',
};
const UploadMachine = Machine({
id: 'upload',
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View components.my-light-table.component.js
import Component from '@ember/component';
import { observer } from '@ember/object';
import DynamicTable from '../../mixins/ember-light-table-data-mixin';
export default Component.extend(DynamicTable, {
sort: '',
dir: '',
isLoading: true,
onDataTableLoad: observer('dataTable', function() {
View components.my-light-table.js
import Component from '@ember/component';
import { observer } from '@ember/object';
import DynamicTable from '../mixins/ember-light-table-data-mixin';
export default Component.extend({
sort: '',
dir: 'asc',
isLoading: true,
onDataTableLoad: observer('dataTable', function() {
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
columns: Ember.computed(function () {
return [
{
label: 'OrderId',
valuePath: 'orderId',
align: 'right',
View components.animator-test.js
import Component from '@ember/component';
import move from 'ember-animated/motions/move';
import scale from 'ember-animated-motions/scale';
import { parallel } from 'ember-animated';
export default Component.extend({
showThing: false,
transition: function * ({ receivedSprites, sentSprites }) {
receivedSprites.forEach(parallel(scale, move));
View components.my-component.js
import Ember from 'ember';
import move from 'ember-animated/motions/move';
import opacity from 'ember-animated/motions/opacity';
import { easeOut, easeIn } from 'ember-animated/easings/cosine';
import Promise from 'rsvp';
export default Ember.Component.extend({
myProperty: false,
transition: function* ({ insertedSprites, keptSprites, removedSprites, duration }) {
@kimroen
kimroen / rspec_model_testing_template.rb
Last active May 21, 2019 — forked from kyletcarlson/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
View rspec_model_testing_template.rb
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
View install-sketch-templates.sh
#!/bin/bash
# Let's get some color going!
red=$'\e[1;31m'
grn=$'\e[1;32m'
end=$'\e[0m'
# cd to cwd of the script (presumably in it's proper location)
cd "$(dirname "$0")"
printf "\nInstalling Sketch templates..."
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
queryParams: ['name'],
name: 'Kim'
});
You can’t perform that action at this time.