Skip to content

Instantly share code, notes, and snippets.

@svoynow
svoynow / rails3_maven_assets_precompile
Created January 5, 2012 17:47
rails3 maven plugin assets:precompile
wm720l44010a:devconsole svoynow$ mvn rails3:rake -Dtask=assets:precompile -Drake.args="-f src/rails/Rakefile -T" -X
Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)
Maven home: /usr/share/maven
Java version: 1.6.0_29, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.6.8", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /Users/svoynow/.m2/settings.xml
@svoynow
svoynow / rails3_maven_assets_precompile_production
Created January 5, 2012 21:39
rails3 maven plugin assets:precompile w/ production
wm720l44010a:devconsole svoynow$ mvn rails3:rake -Dtask=assets:precompile:all -Drake.args="-f src/rails/Rakefile" -X
Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)
Maven home: /usr/share/maven
Java version: 1.6.0_29, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.6.8", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /Users/svoynow/.m2/settings.xml
task :foo do
puts "============ The value of $0 is now: #{$0} ================="
end
mvn rails3:rake -Dtask=foo -Drake.args="-f src/rails/Rakefile"
[INFO] --- rails3-maven-plugin:0.28.6:rake (default-cli) @ devconsole ---
[INFO] ============ The value of $0 is now: -e =================
[INFO] ---------------------------------------------------------------
@svoynow
svoynow / precompile_workaround
Created January 9, 2012 20:58
assets:precompile workaround
def jruby_rake_task(task)
maven_home = ENV['MAVEN_HOME'] || ENV['M2_HOME'] || "~/.m2"
maven_repo = File.join(File.expand_path(maven_home), "repository")
env = ENV['RAILS_ENV'] || 'production'
groups = ENV['RAILS_GROUPS'] || 'assets'
jruby_jar = File.join(maven_repo, "org/jruby/jruby-complete/1.6.5/jruby-complete-1.6.5.jar")
tools = File.join(maven_repo, "de/saumya/mojo/ruby-tools/0.28.6/ruby-tools-0.28.6.jar")
cmd = "java -Xbootclasspath/a:#{jruby_jar} org.jruby.Main -e \"load('jar:file:#{tools}\!/META-INF/jruby.home/bin/rake')\""
args = [cmd, task,"RAILS_ENV=#{env}","RAILS_GROUPS=#{groups}"]
args << "--trace" if Rake.application.options.trace
@svoynow
svoynow / post.rb
Created August 23, 2013 21:40
changes to post.rb
def sorted_feedback
@sorted_feedback
end
def sort_feedback(opts)
range = opts[:range] || (0..-1)
@sorted_feedback = (opts[:sort] == :best ? highest_rated_feedback : feedback).slice(range)
end
@svoynow
svoynow / Brownbag notes
Created September 20, 2016 16:50
Brownbag notes
- `git checkout explicit-types`
- show more type errors possible w/ annotations
- `git checkout hello-world`
- show undefined error, type error (in editor, in browser)
- `elm-repl`
- Built-in Types
- `git checkout explicit-types`
- show more type errors possible w/ annotations
{"networks": [
{"name" : "foo"},
{"name" : "bar"},
]
}
import Json.Decode exposing (list, int, string, null, float, Decoder, object2, (:=), at, oneOf)
import Json.Decode.Pipeline exposing (decode, required, custom, requiredAt)
-- trying to get rid of this
type alias NetworksContainer =
{
networks : List Network
}
-- decoders
module.js:457
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/elm-upgrade/upgrade.js:6:14)
ERROR in ./src/elm/Main.elm
Module build failed: Error: Compiler process exited with error Compilation failed
Problem in dependency elm-lang/virtual-dom 2.0.0
The elm-package.json constraints of 'elm-lang/virtual-dom' are probably
letting too much stuff through. Definitely open an issue on the relevant github
repo to get this fixed and save other people from this pain.
In the meantime, take a look through the direct dependencies of the broken
package and see if any of them have had releases recently. If you find the new