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
# create the template | |
template = PageOfflineTemplate.new | |
template.quote = quote | |
template.pages = quote.build_pages | |
# Here I render a template with layout to a string then a PDF | |
pdf = PDFKit.new template.render_to_string(:template=>"quotes/review.html.haml") | |
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
{"lastUpload":"2020-07-31T15:59:44.337Z","extensionVersion":"v3.4.3"} |
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 Core | |
module AssetHelper | |
def self.root_path | |
String === Rails.root ? Pathname.new(Rails.root) : Rails.root | |
end | |
def self.add_extension(filename, extension) | |
filename.to_s.split('.').include?(extension) ? filename : "#{filename}.#{extension}" | |
end |
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'; | |
const Component = Ember.Component.extend({ | |
layoutName: "components/my-component", | |
tagName: "form", | |
foo: null | |
}); | |
Component.reopenClass({ | |
positionalParams: ["foo"] |
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
counter: Ember.computed({ | |
get(){ | |
return 0; | |
}, | |
set(k,v){ |
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
ubuntu@ip-172-31-21-253:/var/deploy/vroom-staging/web_head/releases/20161004023037/front-end$ ./node_modules/.bin/ember build --environment="production" | |
Could not start watchman; falling back to NodeWatcher for file system events. | |
Visit http://ember-cli.com/user-guide/#watchman for more info. | |
⠋ BuildingTorii is installed but not configured in config/environment.js! | |
Build failed. | |
File: assets/vendor.js (123701:7) | |
The Broccoli Plugin: [UglifyWriter] failed with: | |
Error | |
at new JS_Parse_Error (<anonymous>:1545:18) | |
at js_error (<anonymous>:1553:11) |
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
const fieldList = [ | |
{ label: 'Foo Fields', fields: [{name: 'foo', selected: false}] }, | |
{ label: 'Bar Fields', fields: [{name: 'bar', selected: true}] } | |
] | |
fields: Ember.computed('fieldList.@each.fields', function() { | |
return this.get("fieldList").mapBy("fields"); | |
}), | |
enabledFields: Ember.computed("fields", "fields.@each.selected", function(){ |
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
// | |
// The logic here is the transitionend event fires instantly | |
// after the transition is done (1ms here). I have seen timeouts | |
// taking up to 300ms to fire (!) so the main avantage is responsiveness. | |
// | |
window.requestTimeout = (function(){ | |
var vendors = 'Webkit Moz O ms Khtml'.split(' '), | |
supports = (function() { | |
var div = document.createElement('div'), | |
len = vendors.length; |
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'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
building: Ember.computed(function(){ | |
return {id: 1, name: "BUILDING!"} | |
}) | |
}); |
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
Ember.ActiveState = Ember.LayoutState.extend | |
isActive: false | |
enter: (manager, transition)-> | |
@_super(manager, transition) | |
@set("isActive", true) | |
exit: (manager, transition)-> | |
@_super(manager, transition) | |
@set("isActive", false) |
NewerOlder