Skip to content

Instantly share code, notes, and snippets.

@jefflab
jefflab / gist:1482196
Created December 15, 2011 18:23
NFS propagation debug capistrano task
task :check_current_symlink, :roles => :app do
run %Q[TARGET=`ls -l #{current_path} | sed 's/.*->\ //g'`; RELEASE_PATH='#{release_path}'; if [ $TARGET == $RELEASE_PATH ]; then echo "CURRENT"; else echo "OLD"; fi; echo "TARGET=$TARGET"; echo "RELEASE_PATH=$RELEASE_PATH"]
end
before "deploy:restart", "check_current_symlink"
@jefflab
jefflab / gist:957356
Created May 5, 2011 16:25
RubyMine Error Stacktrace
2011-05-05 09:24:19,375 [56842670] INFO - ls.structure.data.Declarations - Creating declaration pointer to a non-stub-based element Dot reference
2011-05-05 09:24:19,375 [56842670] INFO - ls.structure.data.Declarations - Creating declaration pointer to a non-stub-based element Dot reference
2011-05-05 09:24:19,375 [56842670] INFO - ls.structure.data.Declarations - Creating declaration pointer to a non-stub-based element Dot reference
2011-05-05 09:24:19,375 [56842670] INFO - ls.structure.data.Declarations - Creating declaration pointer to a non-stub-based element Dot reference
2011-05-05 09:24:19,378 [56842673] ERROR - by.ruby.lang.RubySupportLoader - org.jruby.exceptions.RaiseException: undefined method `inflections' for ActiveSupport::Inflector:Module
java.lang.Exception: org.jruby.exceptions.RaiseException: undefined method `inflections' for ActiveSupport::Inflector:Module
at org.jetbrains.plugins.ruby.ruby.lang.RubySupportLoader.evaluate(RubySupportLoader.java:178)
at org.jetbrains.plugins
TypeError: Error #1009: Cannot access a property or method of a null object reference.
atVideoTool/_assign_camera()[/Users/jhollenbeck/Sites/zoodles/av/video_tool/src/VideoTool.as:121]
atVideoTool/_setup_video()[/Users/jhollenbeck/Sites/zoodles/av/video_tool/src/VideoTool.as:101]
atVideoTool/_event_stage_init()[/Users/jhollenbeck/Sites/zoodles/av/video_tool/src/VideoTool.as:51]
mxmlc -debug=true video_tool/src/VideoTool.as
cp video_tool/src/VideoTool.swf ~/code/zoodles/www/public/widgets/video_tool.swf
TypeError: Error #1009: Cannot access a property or method of a null object reference.
atMailRecorder/setupVideo()[/Users/jlabarge/code/zoodles/av/mail_recorder/src/MailRecorder.as:207]
# ERROR
jeffbox:www> vagrant up
There was a problem with the configuration of Vagrant. The error message(s)
are printed below:
vm:
* Base MAC address for eth0/NAT must be set. Contact box maintainer for more information.
# Vagrantfile
@jefflab
jefflab / gist:651886
Created October 28, 2010 17:38
vidsync get
jeffbox:www> pwd
/Users/jlabarge/code/zoodles/www
jeffbox:www> find . -name "*.rb" -exec grep "StorybookVideo" {} \; -print
StorybookVideo.find(slug).put(:sync)
StorybookVideo.find(slug).destroy
./app/models/book_reading_page.rb
class StorybookVideo < ActiveResource::Base
./app/resources/storybook_video.rb
StorybookVideo.should_receive(:find).ordered.with(@page.slug).and_return(video)
StorybookVideo.should_receive(:find).with(@page.slug).and_return(video)
<select id="server">
<option value="localhost.zoodles.com">localhost.zoodles.com</option>
<option value="staging.zoodles.com">staging.zoodles.com</option>
<option value="www.zoodles.com">www.zoodles.com</option>
</select>
$( '#server' ).children( "[value='" + zoodles.server + "']" ).attr( 'class', 'cow' );
[<option value=​"localhost.zoodles.com" class=​"cow">​localhost.zoodles.com​</option>​]
$( '#server' ).children( "[value='" + zoodles.server + "']" ).attr( 'selected', 'true' );
{
"name": "test",
"description": "test",
"version": "1",
"background_page": "app/background.html",
"app": {
"launch": {
"local_path": "app/main.html"
}
},
// main.html
<frameset rows="50,*">
<frame src="nav_bar.html" />
<frame src="http://www.zoodles.com/" />
</frameset>
// background.html
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
# How to print objects like the irb console
user = User.new( :name => "Henry" )
puts "#{user.inspect}" # print object in string
p user # shortcut, same as above
=begin
This is a machine generated main stub file using stdlib-doc
Created on Thu Mar 12 13:35:16 +0300 2009 by IntelliJ Ruby Stubs Generator.
This documentation uses content from the book "Programming Ruby - The Pragmatic Programmer's Guide"
Copyright � 2001 by Addison Wesley Longman, Inc. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/)).
Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.
Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.
This documentation uses content form the article http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Variables_and_Constants#Pre-defined_Variables