Skip to content

Instantly share code, notes, and snippets.

View Gaurav0's full-sized avatar
💭
I'm looking for new opportunities!

Gaurav Munjal Gaurav0

💭
I'm looking for new opportunities!
View GitHub Profile
@Gaurav0
Gaurav0 / Nodejitsu1
Created September 19, 2012 01:28
Nodejitsu deployment error
C:\Users\Gaurav\Documents\Development\js\tictactoe>jitsu deploy
info: Welcome to Nodejitsu gaurav0
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn:
warn: The package.json file is missing required fields:
warn:
warn: subdomain, engines
warn:
@Gaurav0
Gaurav0 / index.js
Last active August 29, 2015 14:15
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Rebuild to run it on the right
var when = require('when');
function print(str) {
var p = document.createElement('p');
document.body.appendChild(p);
p.innerHTML = str;
}
export default Ember.Component.extend(App.AddableMixin, {
layoutName: 'components/bar-baz',
classNames: ['bar-baz'],
_createBaz: function() {
Ember.run.schedule('afterRender', function() {
console.log(this.$().innerHTML);
}.bind(this));
}.on('didInsertElement')
});
export default Ember.TextField.extend({
didInsertElement() {
this.$().focus();
this.$().addClass('focus'); // headless testing is brittle
}
});
import DS from 'ember-data';
export default DS.Adapter.extend({
shouldReloadAll() {
//silence ember-data deprecation
return true;
},
findAll() {
// rather then doing an ajax, just echo back the default data
@Gaurav0
Gaurav0 / controllers.application.js
Last active August 29, 2015 14:25
Demonstrate External Dependencies
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@Gaurav0
Gaurav0 / Debounced Ember Search
Last active March 8, 2016 06:00 — forked from koriroys/Debounced Ember Search
debounced search
<p>About Page</p>
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
renderPost() {
this.sendAction('renderPost');
},
renderComment() {
this.sendAction('renderComment');
}
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
selectFlower() {
alert('clicked');
}
}
});