Skip to content

Instantly share code, notes, and snippets.

View ckung's full-sized avatar

Christina Kung ckung

View GitHub Profile
@ckung
ckung / .html
Last active July 8, 2019 02:52
SC tracking pixels
<!-- MPARTICLE -->
<script>
//Sanity checks
window.mParticle = window.mParticle || {};
window.mParticle.eCommerce = { Cart: {} };
window.mParticle.Identity = {};
window.mParticle.config = window.mParticle.config || {};
window.mParticle.config.rq = [];
//if in nonprod
@ckung
ckung / update-rels-example
Last active June 22, 2018 14:49
Update rels example
//PUT an array to completely overwrite the existing relationship
//You only need two things in the payload: id and meta of the related entity
curl -XPUT -H "Content-type: application/json" -d '[{ "id": "587fab8a89a4d1ba2d56ae62", "meta": { "collectionName": "brands", "modelName": "brand" } }]' 'https://vogue-api.aws.conde.io/fashionshows/5b20f22930f94b78490ae9e3/rels/brand'
diff --git a/app/brands/p4k/models/article.js b/app/brands/p4k/models/article.js
index 90b4d24..bc60e26 100644
--- a/app/brands/p4k/models/article.js
+++ b/app/brands/p4k/models/article.js
@@ -9,6 +9,16 @@ export default BaseArticle.extend({
longformLink: hasMany('externallink', {embedded:true}),
longformUrl: computed.reads('longformLink.firstObject.url'),
+ publishUriHook: computed('categories.sections.[]', function () {
+ let hierarchy = this.get('categories.sections.firstObject._embedded.hierarchy');

Keybase proof

I hereby claim:

  • I am ckung on github.
  • I am ckung (https://keybase.io/ckung) on keybase.
  • I have a public key whose fingerprint is 4583 64F3 BFCE 1863 CB76 7625 1A02 144D ABA4 DBD7

To claim this, I am signing this object:

"headers": {
"if-none-match": "W/\"ZvhuDc4AH7WVJOU11Zvv/g==\"",
"cookie": "ajs_anonymous_id=%2283370fa8-26c6-4d03-a40e-f343fd384a70%22; ajs_group_id=null; ajs_user_id=%22ckung%22; _ga=GA1.2.191598258.1437939376; kvcd=1437941101089; km_lv=1437941101; km_ai=ckung; km_ni=ckung; km_uq=; uid=jackseamus; uuid=xyzabc123-5d84-4c16-a737-6d07fee5b5d5; brand=demo; env=development; cn.copilot=s%3AQW7Y3OHTzCHmzB2e7P8nh8laQCz10o4h.gg%2BS5htZFPDWJKtwSBXm6AEbVhS7LQD8gxI6FW2UNI4; cp.username=ckung; cp.role=super-admin",
"accept-language": "en-US,en;q=0.8",
"accept-encoding": "gzip, deflate, sdch",
"referer": "http://copilot.local:4200/",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36",
"x-requested-with": "XMLHttpRequest",
"accept": "application/json, text/javascript, */*; q=0.01",
"connection": "close",
'use strict';
var _ = require('lodash');
var Promise = require('bluebird');
//var request = Promise.promisify(require('request'));
var request = require('request');
// request('http://ci.epi.api.conde.io/galleries/54ac07c0892291462a9e0742/revisions/18/rels').then(function(data){
// var data2 = JSON.parse(_.last(data));
// console.log(data2);
var _ = require('lodash');
var Promise = require('bluebird');
var request = Promise.promisify(require('request'));
request('http://ci.cnt.api.conde.io/articles/546989dff3cd9c7947d5c2b0')
.then(function (content) {
var data = JSON.parse(_.last(content));
console.log(data);
});
https://github.com/CondeNast/copilot/commit/b019abd42864beae814fba6593a3b2ba55ac7b6a
https://github.com/CondeNast/copilot/commit/c7c48bf2fea73917cc0898807b2fb6fde57d135e
https://github.com/CondeNast/copilot/commit/e5c5ca423ba68abde66b5e4d7221c7e6ac80fad4
"[{\"id\":\"5405fad7193f09557a7d12d3\",\"title\":\"boat1.gif\",\"revision\":1,\"createdAt\":\"2014-09-02T17:13:59.128Z\",\"modifiedAt\":\"2014-09-02T17:14:35.672Z\",\"revisionCreatedAt\":\"2014-09-02T17:14:35.672Z\",\"meta\":{\"collectionName\":\"photos\",\"modelName\":\"photo\",\"publishable\":false},\"images\":{\"original\":{\"url\":\"https://us-east.manta.joyent.com/condenast/public/vf/production/2014/09/02/5405fad7193f09557a7d12d4_boat1.gif\",\"filename\":\"5405fad7193f09557a7d12d4_boat1.gif\",\"width\":500,\"height\":277,\"format\":\"GIF\"},\"copilot-small\":{\"url\":\"https://us-east.manta.joyent.com/condenast/public/vf/production/2014/09/02/5405fad7193f09557a7d12d5_boat1.gif\",\"filename\":\"5405fad7193f09557a7d12d5_boat1.gif\",\"width\":220,\"height\":122,\"format\":\"GIF\"},\"copilot-medium\":{\"url\":\"https://us-east.manta.joyent.com/condenast/public/vf/production/2014/09/02/5405fad7193f09557a7d12d6_boat1.gif\",\"filename\":\"5405fad7193f09557a7d12d6_boat1.gif\",\"width\":298,\"height\":165,\"forma
PUT : http://ci.vf.api.conde.io/v2/lists/53cec3c8fa1f2ecb440e53a9 : BODY : { meta:
{ collectionName: 'lists',
modelName: 'list',
publishable: true,
image: false },
_links: '/lists/53cec3c8fa1f2ecb440e53a9/revisions/8/rels',
id: '53cec3c8fa1f2ecb440e53a9',
createdAt: '2014-07-22T20:04:24.163Z',
modifiedAt: '2014-08-02T15:27:48.744Z',
revision: 9,