Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cyk's full-sized avatar
💭
I may be slow to respond.

cyk

💭
I may be slow to respond.
View GitHub Profile
@cyk
cyk / components.table-legacy.js
Last active September 21, 2018 16:50
etl-et2-resize-col-constraints
import Ember from 'ember';
import EmberTableLegacyComponent from '../../ember-table-legacy/components/ember-table-legacy';
export default EmberTableLegacyComponent.extend({
});
@cyk
cyk / browerstack.js
Last active July 2, 2017 20:10
Testem BrowserStack Launcher Travis CI
// .travis/browserstack.js
#!/usr/bin/env node
const browserstack = require('browserstack');
let WORKER_ID = 0;
let username = process.env.BROWSERSTACK_USER;
let password = process.env.BROWSERSTACK_ACCESS_KEY;
// The exports from BrowserStack Travis addon we're relying on adds
@cyk
cyk / README.md
Last active July 28, 2020 17:35
Face Sentiments with Google Vision API via AWS API Gateway and Lambda

Face Sentiments with Google Vision API via AWS API Gateway and Lambda

My notes (and rudimentary guide) from a research spike that delved into the Google Vision API, AWS API Gateway and Lambda, prototyping a "serverless" API endpoint that returns sentiments expressed by faces in an image.

Introduction

Google's been rockin' their cloud offerings hard lately. Among their latest releases is the Cloud Vision API (in beta), a service that analyzes the content of an image; detecting things like words, phrases, objects, faces and their emotions. Let's prototype a "serverless" face sentiments endpoint using only the Vision API, AWS API Gateway and a Lambda function.

A quick note on Cloud Vision API pricing. As of this writing, the free tier for face detection is <1000/mo. This app can easily exceed this limit. To give you an idea of this, so far I've used 1103 face detection operations

@cyk
cyk / ember-data.dependent-relations.js
Last active December 12, 2020 21:17 — forked from slindberg/ember-data.dependent-relations.js
Dependent Relationships in Ember Data (for Ember Data v1.13.x)
/**
Ember Data: Dependent Relationships (Ember Data v1.13.x)
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),
@cyk
cyk / wait-for-change.js
Last active August 29, 2017 19:38
Ember Test Helper: Wait for Change (via MutationObserver)
/**
Ember Test Helper: Wait for Change
Using the MutationObserver API, this helper will wait for an element's contents
to change prior to progressing forward. This is helpful when you are testing
interactions involving async components (ex., Google Maps SDK queries).
@link https://gist.github.com/cyk/e3828d18b26562091447
```javascript
@cyk
cyk / keybase.md
Created May 26, 2015 16:55
Keybase proof

Keybase proof

I hereby claim:

  • I am cyk on github.
  • I am cyk (https://keybase.io/cyk) on keybase.
  • I have a public key whose fingerprint is 00CB 31E6 50DE 8EE8 B228 97EC B892 68C4 DA72 1418

To claim this, I am signing this object:

@cyk
cyk / chunk_by_element_length.php
Created April 8, 2014 18:31
chunk_by_element_length.php
<?php
/**
* Chunk by (combined) Element Length
*
* Similar to PHP's array_chunk but chunks on combined element length instead of element count.
* Takes an input array of elements and chunks by combined string lengths.
*
* NOTE: Any values that exceed chunk length will be excluded.
*
@cyk
cyk / EntityManagerMigration.php
Created April 8, 2014 18:29
EntityManagerMigration.php
<?php
namespace MyApp\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**