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
. | |
├─ app | |
│ ├── components | |
│ ├── controllers | |
│ ├── helpers | |
│ ├── routes | |
│ ├── services | |
│ ├── templates | |
│ ├── router.js | |
│ └── index.js |
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
// jquery.js | |
import jQuery from 'jquery/dist/jquery.min' | |
window.jQuery = jQuery | |
// ember.js | |
import './jquery' | |
import 'components-ember/ember.min' | |
export default window.Ember | |
// webpack alias |
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: { | |
loaders: [ | |
{ | |
test: /\.hbs$/, | |
include: /app\/templates/, // or whatever directory you have | |
loader: 'ember-webpack-loaders/htmlbars-loader' | |
}, | |
{ | |
test: /app\/index\.js/, // the main app file |
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
var HtmlbarsCompiler = require('ember-cli-htmlbars') | |
var templateTree = new HtmlbarsCompiler('../app/templates', { | |
isHTMLBars: true, | |
// provide the templateCompiler that is paired with your Ember version | |
templateCompiler: require('components-ember/ember-template-compiler.js') | |
}); | |
templateTree.processString(source, templatePath) |
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
var Promise = require('promise'); | |
var React = require('react/addons'); | |
var Router = require('react-router'); | |
var App = buildRequire('app-server-bundle'); | |
var parseAssetManifest = appServerRequire('utils/parse-asset-manifest'); | |
var assetManifest = parseAssetManifest(App.Settings.ASSET_HOST); | |
function fetchData(routes, done) { |
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 ApplicationHelper | |
# Using raw files | |
def embedded_svg filename, options = {} | |
root = options[:root] || Rails.root.join("app", "assets", "svgs") | |
file = File.read(File.join(root, filename)) | |
doc = Nokogiri::HTML::DocumentFragment.parse file | |
svg = doc.at_css 'svg' | |
svg['class'] = options[:class] if options[:class].present? | |
doc.to_html.html_safe | |
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
# Helper that use the same logic as javascript_include_tag ensuring body=0 for the manifests | |
# Usage: <%= always_no_debug_javascript_include_tag 'manifest' %> | |
# | |
def always_no_debug_javascript_include_tag *sources | |
options = sources.extract_options!.stringify_keys | |
path_options = options.extract!('protocol').symbolize_keys | |
sources.uniq.map {|source| | |
path = path_to_javascript(source, path_options) | |
path.gsub!(/\?body=1/, "?body=0") if path =~ /\?body=1$/ |
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
package str | |
func Reverse(input string) string { | |
rune_array := []rune(input) | |
size := len(rune_array) - 1 | |
result := make([]rune, size + 1) | |
for i := 0; i <= size; i++ { | |
result[size - i] = rune_array[i] | |
} |
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
$("#slide-container").destaque({ | |
autoSlideDelay: 10000, | |
resumeSlideDelay: 10000, | |
onInit: function(instance) { | |
instance.pause(); | |
}, | |
onResume: function(instance) { | |
instance.pause(); | |
} | |
}) |
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
.item img, .item .foreground { | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0); | |
} |