Skip to content

Instantly share code, notes, and snippets.

View pjmorse's full-sized avatar

Parker Morse pjmorse

View GitHub Profile
ActiveRecord::StatementInvalid: PG::Error: ERROR: current transaction is aborted, commands ignored until end of transaction block
: CREATE TABLE "feedback_questions" ("id" serial primary key, "survey_id" integer, "question_text" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)

Keybase proof

I hereby claim:

  • I am pjmorse on github.
  • I am flashesofpanic (https://keybase.io/flashesofpanic) on keybase.
  • I have a public key whose fingerprint is 9E62 8E6D AB58 0746 17B8 0457 C5AF D4D5 A72E D856

To claim this, I am signing this object:

@pjmorse
pjmorse / repeats.rb
Created September 4, 2014 19:49
Possible repeats-finding method
def repeats
if @repeats
@repeats
elsif practitioner.present?
practitioner.practitioner_activities.where(
survey_id: survey_id,
start_hour: start_hour,
start_minute: start_minute,
end_hour: end_hour,
end_minute: end_minute,

Official status

Officially, ember-data is in beta, which means (they think) they've stabilized the API for 1.0 and are finding and patching bugs. This sounds nice, but they're currently on beta 8, and the first beta was tagged on September 1 of 2013. (There's a blog post from March which promises 1.0 is "coming soon"™.) So some of the issues described below may have improved, but others aren't going to improve until the 1.0 comes out of beta and the core team addresses them in point releases (or, worse, 2.0, which seems infinitely far in the future).

Pain points

  • Nested data: This is any time an object has child relationships explained by the route (i.e. /posts/1/comments). This is doable but may require some fancy footwork on the Rails side to ensure the application sends JSON to the Ember application in the way ember data expects.
  • Relationships: It's apparently non-trivial to ensure re
saveNewSubscriber: ->
@content.get("subscriber").save().then(
(subscriber) =>
$("#modal-dialog-component").modal("hide")
App.Notifications.pushSuccess Em.I18n.t "notifications.added", model : "Subscriber"
# if subscriber.company?.order_profile?.warehouse?
# TODO: Need to get first the orderProfile, then its warehouse, from the API
return subscriber.get("company")
,
(response) =>
@pjmorse
pjmorse / gist:8335363
Created January 9, 2014 14:57
Links to some resources on doing breadcrumbs in ember.js.
http://pastie.org/pastes/8615218/text
http://stackoverflow.com/questions/15131788/display-crumble-path-with-ember
http://stackoverflow.com/questions/18762876/can-someone-please-help-me-with-clear-implementation-of-displaying-breadcrumb-pa
http://thoughts.z-dev.org/2013/07/18/keeping-ember-js-breadcrumbs-updated/
@pjmorse
pjmorse / first-derivative-of-animation-base.json
Last active December 21, 2015 23:29
Semantic JSON for a linked animation in Smartgraphs.
{
"type": "Activity",
"name": "First Derivative of Animation",
"authorName": "Parker Morse",
"pages": [
{
"type": "Page",
"name": "1 Sample Page",
"text": "This page will have an animation in the upper-right pane and a first derivative graph in the lower right.",
"panes": [
@pjmorse
pjmorse / first-derivative-of-animation-base.json
Last active December 21, 2015 23:28
Runtime JSON for a linked-animation graph pane, generated from semantic JSON before adding in the linked animation; the action runtime JSON with the linked animation; the diff between those runtime JSONs.
{
"_id": "first-derivative-of-animation.df6",
"_rev": 1,
"data_format_version": 6,
"activity": {
"title": "First Derivative of Animation",
"url": "/shared/first-derivative-of-animation",
"owner": "shared",
"pages": ["/shared/first-derivative-of-animation/page/1-1-sample-page"],
"axes": ["/shared/first-derivative-of-animation/axes/1", "/shared/first-derivative-of-animation/axes/2", "/shared/first-derivative-of-animation/axes/3", "/shared/first-derivative-of-animation/axes/4"],
@pjmorse
pjmorse / .gitconfig
Created September 6, 2012 20:47
My ~/.gitconfig
[user]
name = <name>
email = <email>
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
#!/usr/bin/php -q
<?php
/**
* Cron job to update the comics plan.
*/
// TODO: archive; move to <comicname>@comics.planworld.net
// new: Bizarro, Mother Goose and Grimm
/* includes */