Skip to content

Instantly share code, notes, and snippets.

View bj-mcduck's full-sized avatar

BJ McDuck bj-mcduck

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'option',
attributeBindings: ['value', 'selected'],
label: null,
selected: Ember.computed('value', 'selection', function(){
console.log(this.get('value'));
@bj-mcduck
bj-mcduck / my-file.scss
Created November 24, 2014 22:20
third-party-file.scss
//my-file.scss
$my-new-variable: #ccc;
@import 'third-party/third-party-file';
# Show action
App.DreamSymbolsShowController = Ember.ObjectController.extend
checkParent: (value)->
parent = @get 'model.parent'
value = value or 'name'
if parent
parent.get value
else
if value is 'name' then 'Dream Symbol' else 'Dream Symbols'
<?php
/*
Plugin Name: REW Twitter Feed Copy
Description: Sidebar Twitter feed
*/
class RewTwitterFeedCopy extends WP_Widget
{
function RewTwitterFeed()
{
.form-group
%label.control-label.col-sm-2
Name
.col-sm-10
= hb 'input type="text" value=symbol.name class="form-control input-group-large"'
.form-group
%label.control-label.col-sm-2
Category
.col-sm-10
@bj-mcduck
bj-mcduck / dream_symbols_controllers.js.coffee
Created April 18, 2014 19:02
Get stripped version of object array
App.DreamSymbolsNewController = Ember.ObjectController.extend
value: null
categories: (->
# [
# {
# id: 1
# name: "red"
# }
# {
attr = DS.attr
App.DreamSymbol = DS.Model.extend
image: attr 'string'
name: attr 'string'
description: attr 'string'
user: DS.belongsTo 'user'
parents: DS.hasMany('dream_symbol', { embedded: 'always' })
children: DS.hasMany('dream_symbol', { embedded: 'always' })
# Show Route
App.DreamSymbolsShowRoute = Ember.Route.extend
model: (params)->
self = @
@store.find('dream_symbol', params.id).then (symbol)->
Ember.RSVP.hash
symbol: symbol
siblings: self.store.findByIds 'dream_symbol', symbol.siblings
setupController: (controller, model)->