This file contains hidden or 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
<%# @post.content = '<script>javascript:alert("Injection huhui")</script>' %> | |
<div> | |
<%= @post.content %> | |
</div> | |
<%# Would render to: %> | |
<div> | |
<script>javascript:alert("Injection huhui")</script> | |
</div> |
This file contains hidden or 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
# every thing is an object: | |
20.methods | |
#=> [:to_s, :inspect, :-@, :+, :-, :*, :/, :div, :%, :modulo, :divmod, :fdiv, :**, :abs, :magnitude, :==, :===, :<=>, :>, :>=, :<, :<=, :~, :&, :|, :^, :[], :<<, :>>, :to_f, :size, :bit_length, :zero?, :odd?, :even?, :succ, :integer?, :upto, :downto, :times, :next, :pred, :chr, :ord, :to_i, :to_int, :floor, :ceil, :truncate, :round, :gcd, :lcm, :gcdlcm, :numerator, :denominator, :to_r, :rationalize, :singleton_method_added, :coerce, :i, :+@, :eql?, :remainder, :real?, :nonzero?, :step, :quo, :to_c, :real, :imaginary, :imag, :abs2, :arg, :angle, :phase, :rectangular, :rect, :polar, :conjugate, :conj, :between?, :psych_to_yaml, :to_yaml, :to_yaml_properties, :find_method, :_ori_method, :ri, :system, :spawn, :howtocall, :vi, :vim, :emacs, :nano, :mate, :mvim, :ed, :methods_for, :method_lookup_path, :only_class_ancestors, :mlp, :nil?, :=~, :!~, :hash, :class, :singleton_class, :clone, :dup, :itself, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen |
This file contains hidden or 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 RoutesHelpers | |
# Checks if the call is not a migration task or an other rake task that would fail when trying to | |
# access some database tables. | |
# | |
# This can be used in the routes.rb file | |
# | |
# require 'routes_helpers' | |
# include RoutesHelpers | |
# Rails.application.routes.draw do |
This file contains hidden or 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
body { | |
background-color: #efefef; | |
padding: 0px; | |
margin: 0px; | |
} | |
div.image-files > ul > li.media-item { | |
height: 100px; | |
width: 100px; | |
border: 3px solid #cfcfcf; |
This file contains hidden or 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
#some hacks to get postgis adapter to work with schema_type sql | |
require 'rgeo/active_record/task_hacker' | |
::RGeo::ActiveRecord::TaskHacker.modify('db:structure:dump', nil, 'postgis') do |config_| | |
set_psql_env(config_) | |
filename_ = ::File.join(::Rails.root, "db/#{::Rails.env}_structure.sql") | |
search_path_ = config_["schema_search_path"].to_s.strip | |
search_path_ = search_path_.split(",").map{ |sp_| sp_.strip } | |
search_path_.delete('postgis') |
This file contains hidden or 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
[Test()] | |
public void LoadChallengesByFilter () | |
{ | |
ManualResetEvent syncEvent = new ManualResetEvent(false); | |
string[] filter = {"fun"}; | |
RequestResult<IEnumerable<Challenge>> result = null; | |
testee.GetChallengesByFilterAsync((_result) => { | |
result = _result; |