Skip to content

Instantly share code, notes, and snippets.

@iamdtang
iamdtang / createBearerToken.js
Last active September 30, 2018 13:28 — forked from elmariachi111/createBearerToken.js
A Javascript file that requests a Twitter bearer token for application only authentication (https://dev.twitter.com/docs/auth/application-only-auth). Depends on mikeals request library (https://github.com/mikeal/request) (npm install request)
var request = require("request");
var key = process.env.TWITTER_CONSUMER_KEY;
var secret = process.env.TWITTER_CONSUMER_SECRET;
var cat = key + ":" + secret;
var credentials = new Buffer(cat).toString('base64');
var url = 'https://api.twitter.com/oauth2/token';
request({
@iamdtang
iamdtang / controllers.application.js
Created July 28, 2018 14:56 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
import AdultValidations from '../validations/adult';
import ChildValidations from '../validations/child';
import { reservedEmails } from '../validators/uniqueness';
import { schema } from '../models/user';
const { get } = Ember;
const { keys } = Object;
export default Ember.Controller.extend({
@iamdtang
iamdtang / rock-and-roll-ember-interview-questions.md
Last active February 7, 2021 08:17 — forked from balinterdi/rock-and-roll-ember-interview-questions.md
The Rock & Roll with Ember band – Interview questions
  1. Could you introduce yourself in a few sentences?

Hello! My name is David Tang. I've been a web developer for 12 years and working with Ember for about 6 years. The technologies I have primarily focussed on in my career have been Ember and Laravel. This year I published my book Pro Ember Data with Apress. Currently I work at a startup called AuditBoard, where we do use Ember! I also teach web development courses part-time at the University of Southern California (USC) for the Information Technology Program (ITP), bringing practical and modern technologies to the classroom.

  1. Which part of the world you are from?

Los Angeles, CA

  1. When and how did your Ember journey begin? How did you learn about the framework?
import Component from '@glimmer/component';
import Sort from '../state-object/sort';
export default class extends Component {
sorter = new Sort()
get sorted() {
const { data } = this.args;
const { sorter } = this;
sorter.data = data;