Skip to content

Instantly share code, notes, and snippets.

@DougPuchalski
DougPuchalski / gist:328763e1de3cb08bc0b8
Last active August 29, 2015 14:14
When mixed into an Ember.Component class, actions can be explicitly or implicitly delegated to the parent.
/* jshint esnext: true */
import Ember from 'ember';
// When mixed into an Ember.Component class, actions can be explicitly or implicitly delegated to the parent.
// In general this makes the most sense for an app-level component, where actions are not mututated as they bubble
// up to higher levels.
export default Ember.Mixin.create({
// When true, all actions will be implicitly passed on to the parent
@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@markjaquith
markjaquith / gist:6225805
Last active February 21, 2024 23:56
WordPress multi-tenant directory structure sharing core files for opcode awesomeness, fast deployments, and low disk usage. With inspiration from @weskoop. "=>" indicates a symlink.
sites
|__ ms.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
| |__ wp-config.php
|__ one.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
@markjaquith
markjaquith / wp-config.php
Created August 12, 2013 20:19
`wp-config.php` file to sit above a pristine WordPress directory, whereby the site can symlink their WP directory to a common one, and this file will make sure their `wp-config.php` is the one that gets called. Untested in production. Just an idea right now.
<?php
$path = str_replace( $_SERVER['DOCUMENT_ROOT'], '', dirname( $_SERVER['SCRIPT_FILENAME'] ) );
$path_parts = explode( '/', $path );
while ( count( $path_parts ) > 0 ) {
$path = $_SERVER['DOCUMENT_ROOT'] . implode( '/', $path_parts ) . '/wp-config.php';
if ( file_exists( $path ) ) {
include( $path );
break;
} else {
array_pop( $path_parts );
@charleslouis
charleslouis / add_custom_gravatar.php
Created May 9, 2013 13:31
php - wordpress - custom default Gravatar + localhost support hack
/* AVATAR */
// Add a default avatar to Settings > Discussion
add_filter( 'avatar_defaults', 'add_custom_gravatar' );
if ( !function_exists('add_custom_gravatar') ) {
function add_custom_gravatar( $avatar_defaults ) {
$myavatar = get_stylesheet_directory_uri() . '/_inc/img/avatar.png';
$avatar_defaults[$myavatar] = 'Avatar Santé Ensemble';
return $avatar_defaults;