Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@ianpetzer
ianpetzer / gdb_output_rogue_ruby_process
Created August 24, 2012 10:03
gdb output when trying debug rogue ruby process
I ran:
sudo gdbattach 12345
<--- replace "12345" with the actual PID
thread apply all bt
and got the following:
Thread 2 (Thread 0xb78bab70 (LWP 12947)):
#0 0x00e63424 in __kernel_vsyscall ()
#1 0x0055e0b1 in select () from /lib/libc.so.6
@ianpetzer
ianpetzer / ruby_gdb_output_debugging_rogue_thread
Created August 24, 2012 10:09
Output when trying to use gdb_ruby to debug cpu consuming threads
I used the ruby_gbd macros found at:
https://github.com/pusewicz/ruby-gdb
then ran:
sudo gdb /path/to/ruby PID
In gdb: I attempted to run the following commands
session-ruby
redirect_stdout # redirects gdb output to /tmp/ruby-debug.PID eval "caller" # dumps backtrace
However when I attempted to redirect the thread output to std_out, it appeared to kill the thread, as I couldn't run veal 'caller' afterwards.
OS/X 10.95
2.8 Ghz i5
SSD
Initial build:
Build successful - 12429ms.
Slowest Trees | Total
(function() {
window.DS = Ember.Namespace.create({
// this one goes to 11
CURRENT_API_REVISION: 11
});
})();
@ianpetzer
ianpetzer / gist:5656120
Created May 27, 2013 09:34
Ember-data sideload opinions
DS.RESTAdapter.configure('App.Opinion', {
sideloadsAs: 'opinions'
});
@ianpetzer
ianpetzer / gist:5656129
Created May 27, 2013 09:35
Ember User model with Opinions
App.User = DS.Model.extend({
name: DS.attr('string'),
opinions: DS.hasMany('App.Opinion')
});
@ianpetzer
ianpetzer / gist:5656135
Created May 27, 2013 09:36
ActiveRecord User with Opinions
class User < ActiveRecord::Base
has_many :opinions
end
@ianpetzer
ianpetzer / gist:5656133
Last active December 17, 2015 18:49
User Serializer that includes Opinions
class UserSerializer < ActiveModel::Serializer
attributes :id, :name
embed :ids, include: :true
has_many :opinions
end
{{#linkTo 'contact' contact tagName="tr"}}
<td>{{name}}</td>
<td><button {{action destroy contact bubbles=false}}>Destroy!</button></td>
<td>{{#linkTo 'somewhere else' foo}}something{{/linkTo}}</td>
{{/linkTo}}