docker run -it --rm --name elixir-inst1 -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e APP_NAME=foo elixir \
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez; \
apt-get update; \
apt-get install -yy nodejs-legacy; \
mix phoenix.new $APP_NAME; \
cd $APP_NAME; \
mix deps.get
This file contains 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
import Transform from 'ember-data/transform'; | |
export default Transform.extend({ | |
deserialize(serialized) { | |
return Ember.Object.create(serialized); | |
}, | |
serialize(deserialized) { | |
return deserialized; | |
} |
This file contains 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
import Ember from 'ember'; | |
import Serializer from '../serializers/author'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
serialized: Ember.computed(function() { | |
return JSON.stringify(this.get('model').serialize(), null, 2); | |
}) | |
}); |
This file contains 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 Concerns | |
module AasmStateEvent | |
extend ActiveSupport::Concern | |
included do | |
attr_accessor :state_event | |
end | |
# It behaves just like `save!`, but when `state_event` was set through | |
# `assign_attributes` before, `save!` uses the given state with a `!` to |
This file contains 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
# This concern enables namespaces in Pundit. In order to use it, put this | |
# module into the `app/controllers/concerns` folder of your project and then | |
# include the module into the controller you want to namespace the policies in | |
# after the include of Pundit. | |
# | |
# To secify the namespace to use, overwrite the `pundit_namespace` method on | |
# your controller then. | |
# | |
# Example | |
# ======= |
This file contains 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 = App.Item = App.Model.extend | |
_attrs: ['title', 'note'] | |
token: null | |
title: null | |
note: null | |
max_assignments_count: 0 | |
assignments_count: 0 | |
save: (viddleToken) -> | |
if @get('isNew') | |
@constructor.createRecord(@, |
This file contains 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
*.gem | |
*.rbc | |
.bundle | |
.config | |
.yardoc | |
Gemfile.lock | |
InstalledFiles | |
_yardoc | |
coverage | |
doc/ |