Skip to content

Instantly share code, notes, and snippets.

View iHiD's full-sized avatar
💙

Jeremy Walker iHiD

💙
View GitHub Profile
@iHiD
iHiD / speaker.md
Created June 12, 2012 15:41 — forked from matiaskorhonen/speaker.md
Frozen Rails Talk Proposal Template (http://2012.frozenrails.eu/)
@iHiD
iHiD / gemfile_parser.rb
Created June 18, 2012 10:42 — forked from reiz/gemfile parser
Parsing a Gemfile
def self.create_from_gemfile_url ( url )
return nil if url.nil?
if url.match(/^https:\/\/github.com\//)
url = url.gsub("https://github.com", "https://raw.github.com")
url = url.gsub("/blob/", "/")
end
uri = URI.parse( url )
http = Net::HTTP.new(uri.host, uri.port)
if uri.port == 443
http.use_ssl = true
@iHiD
iHiD / malicious.html
Created June 25, 2012 14:21
Security Article Part 3 - 1
<script>
setInterval(function() {
alert("I'm annoying!!!")
}, 50)
</script>
@iHiD
iHiD / show.html.erb
Created June 25, 2012 14:23
Security Article Part 3 - 2
<h2><%= @blog_post.title %></h2>
<div id="content"><%= @blog_post.content %></div>
@iHiD
iHiD / show_output.html
Created June 25, 2012 14:25
Security Article Part 3 - 3
<h2>My First Blog Post</h2>
<div id="content">
<script>
setInterval(function() {
alert("I'm annoying!!!")
}, 50)
</script>
</div>
@iHiD
iHiD / show_output_xss.html
Created June 25, 2012 14:32
Security Article Part 3 - 4
<h2>My First Blog Post</h2>
&lt;div id="content"&gt;
<script>
setInterval(function() {
alert("I'm annoying!!!")
}, 50)
&lt;/script&gt;
</div>
@iHiD
iHiD / show.html.erb
Created June 25, 2012 14:40
Security Article Part 3 - 5
<h2><%= @blog_post.title %></h2>
<div id="content"><%= raw @blog_post.content %></div>
@iHiD
iHiD / show.html.haml
Created June 25, 2012 19:12
Security Article Part 3 - 6
%h2= @user.name
=render "users/information"
=render "users/media_files"
=render "users/wall"
@iHiD
iHiD / _information.html.haml
Created June 25, 2012 19:12
Security Article Part 3 - 7
.bio= @user.bio
.university
.field University
.value= @user.university
.university_year
.field Year
.value= @user.university_year
@iHiD
iHiD / show.html.haml
Created June 25, 2012 19:13
Security Article Part 3 - 8
=cache "user_#{@user.id}_#{@user.updated_at}_#{@user.media_files_updated_at}_#{@user.wall_updated_at}" do
%h2= @user.name
=cache "user_#{@user.id}_information_#{@user.updated_at}" do
=render "users/information"
=cache "user_#{@user.id}_media_files_#{@user.media_files_updated_at}" do
=render "users/media_files"
=cache "user_#{@user.id}_wall_#{@user.wall_updated_at}" do