This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FIRST_OPERATORS = Set.new(['+', "-"]) | |
| SECOND_OPERATORS = Set.new(['*', '/']) | |
| def is_digit?(char) | |
| char[0].between?('0', '9') | |
| end | |
| def is_operator?(char) | |
| op_order(char) > 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calculate(s) | |
| stack = [] | |
| num = 0 | |
| op = '+' | |
| s.each_char.with_index do |char, i| | |
| if char.between?('0', '9') | |
| num = num * 10 + char.to_i | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(defaults) { | |
| var env = EmberApp.env(), | |
| isProductionLikeBuild = ('production' === env) || ('staging' === env); | |
| var app = new EmberApp(defaults, { | |
| minifyCSS: { enabled: !!isProductionLikeBuild }, | |
| minifyJS: { enabled: !!isProductionLikeBuild }, | |
| fingerprint: { | |
| enabled: !!isProductionLikeBuild, | |
| generateRailsManifest: true, | |
| exclude: ['manifest.json'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApiOutputMarshal::MassPay | |
| attr_reader :mass_pay | |
| def initalize(mass_pay) | |
| @mass_pay = mass_pay | |
| end | |
| def status | |
| last_two = mass_pay.bank_account.account_number[-2..-1].to_i | |
| if (0..5).member?(last_two) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'dm-types/support/flags' | |
| module DataMapper | |
| class Property | |
| class StringEnum < String | |
| min 1 | |
| include Flags | |
| def initialize(model, name, options = {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'dm-core' | |
| require 'money' | |
| module DataMapper | |
| class Property | |
| class Money < Object | |
| # load_as ::Money | |
| # dump_as ::String | |
| # coercion_method :to_money |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'dm-core' | |
| require 'money' | |
| module DataMapper | |
| class Property | |
| class Money < String | |
| load_as ::Money | |
| dump_as ::Money | |
| coercion_method :to_money | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(exports) { | |
| window.DS = Ember.Namespace.create({ | |
| CURRENT_API_REVISION: 2 | |
| }); | |
| })({}); | |
| (function(exports) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var App = Em.Application.create(); | |
| App.Person = DS.Model.extend({ | |
| name: DS.attr('string') | |
| , location: DS.attr('string') | |
| }); | |
| var primaryKey = Ember.getPath('App.Merchant', 'proto.primaryKey'); | |
| // expected primaryKey to be 'id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| skylar@dev-vm:~/kiva/main/sites/testing$ puppetd --test | |
| warning: peer certificate won't be verified in this SSL session | |
| err: Could not request certificate: Certificate retrieval failed: Certificate request does not match existing certificate; run 'puppetca --clean dev-vm.localdomain'. |
NewerOlder