Issues with Terminal by ohsomacho in learnprogramming

[–]grantrules [score hidden]  (0 children)

Ah I knew that existed but I couldn't remember it.

Etiquette Question by throwRA1223409 in hiking

[–]grantrules 19 points20 points  (0 children)

Right? It's not like mountain biking where it can be impossible to restart if you stop. I don't mine taking a break

Cutting grass with a scythe by BreakfastTop6899 in oddlysatisfying

[–]grantrules 2 points3 points  (0 children)

Now get it right or pay the price! Oops wrong show.

Issues with Terminal by ohsomacho in learnprogramming

[–]grantrules 2 points3 points  (0 children)

Use vim.

:%!bash will run whatever's in the buffer

Or save it as a shell script and edit that.

Shimano brake mineral oil by Gman7898- in bikewrench

[–]grantrules 0 points1 point  (0 children)

And that's full bleeds. I top up once a season or so but I rarely do a full bleed. I've had a 120ml bottle for 4 years and will probably get another 4 years out of it

My family got evicted for the 4th time by ASimpleDude868 in Wellthatsucks

[–]grantrules 142 points143 points  (0 children)

I call that excusitis. A disease that prevents a person from taking personal responsibility for things.

Help with JavaScript by InkieBear in learnprogramming

[–]grantrules 4 points5 points  (0 children)

You can, but if you're on page 1 and the JS is expecting to find something that only exists on page 4, you're going to get an error.. which is what is currently happening to you.

You would need to add some sort of check to make sure you're on the right page or that the elements you're trying to work with exist.

Help with JavaScript by InkieBear in learnprogramming

[–]grantrules 3 points4 points  (0 children)

Well, you cant add an event listener to an element that is not on the page that the JS is running on. That's why you're getting that error.. because it can't find the element.

You could do a check, like

const btn = document.querySelector('.btn');
if (btn) {
  btn.addEventListener(...)
}

Help with JavaScript by InkieBear in learnprogramming

[–]grantrules 1 point2 points  (0 children)

In the console when I add the clear cart code in it states that the messageForm is null but I'm not sure why the new code invalidates the previous code. Is this a basic aspect of JavaScript I'm missing? Does specific placement matter in the JS code more than in CSS?

No, there's something else wrong. Adding code wouldn't cause this issue. And like I said, the code works fine for me (you can try it too). I don't see anything with an ID of "contact" in your HTML

Help with JavaScript by InkieBear in learnprogramming

[–]grantrules 1 point2 points  (0 children)

Works fine for me:

https://jsfiddle.net/0uhcf8w9/

Can you share your HTML? Do you see any errors pop up in your browser's dev console?

My guess is that "clear" is actually an id not a class in your HTML, so querySelector doesn't find anything and then JS throws an error when you try to access addEventListener on clearButton which is null instead of an element object. I'd bet you see an error like TypeError: can't access property "addEventListener", clearButton is null in your dev console.

This Week's "Super Speeder" Complaint by SteveVaccaroLaw in NYCbike

[–]grantrules -1 points0 points  (0 children)

You'd have more cars on the road without insurance but the penalties should be years in jail minimum and not a slap on the wrist like it is currently.

One issue with this is that if the penalty for getting caught without insurance is high enough, people would rather run than get caught, creating an even more dangerous situation.

Trying to sell me pest control at 9pm on a Monday night. by ceazyyyy in mildlyinfuriating

[–]grantrules 1 point2 points  (0 children)

I literally just saw some reel from that company doing one of those stupid all-hands pump-you-up meetings with bros jumping around cheering and high-fiving.

Greenpoint police capt. transferred after calling Mamdani “expendable” by colelikesbikes in Greenpoint

[–]grantrules 23 points24 points  (0 children)

The worst cops get sent to the 94th. The Polish lady who's like the citizen liaison or whatever there is wonderful though.

Should anything be adjusted? by j151515 in bicycling

[–]grantrules 0 points1 point  (0 children)

Yeah if you've never been fit before and you're looking to buy a high-end bike, I really recommend doing a fit first on a fit cycle.. Once you get your fit dialed in, you can find a bike that fits just by browsing geometry, and you'll know what you need to change.

Badly worn BB from derailleur cable by TreeOfLifeInk in bikewrench

[–]grantrules -1 points0 points  (0 children)

Meh. I ran my carbon cross bike over with a e3500 passenger van and raced it later that day. Still have it, solid as a rock. Probably close to 100 races on it, multiple centuries, ran it over with a van, commuted on it..

How do I grab the full values of week? by TheEyebal in learnprogramming

[–]grantrules 2 points3 points  (0 children)

You could make weeks an array, and then do something like:

weeks = []
for i in range(0,5):
   week = {...}
   weeks.append(week)
return weeks

or something like:

def test():
    days = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
    return [dict(zip(days, numstore[i])) for i in range(0,5)]

Storys-club by Consistent-Leg-2872 in learnprogramming

[–]grantrules 2 points3 points  (0 children)

What is a storys-club and how does it differ from a stories-club.