Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

余凡 nightire

I may be slow to respond.
View GitHub Profile
View adapters.application.js
import { Promise, defer } from 'rsvp';
import { get } from '@ember/object';
// a mock API response used below
const MOCK_PAYLOAD = {
person: {
id: '1',
name: 'Chris',
age: 33,
father: {
import Ember from 'ember';
const { Component, computed } = Ember;
const BlogPostCardComponent = Component.extend({
classNames: ['blog-post-card', 'card'],
classNameBindings: ['disabled::clickable'],
click() {
if (!this.get('disabled')) {
View components.clients.change-password-form\.js
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ChangePasswordForm extends Component {
@tracked oldPassword;
@tracked newPassword;
@tracked confirmPassword;
View controllers.application.js
import Ember from 'ember';
import { task, waitForEvent } from 'ember-concurrency';
const { Evented, Controller } = Ember;
export default Controller.extend(Evented, {
myTask: task(function* () {
while (true) {
let payload = yield waitForEvent(this, 'message');
nightire / Flexible Dockerized Phoenix
Created February 26, 2018 11:14 — forked from jswny/Flexible Dockerized Phoenix
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.
View Flexible Dockerized Phoenix


I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

nightire / application.route.js
Last active October 10, 2019 09:39 — forked from houfeng0923/application.route.js
Data Binding
View application.route.js
import Ember from 'ember';
export default Ember.Route.extend({
activate() {
nightire / mirage.config.js
Created April 12, 2017 09:47
Mirage Dev Boilerplate
View mirage.config.js
export default function() {
//window.server = this;
nightire / components.async-button.js
Last active June 20, 2017 07:28 — forked from machty/components.async-button.js
Concurrency with i18n driven
View components.async-button.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
nightire / components.AModel.js
Last active December 28, 2016 04:50
ember enumerables
View components.AModel.js
import Ember from 'ember';
export default Ember.Object.extend({
name: 'abb'
nightire / controllers.application.js
Last active December 9, 2016 17:46 — forked from Eteokles/controllers.application.js
Nested route, multiple outlet and renderTemplate problem
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Nested Route Problem'