View gist:4bf9cce0b463ffc55fd3
def _stepper_buttons(self):
buttons = []
mutes = self._mute_buttons.submatrix[4:8, :1]
assigns = self._crossfade_buttons.submatrix[4:8, :1]
for mute, assign in izip(mutes, assigns):
buttons.extend([mute, assign])
return buttons
View gist:d4152551a569c7741556
class Parent(object):
def log_message(self, string):
self.c_instance.log_message(string) # Calling a C bridge
def create_children(self):
self.child1 = Child(self)
self.child2 = Child2(self)
class Child(object):
def __init__(self, parent):
View gist:994038317a952fb97d5c
# I used to do this with Rabl
class BaseController < ApplicationController
before_filter @load_active_distributors
def load_active_distributors
# RABL template uses this
@active_distributors ||= Enterprise.distributors_with_active_order_cycles
end
end
View gist:062ce794f38a6fd8bec8
Darkswarm.factory "Loading", ->
new class Loading
message: null
Darkswarm.directive "loading", (Loading)->
scope: {}
restrict: 'E'
templateUrl: 'loading.html'
controller: ($scope)->
window.Loading = Loading
View gist:1a1ddbf8fe3e208f1b89
console.log $scope
ChildScope {$id: "00F", this: ChildScope, $$listeners: Object, $$listenerCount: Object, $parent: ChildScope…}
$id: "00F"
$parent: ChildScope
accordion: Object
checkout: Constructor
show: function (name) {
this: ChildScope
__proto__: ChildScope
View gist:5ad06f67e731217b9779
.columns.small-12.large-6{"ng-bind-html" => "producer.long_description"}
// producer.long_description is <p>text here</p>
View gist:12f75bcf72751e9e0933
Darkswarm.directive "ofnModal", ($modal)->
restrict: 'E'
replace: true
transclude: true
template: "<a>{{title}}</a>"
link: (scope, elem, attrs, ctrl, transclude)->
scope.title = attrs.title
contents = null
View gist:60b6ccd209f737c6e712
Darkswarm.controller "ForgotCtrl", ($scope, $http, $location, SpreeUser, AuthenticationService) ->
$scope.spree_user = SpreeUser.spree_user
$scope.path = "/forgot"
$scope.sent = false
$scope.active = ->
$location.path() == $scope.path
$scope.select = ->
AuthenticationService.select($scope.path)
View gist:c98dc1e2c34b7371e18d
%ng-include{src: "login.html"}
%ng-include{src: "signup.html"}
%ng-include{src: "forgot.html"}
View gist:11240782
Darkswarm.directive "ofnModal", ($modal)->
restrict: 'E'
replace: true
transclude: true
template: "<a>{{title}}</a>"
link: (scope, elem, attrs, ctrl, transclude)->
scope.title = attrs.title
scope.cancel = ->