A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
<?php | |
use Faker\Factory as Faker; | |
abstract class ApiTester extends TestCase { | |
/** | |
* @var int | |
*/ | |
protected $times = 1; |
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers']) | |
.run(function(DB) { | |
DB.init(); | |
}); |
This post is one in a series on converting a Backbone app to Ember. See also Ember-Data Notes.
Recently, our team has been trying to get Ember-Data to work with an API that does not conform to the json:api
standard. The experience has been mostly good, but we've really struggled with the relationships. We have a Customer
model that has many pastInvoices
and a single monthToDateInvoice
. The URL for past invoices is /billing/invoice?explicit_customer_id={{customerId}}
; for month-to-date, it's /billing?no_list=true&explicit_customer_id={{customerId}}
. The JSON that the API returns for a customer does not include any link to those URLs.
Our first attempt was to create an InvoiceAdapter
that understood how to fetch invoices from those URLs:
// app/billing/invoices/adapter.js:
import mongooseResource from '../lib/mongoose-resource'; | |
import Foo from '../models/foo'; // a mongoose Model | |
export default mongooseResource('foo', Foo); |
# supervisor | |
# | |
# Author: Günter Grodotzki <[email protected]> | |
# Version: 2015-04-25 | |
# | |
# - set param "SUPERVISE=enable" to activate | |
# - chmod +x supervise.sh | |
# | |
packages: | |
yum: |
Disclaimer: The instructions are the collective efforts from a few places online. | |
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did. | |
First off, bundle. | |
================== | |
1. cd to the project directory | |
2. Start the react-native packager if not started | |
3. Download the bundle to the asset folder: | |
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle" |
import Html.App as Html | |
import Html exposing (..) | |
import Html.Events exposing (..) | |
import Task | |
import Http | |
import Json.Decode as Json exposing ((:=)) | |
-- Model |