d3.unconf example gist. Fork it here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// non-id/name attributes are interpreted as cdata | |
// per: http://www.w3.org/TR/html4/types.html#type-cdata | |
var s = "<p title=\"<script>alert('TEST')</script>\">testing 123</p>"; | |
document.body.innerHTML = s; | |
document.getElementsByTagName('p')[0].getAttribute('title'); | |
// => "<script>alert('TEST')</script>" | |
document.getElementsByTagName('p')[0].title; | |
// => "<script>alert('TEST')</script>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set(reg: Reg, literal: byte): Code = { | |
return new Code() { | |
// implementation | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define_builder(Country) do |klass, overrides| | |
# set up some presets | |
canada = { :iso => 'CA', :name => 'CANADA', :printable_name => 'Canada', :iso3 => 'CAN', :numcode => '124'} | |
usa = { :iso => 'US', :name => 'UNITED STATES', :printable_name => 'United States', :iso3 => 'USA', :numcode => '840' } | |
uk = { :iso => 'GB', :name => 'UNITED KINGDOM', :printable_name => 'United Kingdom', :iso3 => 'GBR', :numcode => '826' } | |
zimbabwe = { :iso => 'ZW', :name => 'ZIMBABWE', :printable_name => 'Zimbabwe', :iso3 => 'ZWE', :numcode => '716' } | |
# set up the default | |
country_attributes = canada | |
# check for a preset | |
overrides.process(:preset) do |preset| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Exceptions < Application | |
# handle RecordInvalid exceptions (406) | |
def record_invalid | |
@errors = request.exceptions.first.errors | |
rename_error_fields! | |
if content_type == :html | |
render {:template => "#{request.controller}/#{request.params[:action]}"} | |
else | |
render |