Skip to content

Instantly share code, notes, and snippets.

@JonnieCache
JonnieCache / fix-google-favicon.user.js
Created September 2, 2015 10:03
User script to put back the 2012 google favicon
// ==UserScript==
// @id fix-google-favicon
// @name fix-google-favicon
// @version 1.0
// @namespace jonniecache
// @author jonniecache
// @description Put back the 2012 google favicon so you can find your tabs
// @include *.google.*
// @run-at document-end
// ==/UserScript==
grep -rl "ORDER BY '\w*'" . | cpio -pd ../patch/
class ActionController::TestCase
def process_with_auto_validate(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
response = process_without_auto_validate(action,parameters,session,flash,http_method)
assert_xhtml_strict response.body unless response.redirect? or @request.xhr? or @response.content_type != 'text/html'
response
end
alias_method_chain :process, :auto_validate
end
/Users/artifact/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
ruby-1.9.2-rc2 > require 'sender'
LoadError: dlopen(/Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender/sender.bundle, 9): Library not loaded: /usr/local/lib/libruby.1.9.1.dylib
Referenced from: /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender/sender.bundle
Reason: image not found - /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender/sender.bundle
from /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender.rb:1:in `require'
from /Users/artifact/.rvm/gems/ruby-1.9.2-rc2/gems/sender-1.5.3/lib/sender.rb:1:in `<top (required)>'
from (irb):1:in `require'
from (irb):1
from /Users/artifact/.rvm/rubies/ruby-1.9.2-rc2/bin/irb:17:in `<main>'
# Add rails logging to script/console like in script/server
# to disable it for one run do this command:
#
# RAILS_CONSOLE_LOGGING=off script/console
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') && !%w{false off}.include?(ENV['RAILS_CONSOLE_LOGGING'])
require 'logger'
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
end
@JonnieCache
JonnieCache / gist:1352364
Created November 9, 2011 18:26
erb html list
<ul>
<% @foo.each do |bar| %>
<li class="lol">
STUFF: <%= bar[:stuff] %>
OTHER STUFF: <%= bar[:other_stuff] %>
</li>
<% end %>
</ul>
class ArtistSearchController < ApplicationController
def search
@title = "Search"
end
def artist
@title = "Similar artists"
logger.debug "#{params[:artist].class}"
unless params.nil?
music_request = MusicRequest.new #snake_case, not camelCase
array = [1, 2]
array.each_with_index do |item, index|
puts "LAST!" if item == array.last
end
@JonnieCache
JonnieCache / gist:1589747
Created January 10, 2012 15:58
spree_master bundle error
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails (~> 3.1.1) ruby depends on
railties (~> 3.1.0) ruby
spree (>= 0) ruby depends on
railties (3.2.0.rc2)