This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import updateCartItems from 'my-app/gql/mutations/update-cart-items'; | |
export default Controller.extend({ | |
actions: { | |
updateCartItemsAddress(cartId, address) { | |
this.get('apollo').mutate({ | |
mutation: updateCartItems, | |
variables: { cartId, | |
attrs: { address } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { all } from 'rsvp'; | |
export default Controller.extend({ | |
actions: { | |
updateCartItemsAddress(address) { | |
let cartItems = this.get('model.cartItems'); | |
return all(cartItems.map((cartItem) => { | |
cartItem.set('address', address); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
import getCart from 'my-app/gql/queries/get-cart'; | |
export default Route.extend({ | |
model(params) { | |
return this.get('apollo').query({ | |
query: getCart, | |
variables: { | |
page: params.page, | |
pageSize: params.pageSize, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
import { hash } from 'rsvp'; | |
export default Route.extend({ | |
async model(params) { | |
let [cart] = await this.store.query('cart'); | |
let cartItems = this.store.query('cart-item', { | |
filter: { cartId: cart.id }, | |
include: 'address', | |
page: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
export default Route.extend({ | |
async model() { | |
let [cart] = await this.store.query('cart', { | |
include: 'cart-items.address' | |
}); | |
return cart; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var count = 0; | |
var i = 0; | |
var fill; | |
var path; | |
var paths = document.getElementsByTagName('path'); | |
var pathsLen = paths.length; | |
var stroke; | |
while (i < pathsLen) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
// Capture the original $.Event constructor | |
$._Event = $.Event; | |
// Override the $.Event constructor (preserve the 2 arguments) | |
$.Event = function(src, props) { | |
// If the src argument is truthy, add a URL property to it | |
if (src) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# on | |
sudo ipfw add pipe 1 all from 127.0.0.1 to 127.0.0.1 | |
sudo ipfw pipe 1 config bw 300Kbit/s delay 200ms | |
# off | |
sudo ipfw flush |