Skip to content

Instantly share code, notes, and snippets.

View SinisterMinister's full-sized avatar

Codey Whitt SinisterMinister

  • VisualGuruz
  • Remote
View GitHub Profile
var Kumo = require('./../../kumo');
Kumo.AppsNewRoute = Ember.Route.extend({
model: function () {
var self = this;
return Em.RSVP.hash({
projects: ORM.factory('project').orderBy('name').findAll(),
application: ORM.factory('application').create()
});
},
Kumo.AppsNewController = Ember.ObjectController.extend(Ember.PromiseProxyMixin, {
projects: null,
selectedProject: null,
repositories: null,
repositoriesGetter: function () {
var self = this;
return ORM.factory('repository').where('projectId').isEqual(this.get('selectedProject.id')).findAll().then(function (data) {
self.set('repositories', data);
var _ = require('underscore');
Kumo.AppsAppController = Ember.ObjectController.extend({
branches: null,
_refreshContainer: null,
_active: false,
init: function () {
var self = this;
var _ = require('underscore');
var EmberWrapper = Intaglio.wrappers.abstract.extend({
init: function (object) {
this._object = object;
},
unknownProperty: function (key) {
return this._object.get(key);
},
/**
* Decorates the model with a new method that has access to original methods
* @param model
* @param name
* @param method
*/
function decorateModel (model, name, method) {
var originalMethod = model[name],
decorator = function () {
var returnVal;
Kumo.AppsNewApplicationRoute = Ember.Route.extend({
setupController: function (controller) {
// Doesn't work
controller.set({
model: controller.get('controllers.appsNewIndex.model'),
projects: controller.get('controllers.appsNewIndex.projects')
});
// Works fine
controller.set('model', controller.get('controllers.appsNewIndex.model')).set('projects', controller.get('controllers.appsNewIndex.projects'));
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
var Intaglio = require('intaglio'),
repository = new Intaglio.repositories.mysql({
host: 'localhost',
database: 'database',
user: 'username',
password: 'password'
});
Intaglio.ORM.create(repository).then(function (ORM) {
ORM.factory('user').create({
@SinisterMinister
SinisterMinister / backpack.md
Last active August 29, 2015 14:24
My Backpacking List

My Backpacking Item List

  • Backpack
  • Day bag
  • Water Reservior
  • Compass
  • Map
  • Sunscreen
  • Rain jacket
  • Head lamp - $60
{
init: function(elevators, floors) {
var queue = [],
self = this;
for (var i = floors.length - 1; i >= 0; i--) {
floors[i].on("up_button_pressed", self.api.handlers.onUpButton);
floors[i].on("down_button_pressed", self.api.handlers.onDownButton);
floors[i].api = self.api;