apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
ta_ has quit [Ping timeout: 244 seconds]
stardiviner has joined #ruby-lang
SilentNuke has joined #ruby-lang
Lewix has joined #ruby-lang
Lewix has joined #ruby-lang
simi has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby-lang
Doomsdaypoptart_ has joined #ruby-lang
Doomsdaypoptart_ has quit [Client Quit]
kapil__ has joined #ruby-lang
chouhoulis has quit [Ping timeout: 256 seconds]
mistym has quit [Remote host closed the connection]
yusuf1 has quit [Quit: Leaving.]
yusuf1 has joined #ruby-lang
rbowlby_ has joined #ruby-lang
mistym has joined #ruby-lang
rbowlby has quit [Ping timeout: 265 seconds]
kiyote23 has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
rbowlby has joined #ruby-lang
jdecuirm has quit [Read error: Connection reset by peer]
rbowlby_ has quit [Ping timeout: 255 seconds]
kiyote23 has quit [Remote host closed the connection]
ta_ has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
chouhoulis has joined #ruby-lang
rbowlby_ has joined #ruby-lang
rbowlby has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
slawrence00 has joined #ruby-lang
chouhoul_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
ta_ has joined #ruby-lang
chouhoul_ has quit [Remote host closed the connection]
chouhoul_ has joined #ruby-lang
hendranata_ has quit [Ping timeout: 240 seconds]
cornerma1 has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
cornerman has quit [Ping timeout: 245 seconds]
cornerma1 is now known as cornerman
Menorah has quit [Quit: This computer has gone to sleep]
emmesswhy has joined #ruby-lang
James has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
James is now known as Guest11889
Sadin has quit [Remote host closed the connection]
sleepee has joined #ruby-lang
hendranata_ has joined #ruby-lang
Sadin has joined #ruby-lang
stardiviner has quit [Ping timeout: 265 seconds]
kyb3r_ has joined #ruby-lang
symm- has joined #ruby-lang
kiyote23 has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
|jemc| has joined #ruby-lang
kiyote23 has quit [Ping timeout: 255 seconds]
stardiviner has joined #ruby-lang
SilentNuke has quit []
buke has joined #ruby-lang
buke has quit [Client Quit]
buke has joined #ruby-lang
ruby-lang607 has joined #ruby-lang
Guest11889 has quit [Quit: Quitting forever wow]
ruby-lang607 has quit [Ping timeout: 246 seconds]
red_menace has quit [Quit: Quit]
buke has quit []
Sadin has quit [Ping timeout: 244 seconds]
mistym has joined #ruby-lang
Iskarlar has joined #ruby-lang
rbowlby_ has quit [Remote host closed the connection]
matsutomo has joined #ruby-lang
sleepee has quit [Ping timeout: 250 seconds]
ta_ has joined #ruby-lang
Creeves has joined #ruby-lang
<Creeves>
!seen zenChild
<Creeves>
aw
havenwood has quit [Ping timeout: 250 seconds]
buke has joined #ruby-lang
Sadin has joined #ruby-lang
<buke>
is this the place for a newbie to troubleshoot ruby code?
zz_dlu has quit [Ping timeout: 245 seconds]
GaelanAintAround has quit [Ping timeout: 255 seconds]
<godd2>
Buke we do our best to help out. What's your question?
ddd has quit [Quit: leaving]
ddd has joined #ruby-lang
banister has joined #ruby-lang
ta_ has quit [Ping timeout: 244 seconds]
<buke>
I'm goofing around with writing a script to encrypt files using the rbnacl gem. I require the gem in my 'encrypt.rb' file and when I run it I a get a whole slew of errors.
oleo has quit [Quit: Verlassend]
<womble>
Buke: Your code, and the errors, in a gist, would be helpful.
GaelanAintAround has quit [Ping timeout: 265 seconds]
postmodern has quit [Quit: Leaving]
ta_ has joined #ruby-lang
kiyote23 has quit [Ping timeout: 245 seconds]
GaelanAintAround has joined #ruby-lang
symm- has quit [Ping timeout: 240 seconds]
<weaksauce>
Buke you've commented out pretty much everything interesting in the code
zz_dlu has joined #ruby-lang
ta_ has quit [Ping timeout: 250 seconds]
GaelanAintAround has quit [Ping timeout: 256 seconds]
<buke>
Before actually writing any code I want to make sure that I can actually get rbnacl to work. As it just requiring the gem results in those errors. Does anyone have any idea of what's wrong? I've been through a bunch of different attempts to fix it but I'm brand new at this so maybe it's something simple...
dik_dak has quit [Ping timeout: 240 seconds]
zz_dlu has quit [Ping timeout: 264 seconds]
zz_dlu has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
chouhoulis has joined #ruby-lang
chouhoul_ has quit [Ping timeout: 245 seconds]
revathskumar has joined #ruby-lang
GaelanAintAround has quit [Read error: Connection reset by peer]
zz_dlu has quit [Ping timeout: 245 seconds]
ta_ has joined #ruby-lang
matlads has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
<matlads>
Hello. I have got an interactive makefile thats asks me to press enter when I run 'make'. I want to pipe /bin/true to this in my ruby file. Question is: how do I do this?
stardiviner has joined #ruby-lang
loincloth has joined #ruby-lang
loincloth has quit [Ping timeout: 240 seconds]
fclausen has quit [Ping timeout: 272 seconds]
ta_ has quit [Ping timeout: 265 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
mostlybadfly has quit [Quit: Connection closed for inactivity]
nosignsoflife has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
|jemc| has quit [Ping timeout: 255 seconds]
Bwild has quit [Ping timeout: 245 seconds]
zz_dlu has quit [Ping timeout: 250 seconds]
matlads has left #ruby-lang [#ruby-lang]
GaelanAintAround has quit [Ping timeout: 240 seconds]
buke has left #ruby-lang [#ruby-lang]
zz_dlu has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
|jemc| has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
apeiros__ has joined #ruby-lang
ur5us has joined #ruby-lang
dellavg_ has joined #ruby-lang
apeiros_ has quit [Read error: Connection reset by peer]
apeiros__ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
ta_ has joined #ruby-lang
zz_dlu has quit [Ping timeout: 245 seconds]
GaelanAintAround has quit [Ping timeout: 264 seconds]
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[spoiler] has joined #ruby-lang
apeiros_ has quit [Ping timeout: 244 seconds]
ta_ has quit [Ping timeout: 265 seconds]
ta_ has joined #ruby-lang
charliesome has quit [Quit: zzz]
slawrence00 has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
nosignsoflife has quit []
gjaldon has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
amclain has quit [Quit: Leaving]
zz_dlu has quit [Ping timeout: 240 seconds]
GaelanAintAround has quit [Ping timeout: 244 seconds]
SuMo_D has quit [Remote host closed the connection]
|jemc| has quit [Ping timeout: 244 seconds]
solars has joined #ruby-lang
matsutomo has quit [Quit: matsutomo]
loincloth has joined #ruby-lang
matsutomo has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
yusuf has joined #ruby-lang
loincloth has quit [Ping timeout: 245 seconds]
yusuf1 has quit [Ping timeout: 240 seconds]
hendranata_ has quit [Ping timeout: 245 seconds]
intersect has quit [Ping timeout: 245 seconds]
hendranata_ has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
rbowlby has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 245 seconds]
zz_dlu has quit [Ping timeout: 264 seconds]
rbowlby has quit [Ping timeout: 250 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
ta_ has joined #ruby-lang
rbowlby has joined #ruby-lang
zz_dlu has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zz_dlu has quit [Ping timeout: 250 seconds]
fedexo_ has quit [Ping timeout: 245 seconds]
fedexo has quit [Ping timeout: 250 seconds]
charliesome has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
ur5us has joined #ruby-lang
mistym has quit [Remote host closed the connection]
ta_ has quit [Ping timeout: 245 seconds]
gjaldon has quit [Remote host closed the connection]
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 250 seconds]
zz_dlu has quit [Ping timeout: 256 seconds]
havenwood has joined #ruby-lang
ta_ has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
dluv has joined #ruby-lang
nofxx has quit [Ping timeout: 255 seconds]
fclausen has joined #ruby-lang
dluv has quit [Ping timeout: 256 seconds]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
GaelanAintAround has quit [Ping timeout: 240 seconds]
fclausen has quit [Ping timeout: 272 seconds]
GaelanAintAround has joined #ruby-lang
ta_ has quit [Ping timeout: 244 seconds]
zz_dlu has joined #ruby-lang
stardiviner has quit [Ping timeout: 240 seconds]
SuMo_D has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 244 seconds]
zz_dlu has quit [Ping timeout: 245 seconds]
tkuchiki has quit [Remote host closed the connection]
tvl has joined #ruby-lang
tkuchiki has joined #ruby-lang
SuMo_D has quit [Quit: Off into this... Real world place...]
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
Creeves has joined #ruby-lang
stardiviner has joined #ruby-lang
zz_dlu has quit [Ping timeout: 244 seconds]
tvl is now known as tobiasvl
<[spoiler]>
morning
GaelanAintAround has quit [Ping timeout: 265 seconds]
<tobiasvl>
top o'the mornin' to you [spoiler]
<[spoiler]>
:D
zz_dlu has joined #ruby-lang
<darix>
when [spoiler] is done with his work he will write the documentation for mruby ;)
<[spoiler]>
darix, I actually thought about that
<[spoiler]>
w/ examples!
ta_ has joined #ruby-lang
micmus has joined #ruby-lang
<[spoiler]>
darix, it's not *much* different from MRI's C API
apeiros_ has joined #ruby-lang
Gaelane has joined #ruby-lang
zz_dlu has quit [Ping timeout: 256 seconds]
zz_dlu has joined #ruby-lang
mattyohe has quit [Quit: Connection closed for inactivity]
intersect has joined #ruby-lang
Gaelane has quit [Read error: Connection reset by peer]
zz_dlu has quit [Read error: Connection reset by peer]
ta_ has quit [Ping timeout: 265 seconds]
charliesome has quit [Quit: zzz]
charliesome has joined #ruby-lang
ironhide_604 has joined #ruby-lang
ta_ has joined #ruby-lang
tobiasvl has quit [Quit: brb]
charliesome has quit [Ping timeout: 244 seconds]
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
ta_ has quit [Ping timeout: 245 seconds]
arBmind1 has quit [Quit: Leaving.]
matsutomo has quit [Quit: matsutomo]
gjaldon has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 245 seconds]
zz_dlu has quit [Ping timeout: 240 seconds]
musl has quit [Quit: WeeChat 1.0.1]
matsutomo has joined #ruby-lang
simi has joined #ruby-lang
GBrawl has joined #ruby-lang
Iskarlar has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
dluv has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 240 seconds]
zz_dlu has quit [Ping timeout: 244 seconds]
dluv has quit [Ping timeout: 250 seconds]
gjaldon has quit [Remote host closed the connection]
zz_dlu has joined #ruby-lang
Gaelane has joined #ruby-lang
gjaldon has joined #ruby-lang
jxie has joined #ruby-lang
stardiviner has quit [Ping timeout: 240 seconds]
rbrs has joined #ruby-lang
tvl has joined #ruby-lang
Gaelane has quit [Ping timeout: 245 seconds]
tvl is now known as tobiasvl
zz_dlu has quit [Ping timeout: 256 seconds]
Sadin has quit [Remote host closed the connection]
jxie has quit [Ping timeout: 244 seconds]
donove has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
skade has joined #ruby-lang
jxie has joined #ruby-lang
zz_dlu has joined #ruby-lang
vieq has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby-lang
jxie has quit [Ping timeout: 265 seconds]
ta_ has joined #ruby-lang
zz_dlu has quit [Ping timeout: 240 seconds]
GaelanAintAround has quit [Ping timeout: 265 seconds]
stardiviner has joined #ruby-lang
ta_ has quit [Ping timeout: 244 seconds]
marr has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
GaelanAintAround has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
zz_dlu has joined #ruby-lang
vieq has joined #ruby-lang
arBmind has joined #ruby-lang
<ljarvis>
moin
<ljarvis>
fuck i hate makefiles
micmus has quit [Ping timeout: 245 seconds]
jxie has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 240 seconds]
benlovell has joined #ruby-lang
zz_dlu has quit [Ping timeout: 240 seconds]
micmus has joined #ruby-lang
<yorickpeterse>
morning
stardiviner has quit [Ping timeout: 250 seconds]
gjaldon has joined #ruby-lang
ta_ has joined #ruby-lang
emmesswhy has quit [Quit: This computer has gone to sleep]
jxie has quit [Ping timeout: 264 seconds]
hendranata_ has quit [Ping timeout: 265 seconds]
jxie has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
rbowlby has quit [Remote host closed the connection]
hahuang61 has quit [Ping timeout: 265 seconds]
vieq has quit [Ping timeout: 255 seconds]
tkuchiki has quit [Ping timeout: 240 seconds]
zz_dlu has joined #ruby-lang
vieq has joined #ruby-lang
zz_dlu has quit [Ping timeout: 255 seconds]
GaelanAintAround has joined #ruby-lang
zz_dlu has joined #ruby-lang
tkuchiki has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
zz_dlu has quit [Ping timeout: 255 seconds]
fusillicode has joined #ruby-lang
GaelanAintAround has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby-lang
fusillicode has quit [Client Quit]
ledestin has joined #ruby-lang
Creeves has quit [Ping timeout: 244 seconds]
zz_dlu has joined #ruby-lang
fusillicode1 has quit [Ping timeout: 245 seconds]
GaelanAintAround has joined #ruby-lang
mikecmpbll has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
fusillicode has joined #ruby-lang
bodgix_wrk has joined #ruby-lang
fusillicode has quit [Read error: Connection reset by peer]
fusillicode has joined #ruby-lang
stardiviner has joined #ruby-lang
banister has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
<[spoiler]>
ljarvis, lol, I know how you feel
kapil__ has quit [Quit: Connection closed for inactivity]
benlovell has joined #ruby-lang
stardiviner has quit [Ping timeout: 265 seconds]
fusillicode has quit [Read error: Connection reset by peer]
Creeves has joined #ruby-lang
fusillicode has joined #ruby-lang
fusillicode1 has joined #ruby-lang
ta_ has joined #ruby-lang
jxie has quit [Ping timeout: 256 seconds]
dabradley has quit [Ping timeout: 250 seconds]
fusillicode has quit [Ping timeout: 244 seconds]
rbowlby has joined #ruby-lang
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ta_ has quit [Ping timeout: 265 seconds]
dagda1 has joined #ruby-lang
tkuchiki_ has joined #ruby-lang
stardiviner has joined #ruby-lang
rbowlby has quit [Ping timeout: 250 seconds]
matsutomo has quit [Quit: matsutomo]
dabradley has joined #ruby-lang
tkuchiki has quit [Ping timeout: 244 seconds]
tobiassvn has quit [Ping timeout: 276 seconds]
tkuchiki_ has quit [Ping timeout: 245 seconds]
enkristoffer has quit [Quit: ❤]
ta_ has joined #ruby-lang
enkristoffer has joined #ruby-lang
stamina has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Remote host closed the connection]
evil1337 has joined #ruby-lang
tcopeland has quit [Quit: Leaving.]
<evil1337>
hello
<evil1337>
how to c
<evil1337>
create lists in ruby
<tobiasvl>
evil1337: arrays?
<zenspider>
evil1337: what have you tried? what have you read so far?
<evil1337>
im going to implement CPM algorithm
<evil1337>
i already have a code in C#
<zenspider>
not what I asked. not what tobiasvl asked.
<tobiasvl>
ok, it was the first hit on google for "ruby array"
stardiviner has quit [Ping timeout: 265 seconds]
arBmind has quit [*.net *.split]
dhruvasagar has quit [*.net *.split]
zemlya has quit [*.net *.split]
LBo has quit [*.net *.split]
aef has quit [*.net *.split]
levifig has quit [*.net *.split]
sk_0_ has quit [*.net *.split]
sideshowcoder has quit [*.net *.split]
ryotarai has quit [*.net *.split]
faces has quit [*.net *.split]
clamstar has quit [*.net *.split]
Gate_ has quit [*.net *.split]
dhruvasagar_ has joined #ruby-lang
<tobiasvl>
since they're called arrays in C# too (not "lists") I think you'll feel at home although some of the syntax is different
Gate has joined #ruby-lang
Gate has joined #ruby-lang
<evil1337>
and detect method will be the best way to find word in an array of objects ?
zemlya has joined #ruby-lang
<zenspider>
I highly recommend getting a basic book on ruby and going through it first
arBmind has joined #ruby-lang
face has joined #ruby-lang
Rylee has quit [Excess Flood]
sk_0 has joined #ruby-lang
aef has joined #ruby-lang
Rylee has joined #ruby-lang
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mostlybadfly has joined #ruby-lang
Iskarlar has joined #ruby-lang
loincloth has quit [Ping timeout: 244 seconds]
ryotarai has joined #ruby-lang
Iskarlar has quit [Client Quit]
yusuf has quit [Quit: Leaving.]
levifig has joined #ruby-lang
ta_ has joined #ruby-lang
fclausen has joined #ruby-lang
clamstar has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
Iskarlar has joined #ruby-lang
rahul_j has joined #ruby-lang
stardiviner has joined #ruby-lang
simi has quit [Ping timeout: 250 seconds]
<evil1337>
if (!list.Exists(x => x.id == id)) how to rewrite it in ruby
<evil1337>
if !list.detect { |i| list[i].id == id }
<evil1337>
?
<zenspider>
evil1337: unless you're paying someone, asking us to translate your code one line at a time is rather unrewarding and quite frankly, rude.
<ljarvis>
evil1337: please spend some time learning Ruby before trying to simply port code, it's going to be terrible and nobody is going to do it all for you for nothing
<zenspider>
YOU are supposed to be learning here, not just asking for free consultation
<evil1337>
yeh ,and i do it ,i just want to know if im in good way to understand ruby
<tobiasvl>
evil1337: and the answer to your question is "no", that code won't work. you shouldn't use i as an index, just as you don't use it as an index in the C# code
Forgetful_Lion has quit [Read error: No route to host]
<zenspider>
evil1337: to be "in good way", please start by reading a book or some complete tutorial
FastJack has quit [Ping timeout: 250 seconds]
<zenspider>
come back once you have a grasp on the basic language + datatypes + enumerable. we're happy to answer questions about those as you go through the book.
<zenspider>
otherwise, I'm sure any of us (incl me) are willing to take a subcontract on whatever you're working on and just port the code ourselves.
<ljarvis>
im good to auction
<zenspider>
is it an auction if the prices go _down_?
shazaum has joined #ruby-lang
<bnagy>
can I bid with the understanding that my code may have deliberate bugs?
chills42 has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
<ljarvis>
hmm good point
<zenspider>
bnagy: now that's not nice :P
<ljarvis>
but lets not be hasty, we haven't seen the code, maybe the prices will go up
<bnagy>
well you know.. prices may go negative
mietkacy has joined #ruby-lang
<bnagy>
pretty sure there are some conditions where I'd accept negative money to have someone run my code
chills42_ has joined #ruby-lang
<ljarvis>
we're using unsigned ints only
<bnagy>
itym floats surely
ta_ has joined #ruby-lang
<bnagy>
ints are no good for moneys
<ljarvis>
if you use float for money, you already have bug
<ljarvis>
not sure why I said that like I was Russian
chills42 has quit [Read error: Connection reset by peer]
<[spoiler]>
lol
stardiviner has quit [Ping timeout: 250 seconds]
<[spoiler]>
ljarvis, I can't stop giggling at that; colleagues are staring at me
<bnagy>
in soviet Russia bug have you
<mietkacy>
Hi everyone! I'm about to write a regex, to check whether some suspicious pattern appear in URL. I've got a list of this patterns here https://github.com/nbs-system/naxsi/blob/master/naxsi_config/naxsi_core.rules . I would like to combine them into several objects, like direcotry_traversal_regex, xss_regex and so on, so that later on i can just check if xss_regex.match(url). How to create such regex object in elegant way? becaus
FastJack has joined #ruby-lang
<mietkacy>
... because for each group i can still write a long regexp, but i am not sure that its the best way to do it - or maybe im wrong?
tobiassvn has joined #ruby-lang
<bnagy>
you're wrong
<bnagy>
I didn't read the whole thing, tbh
<bnagy>
but you said regex and URL
fclausen has quit [Ping timeout: 272 seconds]
<mietkacy>
yes
<mietkacy>
so really doing one regex with many Ors like /<|>|~|`/.match() is okay ?
<mietkacy>
*ORs
<canton7>
do them separately, m'kay? then you can log which one failed ;)
<mietkacy>
what do you mean by 'separately' ?
stamina has quit [Quit: WeeChat 1.0.1]
ta_ has quit [Ping timeout: 265 seconds]
<bnagy>
well my point is that you're unlikely to win this way
<bnagy>
countless WAFs have tried and failed
<bnagy>
it's not really tractable for regex, cause it's all irregular
<mietkacy>
I am not going to write a WAF hopefully :)
<bnagy>
or hey I could just say Regexp.union and you'd be happy
<[spoiler]>
mietkacy, generally, you're better of whitelisting than balcklisting, though
<[spoiler]>
blacklisting*
loincloth has quit [Ping timeout: 265 seconds]
<[spoiler]>
There's an infinite amount of blacklistable things, and a finite amount of whitelistable ones
mikecmpbll has quit [Ping timeout: 245 seconds]
<mietkacy>
well, it's only my client requirement, to do some analysis
<mietkacy>
there are some urls related strictly to business logic of my app
<mietkacy>
which they would like to search for
intersect has quit [Ping timeout: 244 seconds]
ta_ has joined #ruby-lang
<mietkacy>
i've treated this NAXSI as an example, because its really close to sty i would like to write
zz_dlu has quit [Ping timeout: 256 seconds]
<[spoiler]>
Well, you could do what DefV said and adapt it to your needs
<mietkacy>
definitely, I'm giving it a try now
<mietkacy>
DefV -> thanks a lot!
rbrs has quit [Quit: rbrs]
GaelanAintAround has quit [Ping timeout: 245 seconds]
<[spoiler]>
Also, the rule can be either a string search or a regexp pattern, from taking a glance at that rule list
<[spoiler]>
make sure you use string search instead of compiling a regexp
<[spoiler]>
when there's a string
<mietkacy>
in my case that would be regexps only :)
<mietkacy>
and totally weird ones
<[spoiler]>
if you compile a string like "[idk something]" it won't behave as you'd expect it
ledestin has quit [Quit: ledestin]
GaelanAintAround has joined #ruby-lang
<mietkacy>
so in case of strings matching them with =`
intersect has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
zz_dlu has joined #ruby-lang
<mietkacy>
*with =~ will be faster than calling a regexp?
<mietkacy>
i thought it calls regexp somehow deep inside
<[spoiler]>
You can use String#[] to cover for all cases
<[spoiler]>
There's probably very little overhead
<mietkacy>
will string_of_my.include? ">" or string_of_my.include=~ ">" be faster than />/.match(string_of_my) ?
stardiviner has joined #ruby-lang
<[spoiler]>
test it. :-)
<evil1337>
is there any replacement to c#'s foreach loop ?
<[spoiler]>
evil1337, #each
<evil1337>
k thx
<mietkacy>
what do you mean by "String#[]" ? please excuse my lack lack of knowledge in ruby
<[spoiler]>
like blah.each {|i| ... }
Forgetful_Lion has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
<[spoiler]>
mietkacy, you could do horribly_evil_url['>']
<[spoiler]>
it will return '>' if it found the string, or nil (like null) otherwise
<ljarvis>
mietkacy: if you want to know, benchmark it
<ljarvis>
but im betting you shouldn't care
Miphix has joined #ruby-lang
<mietkacy>
aah okay, I got it
Iskarlar_ has joined #ruby-lang
<[spoiler]>
secondly, you can use horribly_evil_url[/[abc]+/]
<maloik>
look up benchmark-oips
<maloik>
ips*
<[spoiler]>
it will return the portion of the string that matched the regexp, or nil
<mietkacy>
theres so much tricks in this ruby syntax
<[spoiler]>
they're not tricks
<maloik>
fantastic little gem that I use from time to time to quickly test things like that
<[spoiler]>
String#[] is just a method
<yorickpeterse>
String#include? is actually much better for this
<yorickpeterse>
String#[] will do a copy of the String matched
<yorickpeterse>
So for every String#[] call you're allocating a new string
<[spoiler]>
yorickpeterse, he needs the portion of the string which triggered the regexp, though
<[spoiler]>
well, the rule
imperator has joined #ruby-lang
<yorickpeterse>
Ah, I'd just use String#match / String#scan in that case
Iskarlar has quit [Ping timeout: 240 seconds]
<yorickpeterse>
String#[] always returns the first match I believe, which might not be what you want
mikecmpbll has joined #ruby-lang
<[spoiler]>
yep it returns the first match (unless you use [regexp, index], in which case it returns the index from the MatchData object
donove has quit [Quit: Leaving]
<[spoiler]>
yorickpeterse, some of the rules are text rules which have special regexp symbols in them, though. like [ and ]s, so you don't want them regexpified
<[spoiler]>
it's a bigass list of rules (idk if you clicked it) which specifies what type of search should be used (textual or regexp)
banister has quit [Read error: No route to host]
bodgix_wrk has quit [Quit: Leaving.]
<yorickpeterse>
I believe you can tell Regex.compile or w/e it was to treat that as literal [ and ]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
<[spoiler]>
o, didn't know about that
Iskarlar_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tkuchiki has quit [Ping timeout: 250 seconds]
gwendall has joined #ruby-lang
ta_ has joined #ruby-lang
scampbell has joined #ruby-lang
ta_ has quit [Ping timeout: 265 seconds]
tkuchiki has joined #ruby-lang
Lewix has joined #ruby-lang
chouhoulis has joined #ruby-lang
mietkacy has quit [Ping timeout: 246 seconds]
LBo has joined #ruby-lang
intersect has quit [Ping timeout: 265 seconds]
skade has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
ljarvis: Array#length is the actual method
<yorickpeterse>
size is an alias :P
<imperator>
one of the few true aliases :)
<yorickpeterse>
it gets more confusing with String
<yorickpeterse>
String#length and String#size are the same
<yorickpeterse>
but oh there's also String#bytesize
<ljarvis>
imo String#size should be bytesize and length should be.. well, length
Creeves has quit [Ping timeout: 265 seconds]
<yorickpeterse>
yeah
nux443 has quit [Quit: leaving]
shambrarian has joined #ruby-lang
<maloik>
b
<ljarvis>
c
<maloik>
:(
<maloik>
good thing that wasnt a password then
ta_ has quit [Ping timeout: 255 seconds]
mostlybadfly has joined #ruby-lang
hrs has joined #ruby-lang
loincloth has joined #ruby-lang
matsutomo has quit [Quit: matsutomo]
skade has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
My passwords consist out of spaces, that way nobody will ever figure out what they are
<maloik>
what's wrong with **** ?
mistym has joined #ruby-lang
<yorickpeterse>
You mean hunter2?
loincloth has quit [Ping timeout: 255 seconds]
<maloik>
hunterZ to confuse people
Lewix has joined #ruby-lang
<yorickpeterse>
hunter(n)
tenderlove has joined #ruby-lang
scampbell has quit [Ping timeout: 265 seconds]
<yorickpeterse>
it's a monadic function to calculate a secure password using "hunter" as the salt
Iskarlar has joined #ruby-lang
<ljarvis>
you get kickban for talking about monads around here
mistym has quit [Remote host closed the connection]
<imperator>
you do?
<yorickpeterse>
at least I didn't say it was an endomorphic monoid producing a cryptographically secure password
* yorickpeterse
is just smashing words together
<ljarvis>
imperator: no i dont, because i have a wizard hat
<ljarvis>
yorickpeterse: funnily enough the same process occurs when i write haskell
<yorickpeterse>
Does it also instantly make you 10x smarter?
<ljarvis>
ya
<yorickpeterse>
well fuck...perhaps these "10x" programmers all write Haskell
<ljarvis>
#1 best programmer no bugs
<maloik>
:D
<cout>
is there a term to describe the "if __FILE__ == $0" idiom?
<yorickpeterse>
Hm...I wonder if I can get a mug that says "#2 Programmer"
<yorickpeterse>
and wait for people to realize the joke
* ljarvis
waits
<yorickpeterse>
s/realize/figure out
<bougyman>
cout: s/$0/$PROGRAM_NAME/
<yorickpeterse>
(off by one error, badum tsh)
<ljarvis>
cout: bougyman nails it, use the english terms and it'll be self explanatory
skade has joined #ruby-lang
<cout>
ljarvis: but I'm trying to use it in a sencence :)
<ljarvis>
cout: "this is the file being run by the interpreter, it is not being required or loaded by another file"
micmus has quit [Remote host closed the connection]
rahul_j has joined #ruby-lang
<whitequark>
ljarvis: so, have you tried monads
micmus has joined #ruby-lang
Miphix has quit [Quit: Leaving]
skade has quit [Client Quit]
charliesome has joined #ruby-lang
<cout>
ljarvis: I'm not trying to document that line of code; I'm trying to refer to that idiom, except it doesn't have a name that I know of, so the most succinct term I could come up with was "a __FILE__ == $0 check"
<yorickpeterse>
whitequark: I smoked them once
<cout>
but that's not a very good name
skade has joined #ruby-lang
<ljarvis>
whitequark: I think they gave me a bad stomach
mcclurmc has quit [Remote host closed the connection]
<whitequark>
ljarvis: WHERE'S MY KICKBAN
<ljarvis>
cout: "a check for if the current file is the one being run"
<ljarvis>
cout: i mean srsly
Lewix has quit [Remote host closed the connection]
<cout>
I still don't understand why they are called monads
<Arctos>
why it doesnt enter to else
<Arctos>
is if ,else construct wrong or something?
<ljarvis>
lol .fist
<ljarvis>
that'd be a perfect method for yorickpeterse
klmlfl has joined #ruby-lang
<yorickpeterse>
wat
<imperator>
cout, conditional script stanza?
<yorickpeterse>
I have to focus for a bit, I'm writing tests for 4 year old code
<yorickpeterse>
and half of it is a mystery to me
<ljarvis>
/quit
<yorickpeterse>
no
<ljarvis>
Arctos: your else won't be entered if your statement is truthly, so it must be truthly
mistym has joined #ruby-lang
<cout>
imperator: I kinda like that
<imperator>
saw it called that for the python equivalent
<imperator>
though not commonly
<ljarvis>
stanza :|
<imperator>
costanza
<cout>
imperator: doesn't really apply in the case I'm trying to describe, since the idiom isn't being used for the main stanza
<ljarvis>
consuela
<imperator>
dunno, guess we make one
<imperator>
self-script check :)
<cout>
so I went with "program name check" per bougyman's suggestion
sush24 has quit [Quit: This computer has gone to sleep]
<imperator>
works for me!
* bougyman
win
charliesome has quit [Quit: zzz]
kiyote23 has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
klmlfl_ has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
kapil__ has quit [Quit: Connection closed for inactivity]
mcclurmc has joined #ruby-lang
klmlfl has quit [Ping timeout: 245 seconds]
kiyote23 has quit [Remote host closed the connection]
araujo has quit [Ping timeout: 244 seconds]
mtk_ has joined #ruby-lang
cornerma1 has joined #ruby-lang
araujo has joined #ruby-lang
<mtk_>
Hello, is there a way for this code if my_hash.detect { | k, v | mystring.match(k) } puts "Some data" end pass somehow my_hash element return by .detect method into the if block ?
dangerousdave has joined #ruby-lang
miqui has joined #ruby-lang
<maloik>
create a gist please, reading code like that make my brain melt
<mtk_>
i mean i would like to print "Some data" and key of my_hash returned by .detect method
<mtk_>
sure
cornerman has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
marr has quit [Read error: Connection reset by peer]
<mtk_>
ljarvis: could you also tell my whether its good to put = in conditional? because when writing if v=nil ;puts a; end in IRB i got warning
<Arctos>
why i cant connect each loop with if construction
<mtk_>
"warning: found = in conditional, should be =="
<ruby-lang034>
Thank you Mon_Ouie !
dangerousdave has joined #ruby-lang
<ljarvis>
mtk_: that's because it's a literal, assignment in conditions is fine just dont go overboard with it. It's purely style preference though, you can assign above if you prefer
<ljarvis>
>> if x = 1; x; end
<eval-in__>
ljarvis => /tmp/execpad-a9ca7594c5b5/source-a9ca7594c5b5:2: warning: found = in conditional, should be == ... (https://eval.in/239609)
<ljarvis>
you don't need to check if stuff is empty, since v.any? will return false if it's empty, and it'll be empty if stuff is empty
<mtk_>
works!
<mtk_>
thank you a lot!
<ljarvis>
you're welcome a lot
ledestin has joined #ruby-lang
enkristoffer has quit [Quit: ❤]
mtk_ has quit [Quit: Page closed]
rbrs has quit [Remote host closed the connection]
micmus has quit [Ping timeout: 264 seconds]
rikkipitt has joined #ruby-lang
enkristoffer has joined #ruby-lang
mistym has quit [Remote host closed the connection]
enkristoffer is now known as Guest91034
mistym has joined #ruby-lang
gwendall has joined #ruby-lang
mistym has quit [Ping timeout: 245 seconds]
apeiros_ has joined #ruby-lang
gwendall has quit [Ping timeout: 245 seconds]
iamninja has quit [Quit: ZZZzzz…]
mistym has joined #ruby-lang
Iskarlar_ has joined #ruby-lang
rahul_j_ has joined #ruby-lang
kiyote23 has joined #ruby-lang
Iskarla__ has joined #ruby-lang
rahul_j has quit [Ping timeout: 255 seconds]
rahul_j_ is now known as rahul_j
Iskarlar has quit [Ping timeout: 244 seconds]
mcclurmc has quit [Remote host closed the connection]
Iskarlar has joined #ruby-lang
Iskarlar_ has quit [Ping timeout: 240 seconds]
donove has joined #ruby-lang
ruby-lang587 has joined #ruby-lang
stardiviner has joined #ruby-lang
Iskarla__ has quit [Ping timeout: 245 seconds]
Guest91034 has quit [Changing host]
Guest91034 has joined #ruby-lang
AKASkip has joined #ruby-lang
benlovell has joined #ruby-lang
imperator has quit [Quit: Valete!]
nofxx has joined #ruby-lang
kiyote23 has quit [Ping timeout: 244 seconds]
jds has joined #ruby-lang
Iskarlar_ has joined #ruby-lang
Guest91034 is now known as enkristoffer
Nixsos has quit [Quit: zzzz]
Iskarlar has quit [Ping timeout: 265 seconds]
wprice|afk is now known as wprice
loincloth has joined #ruby-lang
Iskarlar has joined #ruby-lang
riffraff has joined #ruby-lang
mikecmpbll has quit [Quit: ciao.]
__butch__ has joined #ruby-lang
segy has quit [Ping timeout: 244 seconds]
segy has joined #ruby-lang
Iskarlar_ has quit [Ping timeout: 244 seconds]
nertzy has joined #ruby-lang
loincloth has quit [Ping timeout: 265 seconds]
marr has joined #ruby-lang
hahuang62 has quit [Ping timeout: 265 seconds]
Val__ is now known as rand0mbits
symm- has joined #ruby-lang
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[spoiler] has quit [Ping timeout: 264 seconds]
benten has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has quit [Changing host]
cmhobbs has joined #ruby-lang
rikkipitt has quit [Remote host closed the connection]
thisirs has joined #ruby-lang
mcclurmc has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
musl has joined #ruby-lang
benlovell has quit [Ping timeout: 250 seconds]
musl has quit [Client Quit]
mcclurmc has quit [Remote host closed the connection]
musl has joined #ruby-lang
dik_dak has joined #ruby-lang
<ledestin>
is it correct that time after daylight savings change will be ahead/behind saved time by a correct amount, because time after dst change will be in a different timezone?
tlr has joined #ruby-lang
mcclurmc has joined #ruby-lang
emmesswhy has joined #ruby-lang
drewdavis has quit [Quit: No Ping reply in 180 seconds.]
drewdavis has joined #ruby-lang
tlr has quit [Client Quit]
nertzy has quit [Quit: This computer has gone to sleep]
gwendall has joined #ruby-lang
Guest96038 is now known as perry
perry has quit [Changing host]
perry has joined #ruby-lang
gwendall has quit [Ping timeout: 244 seconds]
gjaldon has joined #ruby-lang
wallerdev has joined #ruby-lang
_whitelogger___ has joined #ruby-lang
moogumbo has joined #ruby-lang
t_ has joined #ruby-lang
SkramX_ has joined #ruby-lang
jds has joined #ruby-lang
spastorino has joined #ruby-lang
chancancode has joined #ruby-lang
duper` has quit [Ping timeout: 249 seconds]
duper has joined #ruby-lang
linc01n has quit [Ping timeout: 244 seconds]
ggherdov has joined #ruby-lang
jhass has quit [Ping timeout: 250 seconds]
jhass|off has joined #ruby-lang
x0f has quit [Ping timeout: 244 seconds]
Steve_Jobs has quit [Ping timeout: 250 seconds]
ta_ has joined #ruby-lang
Steve_Jobs has joined #ruby-lang
skade has joined #ruby-lang
riffraff has quit [Quit: This computer has gone to sleep]
enkristoffer has quit [Quit: ❤]
enkristoffer has joined #ruby-lang
x0f has joined #ruby-lang
enkristoffer has quit [Changing host]
enkristoffer has joined #ruby-lang
enkristoffer has quit [Client Quit]
enkristoffer has joined #ruby-lang
linc01n has joined #ruby-lang
ta_ has quit [Ping timeout: 240 seconds]
skade has quit [Ping timeout: 245 seconds]
tsou has quit [Ping timeout: 264 seconds]
suavemint has joined #ruby-lang
brianpWins has joined #ruby-lang
riffraff has joined #ruby-lang
hahuang65 has joined #ruby-lang
benten has quit [Ping timeout: 244 seconds]
gwendall has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
Iskarlar has joined #ruby-lang
yfeldblu_ has quit [Remote host closed the connection]
shambrarian_ has joined #ruby-lang
<bradland>
ledestin: that question actually has multiple parts. you should store all time values as UTC, then localize to the appropriate time zone based on who/what is consuming the data.
shambrarian has quit [Ping timeout: 245 seconds]
jhass|off is now known as jhass
<bradland>
to answer your question more directly, no, your time values should not “shift” after the DST change if they are stored correctly.
ruby-lang587 has quit [Ping timeout: 246 seconds]
<ledestin>
bradland: yeah, I kinda got to that. thanks for confirming.
<bradland>
the key thing to remember is that date & local time cannot be separated.
<bradland>
you bet
<bradland>
to share a little more, what we do is examine the submitted date/time and determine the localized UTC offset *for the given date*
<bradland>
that last bit is the important part
<ledestin>
does Ruby notice timezone change on dst?
<bradland>
lemme check some docs
<bradland>
what version of Ruby are you using?
<ledestin>
2.1
<bradland>
yes, the core Time class supports time zones
<bradland>
remember that DST is a localization concern