
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
# Rack env specification: | |
# http://rack.rubyforge.org/doc/SPEC.html | |
# https://github.com/rack/rack/blob/master/SPEC | |
# How to get fake env hash: | |
# http://rack.rubyforge.org/doc/Rack/MockRequest.html#env_for-method | |
env = Rack::MockRequest.env_for('/test') | |
# Devise with Warden |
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
var h=document.getElementsByClassName('post_like_icon'),u=[],i;for(i=0;i<h.length;i++){if(!h[i].className.match('my_like'))u.push(h[i])};console.log('unliked amount '+u.length);i=-1;function l(){i++;if(i<u.length){u[i].click();console.log('liked'+u[i]);setTimeout(l,1000)}};l() |
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
<script type='text/javascript'> | |
$(function() { $('head base').attr('href', window.location.href) }); | |
</script> |
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
# Есть такая функция: | |
def code_unique? klass, msg_assignment_proc=Proc.new | |
if @@error_classes.empty? | |
true | |
else | |
if @@error_classes.map(&:new).map(&:code).include?(klass.new.code) | |
msg_assignment_proc.call "Error code value repeating: #{klass.new.code}" | |
false | |
else | |
true |
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
class A | |
attr_accessor :b | |
end | |
class B | |
attr_accessor :val | |
end | |
a = A.new | |
b = B.new |