Skip to content

Instantly share code, notes, and snippets.

@kevinrobinson
kevinrobinson / gen_word2vec.py
Created December 6, 2015 16:51
Built gen_word2vec.py, 3972c79
"""Python wrappers around Brain.
This file is MACHINE GENERATED! Do not edit.
"""
from google.protobuf import text_format
from tensorflow.core.framework import op_def_pb2
from tensorflow.python.framework import op_def_registry
from tensorflow.python.framework import ops
{
...
output: {
path: outputPath,
publicPath: "https://cnd.com/production/js/", // hostname needs to match Rails config
filename: '[name]-[chunkhash].js'
},
plugins: [
new AssetsPlugin({ path: outputPath }),
new webpack.optimize.UglifyJsPlugin(),
loaders: [
...
{ test: /\.png$/, loader: 'url-loader?limit=100000' },
{ test: /\.jpg$/, loader: 'file-loader' },
{ test: /\.svg$/, loader: 'file-loader' }
]
}
loaders: [
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.scss$/, loaders: ["style", "css", "sass"] }
]
// Before, with Sprockets:
//= require style
//= require tablesort
//= require tooltipster
//= require jquery-ui
// ...
@import 'variables';
@import 'overall';
@import 'type';
# Before, Sprockets:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => false %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => false %>
# After, a plain artifact:
<script src="/webpack_build/dev/webpack_bundle.js"></script>
# Asset compilation works by having the webpack container continually build an artifact,
# and that artifact being mounted for Rails to serve statically.
webpack:
build: webpack/.
command: npm run watch
volumes:
- ./webpack/config:/mnt/webpack/config
- ./webpack/src:/mnt/webpack/src
- ./volumes/webpack_build:/mnt/build
# ...
FROM node:4.2.2
RUN npm install -g webpack
COPY package.json /mnt/webpack/
WORKDIR /mnt/webpack
RUN npm install
COPY . /mnt/webpack/
// Sprockets style:
//= require jquery
//= require profile
//= require profile_interventions
//= require session_timeout_warning
// CommonJS style:
window.jQuery = window.$ = require('jquery');
require('./profile');
require('./profile_interventions');
FROM ruby:2.2
# see update.sh for why all "apt-get install"s have to stay as one long line
RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
# see http://guides.rubyonrails.org/command_line.html#rails-dbconsole
RUN apt-get update && apt-get install -y mysql-client postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV RAILS_VERSION 4.2.5