Skip to content

Instantly share code, notes, and snippets.

@machty
machty / router-facelift-guide.md
Last active July 10, 2024 15:14
Guide to the Router Facelift

Ember Router Async Facelift

The Ember router is getting number of enhancements that will greatly enhance its power, reliability, predictability, and ability to handle asynchronous loading logic (so many abilities), particularly when used in conjunction with promises, though the API is friendly enough that a deep understanding of promises is not required for the simpler use cases.

@10io
10io / Ember Tips.md
Last active December 18, 2015 16:39
Ember.js tips
  • Do not try to return properties from controllers, return the whole object.
    • Eg: If you want to read a property of the first object of hasMany: do not return elements.firstObject.property. The hasMany are lazily loaded, thus not visible for models/controllers! The correct way is this: return the firstObject as computed property(elements.@each) and in the view bind the property. This way when the collection is lazy loaded, the view is notified and will update.
  • Caution with collections in computed properties. You can observe the collection pointer or the collection elements(using @each)! They are different. Observing the collection pointer will notify when the collection is replaced or deleted, but not when an item is added! For this, you need to use @each.
  • Displaying multiple model type on the same page is done with render(you can do it also with outlets but less clean).
  • Observing a collection in order to apply a JQuery plugin is done using a CollectionView with a function observing content. In t
@bodokaiser
bodokaiser / native_rest_adapter.js
Last active December 18, 2015 22:59
Native REST Adapter for EmberData
(function(App) {
App.Adapter = DS.RESTAdapter.extend({
namespace: null,
serializer: DS.RESTSerializer.extend({
primaryKey: function() {
return '_id';
@mplewis
mplewis / flask-uwsgi-nginx-primer.md
Last active January 24, 2025 18:21
Flask + uWSGI + nginx Primer. I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
@sebastianseilund
sebastianseilund / merged_array.js
Last active December 20, 2015 07:58
An implementation of a merged array in Ember.js that combines items from multiple source arrays so you can easily list them together in your Handlebars templates. Read the blog post at the [Billy's Billing Developer Blog](http://dev.billysbilling.com/blog/How-to-merge-multiple-data-sources-into-one-array-in-Ember-js)
/**
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes
* all items from all source arrays in an efficient way.
*
* Usage:
*
* ```javascript
* var obj = Ember.Object.create({
* people: [
* {
Ember.LOG_BINDINGS = true;
var App = window.App = Ember.Application.create({
LOG_STACKTRACE_ON_DEPRECATION : true,
LOG_TRANSITIONS : true,
LOG_TRANSITIONS_INTERNAL : true,
LOG_VIEW_LOOKUPS : true,
LOG_ACTIVE_GENERATION : true
});
@johnkpaul
johnkpaul / component-list.md
Last active December 24, 2015 12:19
Ember.Component list
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'section',
classNames: [ 'i18n-demo' ],
i18n: Ember.inject.service(),
beenClicked: false,
text: Ember.computed('i18n.locale', function()
{
@nickoala
nickoala / 0_python_email.md
Last active February 11, 2025 20:23
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria