- http://Don't send me recruiter spam, fuckface
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
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<script type="text/javascript"> | |
var foo = 'asdfkajhsdf as</script><script>alert("xss1")</script>'; | |
var bar = "asdfasdf </script><script>alert('xss2')</script>"; | |
</script> | |
</body> | |
</html> |
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
module Fixtures | |
# | |
# Set up fixtures that will be defined once during startup | |
# and (perhaps) rolled back at the beginning of each test run | |
# | |
def fixtures &block | |
if block_given? | |
instance_eval &block | |
@fixtures = {} | |
(instance_variables - [:@fixtures]).each do |fresh| |
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
# html | |
<div class="user"> | |
<img src="/avatar.gif" /> | |
<h4>Jimbo Jones</h4> | |
</div> | |
# css | |
div.user { |
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
# output | |
> gh = Redcarpet::Render::GithubStyleTitles.new | |
> puts Redcarpet::Markdown.new(gh).render "test\n\n# test 1\n\n# test 2\n\n# test 1\n\n# test 1" | |
=> | |
<a name="test-1" class="anchor" href="#test-1"><span class="anchor-icon"></span></a><h1 id="test-1">test 1</h1> | |
<a name="test-2" class="anchor" href="#test-2"><span class="anchor-icon"></span></a><h1 id="test-2">test 2</h1> |
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
# RAILS 2.3.15 | |
# | |
# Since <tag type="yaml"> was removed from rails' xml parsing, | |
# but not from its to_xml method, rails can't talk to an API | |
# generated by rails, if you have serialized attributes. | |
# This can be put in config/initializers and you should probably | |
# upgrade to rails 3 already. Ugh. | |
# Three parts: |
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 hipchat_hook(data, payload, log) | |
notify_hipchat data, | |
"[Tender] \"#{payload['discussion']['title']}\" has been #{payload['number'] > 1 ? 'updated' : 'opened'} by #{payload['author_name']}", | |
payload['discussion']['html_href'] | |
end |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Test JSONP search api</title> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
</head> |
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
source :gemcutter | |
gem 'CFPropertyList' | |
gem 'eventmachine' | |
gem 'uuidtools' | |
gem 'libxml-ruby' | |
# load plugins | |
require 'yaml' |
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
# sample stats recording code | |
base = "w:#{site_id}:#{word}" | |
# hits per year | |
REDIS.incr "#{base}:#{created_at.year}" | |
# hits per month | |
REDIS.incr "#{base}:#{created_at.month}-#{created_at.year}" |
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
require 'stringio' | |
class TestLeak | |
def self.call(env) | |
str = env["rack.input"].read | |
puts env.inspect | |
puts str | |
env["rack.input"] = nil |