Skip to content

Instantly share code, notes, and snippets.

= form_for(@bug) do |f|
= label_tag(:flow, Flow)
= f.collection_select :flow_id, Flow.all, :id, :name
def index
Attachment.all do |a|
File.open(a.filename, 'w') { |file|
file.write(a.filedata)
}
end
end
[Mon Jan 11 04:24:37.594424 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
(2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/${APACHE_LOG_DIR}/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1
AH00014: Configuration check failed
import jsdom from 'jsdom'
import chai from 'chai'
import plugin from 'chai-enzyme'
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>')
const win = doc.defaultView
global.document = doc
global.window = win
@marr
marr / app.js
Last active February 2, 2016 00:02
import React from 'react'
import { render } from 'react-dom'
import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { IndexRoute, Router, Route, browserHistory } from 'react-router'
import { syncHistory } from 'react-router-redux'
const reduxRouterMiddleware = syncHistory(browserHistory)
/*
'use strict';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import path from 'path'
const env = process.env['NODE_ENV'] || 'development'
const config = {
entry: [
@marr
marr / -
Created February 6, 2016 00:33
$ node_modules/.bin/webpack --config webpack.config.test.babel.js --target node test.js
Hash: b082aebc395d1dffcd90
Version: webpack 1.12.13
Time: 1752ms
Asset Size Chunks Chunk Names
test.js 1.05 MB 0 [emitted] main
test.js.map 1.26 MB 0 [emitted] main
[0] multi main 40 bytes {0} [built]
[2] ./app \.test\.js$ 356 bytes {0} [built]
+ 176 hidden modules
@marr
marr / -
Created February 6, 2016 00:49
// https://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.[hash].js',
minChunks: Infinity
})
@marr
marr / gist:36cdbe52acd38de9045e
Created February 13, 2016 19:42
React router with simple redux props
// imports go here...
// Assume prop{1,2} are sent in via props. I use react-router-redux for this.
const Page = ({ children, prop1, prop2 }) => (
<div>
<Menu />
<Content { prop1, prop2 }>
{children}
</Content>
</div>
)
diff --git c/app/app.js w/app/app.js
index 171ab05..1dfe5f5 100644
--- c/app/app.js
+++ w/app/app.js
@@ -8,8 +8,6 @@ import { routeActions, syncHistory } from 'react-router-redux'
const reduxRouterMiddleware = syncHistory(browserHistory)
// const reduxRouterMiddleware = syncHistory(hashHistory)
-import 'babel-polyfill'
-