Skip to content

Instantly share code, notes, and snippets.

@avit
avit / about:config.md
Created Jan 13, 2018 — forked from haasn/about:config.md
Firefox bullshit removal via about:config
View about:config.md

Firefox bullshit removal

Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.

NOTE: Unfortunately this is somewhat out of date. The comments link to some resources that may be more up-to-date. Patches welcome.

WebSockets

These can be used for nefarious purposes and to bypass access restrictions.

@avit
avit / gist:1855725
Created Feb 17, 2012 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
View gist:1855725
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1855725)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
View gist:1257160
def helper(&block)
content_tag(:div, &block)
end
# or ...
def helper(&block)
%(<div>
#{yield}
</div>}
View have_option_matchers.rb
# usage:
# field_labeled('Select your address').should have_option("Home Address")
Spec::Matchers.define :have_option do |expected|
def options_for(select_field)
select_field.options.map(&:inner_text)
end
match do |select_field|
raise "Field is not a SelectField" unless select_field.kind_of?(Webrat::SelectField)
options_for(select_field).include?(expected)
View _font-stack.sass
//
// From http://www.awayback.com/revised-font-stack/
//
// Each stack has the survey statistics and any additional notes in '[]'.
// Stacks are ordered in Window > cross-platform > Mac
//
// Serif Font Stacks
// Cambria (54.51% on Windows)
View stylesheets_test.rb
require File.dirname(__FILE__) + '/../test_helper'
require 'compass/test_case'
class StylesheetsTest < Compass::TestCase
class << self
def sass_files(path)
Dir.glob(File.join(path, "**", "[^_]*.sass"))
end
def test_stylesheet(sass_file, &block)
View compass_initializer.rb
# Set up rendering of sass through ERB in ActionView
require 'ersass_template_handler'
ActionView::Template.register_template_handler :sass, ActionView::TemplateHandlers::ErSass
ActionView::Template.exempt_from_layout :sass