Skip to content

Instantly share code, notes, and snippets.

View mikegrassotti's full-sized avatar

Michael Grassotti mikegrassotti

View GitHub Profile
@mikegrassotti
mikegrassotti / 1.md
Last active March 23, 2023 16:17
Mike Grassotti's Minimum Viable Ember.js QuickStart Guide This quickstart guide should get you from zero to slightly-more-than-zero in a couple of minutes. When done, you should feel somewhat confident that ember.js actually works and hopefully will be interested enough to learn more. WARNING: Don't just try this guide then think ember-sucks cau…

Mike Grassotti's Minimum Viable Ember.js QuickStart Guide

This quickstart guide should get you from zero to slightly-more-than-zero in a couple of minutes. When done, you should feel somewhat confident that ember.js actually works and hopefully will be interested enough to learn more.

WARNING: Don't just try this guide then think ember-sucks cause "I could write that quickstart-guide better in jQuery or Fortran" or whatever. I am not trying to sell you on ember or anything, this guide is little more than a hello-world.

Step 0 - Check out jsFiddle

this jsFiddle has all the code from this answer

@mikegrassotti
mikegrassotti / gist:2247065
Created March 30, 2012 05:55
Using sed to upgrade to Factory Girl 3
# FactoryGirl3ForYouAndMe
# The new syntax: http://robots.thoughtbot.com/post/19412394597/factory-girl-hits-3-0
#
# Where to learn sed?
# http://www.grymoire.com/Unix/Sed.html#uh-6
# http://www.markhneedham.com/blog/2011/01/11/sed-across-multiple-files/
#
# What needs to change?
find . -type f -name "*.rb" -print0 | xargs -0 grep "Factory.create"
find . -type f -name "*.rb" -print0 | xargs -0 grep "Factory.build"
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@mikegrassotti
mikegrassotti / components.my-component.js
Created July 26, 2017 07:21
ember-routing-service-testdrive
import Ember from 'ember';
export default Ember.Component.extend({
router: Ember.inject.service(),
actions: {
goHome() {
this.get('router').transitionTo('index');
}
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@mikegrassotti
mikegrassotti / hacks.sh
Last active October 3, 2016 17:56
OSX Shell hacks
# Last 10 days
seq 0 10 | xargs -I {} date -v-{}d '+%Y-%m-%d'
# Download last 10 Papertrail archives
seq 0 10 | xargs -I {} date -v-{}d '+%Y-%m-%d' | xargs -I {} curl -g -v --progress-bar -f -o {}.tsv.gz -L -H "X-Papertrail-Token: $PAPERTRAIL_TOKEN" https://papertrailapp.com/api/v1/archives/{}/download
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@mikegrassotti
mikegrassotti / plaid.html
Last active April 29, 2016 18:41 — forked from anonymous/plaid.html
plaid static vs ember
<!DOCTYPE html>
<html lang="en">
<head>
<title>Plaid Demo Application</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://cloud.typography.com/6954312/686646/css/fonts.css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/default.min.css">
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'m-form',
data: {
name: 'blank',
age: 0
},
actions: {
bar() {