« first day (1851 days earlier)      last day (3090 days later) » 

5:00 PM
event.preventDefault
 
If using plain HTML forms, I think you can just return false from the submit event on the form.
I think.
 
try to figure why there is an invalid DOM structure instead @Prefix
 
the html doesn't have any action on it
 
pretty sure TD nodes can not exist without a TABLE parent by spec
 
ah
yeah seems to work when wrapped in a table.
 
5:01 PM
so why would you expect qSA wo work properly in an invalid environment
 
because web pages are full of non-spec structures
they wouldn't be if they didn't work to varying degrees.
I expect qSA() to return the out-of-place <td>s.
 
yea but those people are willing to role dices on their business
its up to the individual I guess
 
I'm not condoning it, just saying that it's so common that it's no surprise it 'works'.
 
yes of course.. but such thinking comes out of ignorance. If you know the spec, you would not create such a structure in the first place nor would you wonder why it does not work
or at least, it would be your first guess
 
what does return using do?
 
crl
5:04 PM
you need more ``````
 
1 message moved to Trash can
@NathanJones Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
I'm old enough to remember the wild west days of horribly wrong html in almost every page
 
@tereško okay i have switched to almighty atom
 
function execute(sql, bindParams, options, pool) {
    return using (getConnection(pool), function(connection) {
        return _innerExecute(sql, bindParams, options, connection);
    });
}
 
@Abhishrek Welcome to the club.
 
crl
5:05 PM
dmn atom is good? I made my boss buy a ST licence
 
+1 atom
 
Yep but a memory hog
 
yes, just like crhome
 
@NathanJones what does return using do there?
 
@crl I still prefer Sublime
 
crl
5:05 PM
@SomeGuy ah ok :)
 
I've used atom for 1 year for a real project. it's a decent editor, but could really use the completnion and debugging of VSCode.
 
agreed. Back then the information about valid specs wasn't available because there simply was no spec. Nowadays we have valid specs which vendors implement (not perfect at all, but in comparison to "that time" its glorious)
 
crl
will give atom another chance though (tried it quickly before)
 
@jAndy Yup. I'm all for proper html. I stick to it myself and encourage others. But my history of seeing how browsers allow non-spec structures made me not even question wether querySelectorAll() would return them (though I could still be wrong about that).
 
atom stole most of its UI design from ST
 
Anonymous
5:07 PM
Hello all. I want to be able to change the following html with jQuery. Something like: <div style='display: block;'>. Basically, I want to manually toggle the block and none.
 
@NathanJones Good.
 
crl
!!tell Hunder jquery show
 
crl
*t, or hide or css('display', 'whatever')
 
@Luggage I totally understand .. the assumption is very comprehensible. Anyways, to realize that invalid states might cause trouble, should be teached in every class
 
Anonymous
5:08 PM
wow... you are right.. lol
 
Anonymous
bye
 
No, you gotta answer a question, now.
stay until you do.
 
@NathanJones and ST stole it from Textmate
 
I've been stuck here for years trying to catch up and I'll be damned if you're gonna get away with it.
 
lol
 
5:09 PM
@tereško i didn't mean to imply that was a bad thing
 
I meant to imply that your statement was pointless
:P
 
crl
he didn't put an ending dot, that's right
 
never heard of textmate
 
crl
Mac's (evolved) notepad probly
 
hmmm where is backtick in OSX D:
var s = document.getElementById("submit");
:/
 
crl
5:17 PM
you need to purchase the right for using it
 
:D
I didn't choose this, it was work's choice unfortunately
 
crl
it's not too bad according to people I've known
 
I think I've amanged what I want
 
Oh man I'm fucking killing it today
 
if (s.hasAttribute("disabled")) {
\o/
 
crl
5:19 PM
s.disabled
 
So if the id of submit has disabled attribute, nothing will happen?
 
crl
it means it's ... disabled
 
haha yes
cept even with disabled on the submit button, the ajax still fires
 
crl
pressing enter key from a field in the form?
 
@djsmiley2k same place it is on a PC.
 
5:22 PM
erm
on my keyboard it's on the backslash key
 
odd
 
on my pc at home, it's below the esc key
yeah, screw apple :/
 
my macbook pro has it on the tilda. next to 1
yea, how dare apple stray from the keyboard pattern used by a 1970's unix mainframe
 
crl
in the future we won't have keyboards probably anyway
 
I hear the new models need an external thunderbolt adapter just to read punch cards
 
5:24 PM
savage af
 
:)
 
=)
 
Hm, Object.hasOwnProperty() doesn't work for getting functions? Example: const Emitter = require('events').EventEmitter; const s = new Emitter(); s.hasOwnProperty('emit')
 
Anywy, joking aside. Try to go along with those little differences. You may like some of the mac features. Especially for development. The unixy environment is a big plus.
 
0
Q: Add GitHub as a registration/login option

nickI'd like to link GitHub to my StackOverflow account as another login option. Right now these are the only options: There have been a couple related posts on Meta, such as Login with Github? (posted in 2014) and Authenticate to Stack Exchange using GitHub (from 2012). The reason given was "GitH...

go give me precious upboats
 
5:26 PM
@Luggage or just like, run linux :P
 
f that.
 
crl
that's a bold move Nick
 
not for my laptop. linux is for servers.
 
but VMs?
or just log into a server
 
meh, i just open terminal.
 
5:27 PM
@Luggage I have to agree with this
 
but then you have to deal with having a mac
I've always had horrible luck with them. Never used one that didn't kernel panic the first day.
 
I admit there are things I like better about windows, but there is a lot to like.
 
the linux desktop experience just doesn't match anything OS X (or even Windows) has to offer
 
@nick oh, you should never use it as a desktop
 
Desktop: Windows > OSX > Linux
Commandline: Linux > OSX > windows.
 
5:28 PM
I run a linux VM with X only for copy-paste on a Windows host (for VPN and domain stuff)
 
the best and worst of both worlds
 
the first one is debatable
 
lunch time afk
 
why no BSD?
 
Depending on the day, I either SSH in from chrome or just SSH back and forth
@tereško lol
 
5:29 PM
ssh from chrome? terminal in a fullscreen workspace is nice for ssh
 
the annoying thing about Windows is there's no built-in support for ssh
 
or anything really
 
ohh, osx does need better terminal colo defaults. The white background and tiny text is a turnoff. Chagen that shit right away.
 
ssh client in a chrome tab
 
5:29 PM
@ssube I use this too, its nice
 
@nick yea, but just install git and you get ssh and some other tools for free.
 
ssh into the vm/server, run screen/tmux on there
 
OS X is best. iTerm is fantastic
 
or git bash (with ssh) in conemu
 
right.
 
5:30 PM
@Luggage yep
 
conemu is the best console emulator I've met yet
between git bash and chrome ssh, you're pretty much set
 
I've recently started ConEmu and I'm ambivalent about it
 
@corvid Pretty sure it's not because "emit" is a function; it's because it's on the prototype and "hasOwnProperty" doesn't check prototypes. (Hence "own")
 
Windows 11: Now with a full posix toolset and bash
 
@Luggage Don't get my hopes up.
 
5:31 PM
at least for me, it doesn't seem to be a huge step up from the default command line
 
@nick tabs? copy paste? multiple command lines?
the fact it actually works at all
 
the copy/paste is nice I'll agree
but I actually prefer working with separate windows for multiple SSH sessions
 
you should try the chrome client
has copy paste and you can tear off tabs
 
link?
 
Do you guys color code your terminal windows/tabs? I seem to be the only person on my team who does.
 
5:33 PM
run tmux/screen on the server side and you can have panes within torn tabs
 
That's what I've been using for the past 6 months or so
 
I should really learn vim or emacs
 
vim vim vim
 
vim
emacs is great if you want to spend all your time configuring your editor (for fun)
 
5:34 PM
been using nano a lot cuz I'm spending a lot of time working through a shell
i'd probably go with vim
 
personally, I use atom on my laptop (with the vim plugin) and vim on servers
 
If you just want an editor you can use on the shell, and intend to use something like ST as your primary editor, then definitely vim.
 
If you ever use linux for anything, you're going to have to learn vim
because you'll get stuck in recording mode the first time you use it
and spend 7 hours reading vim docs
Trying to exit
 
Definitely check out the latest Atom. It used to be super slow, but they improved it a ton between 0.8 and 1.0 (roughly)
 
If you're looking to do all or most of your development through a shell editor; then emacs is an option.
 
5:36 PM
It's still pretty light, unlike Emacs or VS.
 
I really like Atom; I've been sticking to ST for my main development, but I've been doing hobby-work in Atom.
 
crl
you can have the same shortcuts? on both, guess so
 
@Retsam Ahh, okay, so hasProperty. Thank you good sir
 
hangouts.google.com sigh, this thing can load
 
crl
you not use gmale directly
 
5:41 PM
So this is essentially the same as _.defaults in es6?
 
@nick this please, tyvm
 
    return Object.keys(options)
      .reduce((config, option) => {
        if (!config.hasOwnProperty(option)) {
          config[option] = options[option];
        }
        return config;
      }, defaults);
 
@AwalGarg :D
 
@corvid es6 has default arguments in destructured object parameters. and that code is reaaaly ugly
 
@Retsam I still use sublime for random single files.
 
5:42 PM
@corvid You don't need hasOwnProperty. Who cares if it was inherited?
 
Oh yeah... that is a better idea...
 
Inheriting config classes is actually a really nice pattern.
Allows you to override one field with a getter and derive from others.
 
^^, didn't mean code is ugly because es6 has syntax for that. ugly because doesn't work intuitively, and that hasOwnProp makes no sense.
 
Object.assign(Object.create(defaults), newValues); ?
 
Or Object.assign({}, defaults, newValues)
 
5:44 PM
this beef jerky is awfully dry...
 
or that.
@AwalGarg's way lets you unset values. Mine does not.
 
crl
!!> Object.assign({1:1},[0])
 
@crl {"0":0,"1":1}
 
Ok this is fun
now i've seemingly permeantly disabled the submit button XD
 
nothing is permanent on the internet except nudes
 
crl
5:46 PM
you can still submit the form, from the console
 
@corvid I think your way is mutatiing the defaults..
 
i can't find any way to submit it.. ?
Oh right :D
yeah I don't think my users will like tho
 
crl
or with curl, or any http client, any web robot around
 
I can submit your form without even loading your form.
 
crl
even if it's localhost </trolling>
 
5:48 PM
My method is to ask my friend to do it instead :D
 
!!>Object.assign({ name: 'Jeff', pet: 'Cat' })
 
@corvid {"name":"Jeff","pet":"Cat"}
 
!$(this).hasClass('has-error')
Is this the correct way to check we don't have a class?
 
@ssube As you can probably tell, you're just way better at javascript than me, cause I just looked for the thing in the MDN docs that seemed to match what I was trying to do
 
No. You are not even using angularjs which is mandatory to use with jQuery.
 
5:49 PM
@corvid that's a no-op.
 
crl
or this.classList.contains('has-error')
 
@Luggage Yep, was wondering what happens
 
@crl well the has-error is actually applied to a div within the form :/
/me is unsure how to check this
 
@crl shutup with your ugly vanilla dom :((
@MadaraUchiha yo, nominated for the mod erection election yet? :D
 
crl
to continue with vanilla :) , you could check if form.querySelector('.has-error') returns null or not
 
5:52 PM
@MadaraUchiha @recurse you guys left?!
 
@crl ok thinking how that'd work now
urgh wait nope
my problem is the submit button already has the disabled class
but it STILL submits :/
 
you want disabled="disabled"
classes only style.
 
Hey bro checkout the disabled attribute instead
I hear classes are gross
 
btn btn-primary-outline center-block disabled
ah haa!!
ok
$('.submit', $(this)).attr('disabled', false);
so this should set disabled to false?
hmmmm that bit isn't working then, I go look why now
 
This is the problem with kids these days. They mix different classes together.
 
5:54 PM
disabled="disabled"
 
sigh, focus on a single class at a time
 
Mixing up classes with attributes.
 
my eyes!
 
1 message moved to Trash can
@djsmiley2k Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com or pastie.org
 
aren't real?
 
5:55 PM
Why not just do e.preventDefault() ?
 
1 message moved to Trash can
@djsmiley2k Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com or pastie.org
 
@djsmiley2k CTRL-K to make it keep formatting
 
crl
why peole struggle with that ---------> fixed font button, just click .. it
 
ctrl K didn't work
 
or indent all lines by at least 4
 
5:55 PM
            $('#datafixForm').on('status.field.bv', function(e, data) {
            var formIsValid = true;
            $('.form-group',$(this)).each( function() {
                formIsValid = formIsValid && !$(this).hasClass('has-error');
            });

            if(formIsValid) {
                $('.submit', $(this)).attr('disabled', false);
            } else {
                $('.submit', $(this)).attr('disabled', true);
            }
        });
 
\o/
 
getting warmer.
 
I don't think setting the attribute will actually submit the form.
 
@crl theres no button here...
 
crl
5:56 PM
your code lacks its head
 
@djsmiley2k ewwww
 
@AwalGarg ??
 
crl
@djsmiley2k near upload, when it's multiline
 
So, in es6, is there a good way to flatten arrays? I mostly just use _.flatten
 
third time: disabled="disabled"
 
5:57 PM
@AwalGarg lol yeah
 
@crl ah now I see it :D
 
or use the property disabled, not the attribute
 
crl
@corvid like [[1],[2]]->[1,2] ?
 
@corvid arr.reduce((a,b)=>[...a, ...b]),[])
 
@Luggage i'm trying to figure how to apply the property or whatever it is
 
5:57 PM
if you were using plain JS it would be .disabled = true;
 
@AwalGarg That seems potentially quite expensive.
 
Sounds like an XY problem is creeping up on @djsmiley2k
 
but juqert it like .prop('disabled', true); i think
 
               $('.submit', $(this)).prop('disabled', false);
@AmericanSlime it's a 'This was working but the boss wanted it done differently for no real reason'
 
flattening is expensive indeed, but not much
 
5:58 PM
So here I am attempting to learn enough jquery to get by :/
 
@djsmiley2k Will your boss pay me if I help you?
 
Sadly not
 
bad boss
 
/me looks at $('.submit', again
 
I lost my job, my house, my wife. I was forced to like on the streets...
So here I am attempting to learn enough jquery to get by :/
 
5:59 PM
All you're trying to do is submit if formIsValid is true right?
 
@Luggage lol that's how it feels
 
that just felt like the end of a sad story to me.
 
@AmericanSlime yeah for now.. :D
 

« first day (1851 days earlier)      last day (3090 days later) »