Skip to content

Instantly share code, notes, and snippets.

View assembler's full-sized avatar

Milovan Zogovic assembler

  • metoda GmbH
  • Munich, Germany
  • 01:26 (UTC +02:00)
View GitHub Profile
@assembler
assembler / gist:2000460
Created March 8, 2012 11:05
(homebrew) doctor: command line tools only
Warning: Your Xcode is configured with an invalid path.
You should change it to the correct path. Please note that there is no correct
path at this time if you have *only* installed the Command Line Tools for Xcode.
If your Xcode is pre-4.3 or you installed the whole of Xcode 4.3 then one of
these is (probably) what you want:
sudo xcode-select -switch /Developer
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
@assembler
assembler / gist:2047145
Created March 15, 2012 21:36
Render gists on tumblr
<!-- GIST Renderer -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css"/>
<script type="text/javascript">
var cachedWrite = document.write,
body = $('body'),
gists = $("a[href*='gist.github.com'][href$='#embed']").get(),
embedNextGist = function() {
if (gists.length == 0) {
document.write = cachedWrite;
@assembler
assembler / simple_form.rb
Created March 30, 2012 09:24
defining default form options in simple_form
module SimpleForm::ActionViewExtensions::FormHelper
def simple_form_for_with_defaults(record, options={}, &block)
# define defaults here
simple_form_for_without_defaults(record, options, &block)
end
alias_method_chain :simple_form_for, :defaults
end
@assembler
assembler / gist:2367018
Created April 12, 2012 12:51
Gemfile.lock
GIT
remote: git://github.com/assembler/rails-erd.git
revision: 53e01cf74f6f051bcdb283847d145ef84ce19dc4
specs:
rails-erd (0.5.0pre)
activerecord (~> 3.0)
activesupport (~> 3.0)
choice (~> 0.1.4)
ruby-graphviz (~> 1.0)
default_settings: &default_settings
# whether to override image_tag helper with cl_image_tag
enhance_image_tag: false
# ...
static_image_support: false
development:
<<: *default_settings
cloud_name: "xxx"
@assembler
assembler / Gemfile.lock
Created April 23, 2012 12:01
Gemfile.lock
GIT
remote: git://github.com/assembler/rails-erd.git
revision: 53e01cf74f6f051bcdb283847d145ef84ce19dc4
specs:
rails-erd (0.5.0pre)
activerecord (~> 3.0)
activesupport (~> 3.0)
choice (~> 0.1.4)
ruby-graphviz (~> 1.0)
@assembler
assembler / trace
Created April 23, 2012 12:00
undefined method `identifier' for nil:NilClass
newrelic_rpm (3.3.4) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:166:in `render_with_newrelic'
actionpack (3.2.3) lib/action_view/renderer/renderer.rb:41:in `render_partial'
actionpack (3.2.3) lib/action_view/helpers/rendering_helper.rb:27:in `render'
app/views/notifications/index.html.erb:10:in `block in _app_views_notifications_index_html_erb___3212508411209234601_70332619008280'
actionpack (3.2.3) lib/action_view/helpers/cache_helper.rb:53:in `fragment_for'
actionpack (3.2.3) lib/action_view/helpers/cache_helper.rb:36:in `cache'
app/views/notifications/index.html.erb:8:in `_app_views_notifications_index_html_erb___3212508411209234601_70332619008280'
actionpack (3.2.3) lib/action_view/template.rb:143:in `block in render'
activesupport (3.2.3) lib/active_support/notifications.rb:125:in `instrument'
actionpack (3.2.3) lib/action_view/template.rb:141:in `render'
@assembler
assembler / gist:3097611
Created July 12, 2012 11:34
Gemfile.lock
GIT
remote: git://github.com/assembler/rails-erd.git
revision: 53e01cf74f6f051bcdb283847d145ef84ce19dc4
specs:
rails-erd (0.5.0pre)
activerecord (~> 3.0)
activesupport (~> 3.0)
choice (~> 0.1.4)
ruby-graphviz (~> 1.0)
@assembler
assembler / notes_spec.rb
Created August 13, 2012 11:05
with attachment
context 'with attachment' do
let(:file) {
Rack::Test::UploadedFile.new(Rails.root.join('spec/support/image.jpg'), 'image/jpeg')
}
let(:cloudinary_response) {
{ public_id: "rqdrdaexlgjy5j1hoabig", version: 1338884873, format: 'jpg', resource_type: 'image' }
}
before do
@assembler
assembler / gist:3339574
Created August 13, 2012 11:08
raw request
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="note[body]"
Voila
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="note[photo_file]"; filename="image.jpg"
Content-Type: image/jpeg
Content-Length: 1293
????JFIFHH??>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality