Skip to content

Instantly share code, notes, and snippets.

View stefanpenner's full-sized avatar
🎯
Focusing

Stefan Penner stefanpenner

🎯
Focusing
View GitHub Profile
@stefanpenner
stefanpenner / args.js
Created June 11, 2015 17:51
node --allow_natives_syntax --block_concurrent_compilation --trace_opt --trace_deopt args.js (node 2.x)
function printStatus(fn) {
switch (%GetOptimizationStatus(fn)) {
case 1: console.log('Function is optimized'); break;
case 2: console.log('Function is not optimized'); break;
case 3: console.log('Function is always optimized'); break;
case 4: console.log('Function is never optimized'); break;
case 6: console.log('Function is maybe deoptimized'); break;
}
}
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@stefanpenner
stefanpenner / controllers.application.js
Last active August 29, 2015 14:24
component-less-helpers
export default Ember.Controller.extend({
actions: {
changed(val) {
this.set('currentValue', val);
console.log(val);
}
}
});
require 'rubygems'
require 'yaml'
=begin
Vhost.yml ( path_to_yml_file ) >> Collection of Vhosts
Vhost.new (params) >> Single Vhost
=end
class Vhost
def self.yml(path)
vhosts = []
#load templates
diff --git a/index.js b/index.js
index 2ec4b85..d010a51 100644
--- a/index.js
+++ b/index.js
@@ -59,9 +59,9 @@ Babel.prototype = Object.create(Filter.prototype);
Babel.prototype.constructor = Babel;
Babel.prototype.targetExtension = ['js'];
-Babel.prototype.rebuild = function() {
+Babel.prototype.build = function() {
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});

well its tuesday, but I was with family yesterday...

Late last week @cibernox reported that emberjs/ember.js#11748 was still leaking for him. As it turns out, the main leak was forgetting to null out top levels vars in afterEach. But that kinda sucks, as it is tedious and error prone. So instead I wanted a better solution, one where the purden was not on the test writers. So, as it turns out we can also just release the ES2015 module after requiring it, allowing the JS GC to do the work for us.

The follow commits add the ability to unsee a module in the loader, and configure the test-loader to unsee after requiring.

<td>
<a href="/admin/users/29"><img alt="User" src="/images/user.png?1227591989" /></a>
<b><a href="/admin/users/29">Stefan Penner</a></b>
</td>
#_user.html.haml
%tr{:class => cycle('odd','even')}
%td.text-align-left
=link_to image_tag('user.png'),[:admin,user]
%b=link_to user.name,[:admin,user]
%td.text-align-left=user.email
%td= 'confirmed' if user.confirmed?
%td= link_to 'Edit', edit_admin_user_url(user)
%td= link_to image_tag('icon-remove.gif'), [:admin,user], :confirm => 'Are you sure?', :method => :delete