App.Customer = DS.Model.extend({
firstName:attr('string'),
address:belongsTo('address')
});
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
| # initializers/active_admin.rb | |
| module ActiveAdmin | |
| class OrderClause | |
| alias_method :initialize_old, :initialize | |
| alias_method :valid_old?, :valid? | |
| alias_method :to_sql_old, :to_sql | |
| def initialize(clause) | |
| if clause.class == String | |
| initialize_old(clause) |
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
| // mixins/hookup_container.js | |
| App.HookupContainer = Ember.Mixin.create({ | |
| // https://github.com/tehviking/giffindor/issues/1#issuecomment-51066764 | |
| hookupContainer: function() { | |
| this.container = SoftLacrosse.__container__; | |
| }.on('init'), | |
| }); | |
| // components/my_component.js | |
| App.MyComponent = Ember.Component.extend( |
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
| #!/usr/bin/ruby | |
| require 'pty' | |
| cmd = ARGV.first | |
| begin | |
| PTY.spawn( cmd ) do |stdin, stdout, pid| | |
| begin | |
| stdin.each do |line| |
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
| export default Ember.Component.extend({ | |
| interval: 1000, | |
| timer: null, | |
| startTimer() { | |
| const timer = Ember.run.later(this, () => { | |
| this.sendAction('tick'); | |
| this.startTimer(); | |
| }, this.get('interval')); | |
| this.set('timer', timer); | |
| }, |
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 'right_aws' | |
| namespace :utils do | |
| namespace :attachments do | |
| task :initialize_s3 => :environment do | |
| s3_config = YAML.load_file(File.join(File.dirname(__FILE__), '/../../config/amazon_s3.yml')) | |
| s3_config = s3_config[RAILS_ENV].to_options | |
| @s3 = RightAws::S3.new(s3_config[:access_key_id], s3_config[:secret_access_key]) | |
| 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 PaperclipMigrations | |
| def self.included(base) | |
| base.extend ClassMethods | |
| end | |
| module ClassMethods | |
| def add_paperclip_fields(table, prefix) | |
| add_column table, "#{prefix}_file_name", :string | |
| add_column table, "#{prefix}_content_type", :string |
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
| #Tasks have been added to fully maintain nginx, unicorn, redis, memcached, start resque workers and run any command on any server in the farm. | |
| #<pre> | |
| #cap nginx:restart # Restart Nginx. | |
| #cap nginx:start # Start Nginx. | |
| #cap nginx:status # Status of Nginx. | |
| #cap nginx:stop # Stop Nginx. | |
| #cap nginx:tail_error # Tail the Nginx error logs. | |
| #cap unicorn:reload # reload your unicorn servers. | |
| #cap unicorn:restart # restart your unicorn servers. | |
| #cap unicorn:start # start your unicorn servers. |
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 LastRequestResponse | |
| def last_request | |
| page.driver.last_request | |
| end | |
| def last_response | |
| page.driver.last_response | |
| end | |
| end |
OlderNewer