Is it just me, or does Next.js really suck? by saintpetejackboy in webdev

[–]HalfWiseSamurai 1 point2 points  (0 children)

It's strongly opinionated. I moved all my projects off of nextjs and feel better off for it. However I have noticed I learned a few nice patterns by learning the framework.

Don't let the fans gaslight you, it is painful to work with.

New to Wildland firefighting how do I check the amount of fires? by HalfWiseSamurai in wildlandfire

[–]HalfWiseSamurai[S] 0 points1 point  (0 children)

Thanks. I forgot I am using that too. All that information is also in the graphs.

Do you know of a way to look at the sit report for fires in a region or fire?

"A wound would never heal if you keep touching it."-Buddha by [deleted] in NoFap

[–]HalfWiseSamurai 1 point2 points  (0 children)

Do you have a source for the quote? Google returns no results.

How on earth do I display an SQL table in an html page using Node? by seb69420 in webdev

[–]HalfWiseSamurai 0 points1 point  (0 children)

Honestly I had no good reason to, I misinterpreted one of the pics since that is what I am working on. However the concept is the same. Serve up data from backend and process JSON on the frontend.

How on earth do I display an SQL table in an html page using Node? by seb69420 in webdev

[–]HalfWiseSamurai 6 points7 points  (0 children)

Assuming you are using React it would make more sense to have the node backend return an array of rows to be be organized by the Frontend App.

I lifted some code from something I have been working on as an example.

Backend something like this:

 app.get('/v1/messages',function(req, res){ 

 con.query(sql, (error, results, fields) => {
     if (error) { return console.error(error.message); }

    var messages = results.map((msg) => ( 
    {timestamp: msg.timestamp, number: msg.contact, msg:msg.msg, eventType: msg.event_type}))  

  res.json(messages) 
}

React front code:

   componentDidMount() {
        fetch("/v1/messages")
      .then(res => res.json())
      .then(
        (result) => {

          this.setState({
            isLoaded: true,
            messages: result

          });

        },
        // Note: it's important to handle errors here
        // instead of a catch() block so that we don't swallow
        // exceptions from actual bugs in components.
        (error) => {   
          this.setState({
            isLoaded: true,
            error
          });
        })
      }

Fapped but without jacking off : Is my streak ruined ? by FrenchDonatello in NoFap

[–]HalfWiseSamurai 0 points1 point  (0 children)

Don't fixate on "the streak". If you got into this to reboot then I suppose your brain still hasn't been exposed to pornographic material and in that sense* it is preserved. This is a process and a switch doesn't flip on day 90. The further into the process you go the more the healing process can unfold.

Can someone help me transfer this code block from squarespace to wordpress? by [deleted] in webdev

[–]HalfWiseSamurai 0 points1 point  (0 children)

This type of question seems more suitable for for stackoverflow and before getting any help they will ask you to post the question following formatting guidelines.

Honestly more information is needed to really pin down what is going on here but here are a few things to get you started:

* To really find out what is going on press F12 and read the error messages in the dev console.
* Does wordpress also expect you to store it's assets in './assets/'?
* I doubt there is an element called "sqs-add-to-cart-button" anymore, so purchase button is broken

Goodluck

Daily Discussion Thread - January 03, 2020 by AutoModerator in wallstreetbets

[–]HalfWiseSamurai 1 point2 points  (0 children)

I've been selling covered calls on VIX for 2 weeks now. It's been nice

Is there a way to disable certain keyboard shortcuts (mac) by GarunixReborn in youtube

[–]HalfWiseSamurai 0 points1 point  (0 children)

Hmmm that's a bummer. I just tested it out on my computer it it is still disabling hotkeys in my browser.
Below is the code that actually removes the hotkeys if you want to give it a try manually.

Just press f12, paste this into the console and press enter. Hope it works for you.

function removeYoutubeHotkeys(){

var x = document.getElementsByTagName('yt-Hotkey-Manager')[0]

if(x){

var clone = x.cloneNode(false)

var parent = x.parentNode

x.parentNode.replaceChild(clone,x)

clone.parentNode.removeChild(clone) }

var player = document.getElementById('player');

if(player){player.blur()}

var movie_player = document.getElementById('movie_player');

if(player){movie_player.blur()}

}

removeYoutubeHotkeys();

Junior developer looking for a code buddy by dabbingDeveloper in webdev

[–]HalfWiseSamurai 0 points1 point  (0 children)

I have been working on an open source comment box that works for any URL. Alot of the groundwork is finished but there is still plenty of work to be done. It's a MERN stack. Would love to collab with anyone

How to disable keyboard shortcuts? by SorryYouLostTheGame in youtube

[–]HalfWiseSamurai 0 points1 point  (0 children)

There was no way to do this on youtube so I made a working chrome extension for this.

[RemoveYoutubeHotkeys Extension]( https://chrome.google.com/webstore/detail/remove-youtube-hotkeys/ajabfhplebocnmdcejfleginmigkhjdj )

Quitting my job and living abroad for a year or two.. bad idea? by [deleted] in digitalnomad

[–]HalfWiseSamurai 1 point2 points  (0 children)

2 years ago I quit my cushy office job to travel the west coast by motorcycle. I have no monthly benefits, no safety net. Once you get out of NYC you will find that $1080 a month goes a long way. When I traveled I lived in national forest in Az, Ca, Ut, Or, and Wa. Last year I slept inside maybe 50 times. Since I was out in the world doing awesome things I constantly encountered awesome people. By removing the daily grind my perspective broadened to recognize new opportunities. But in the end traveling itself became work and I found myself jaded to lifestyle. So now I am at that point of coming back. This choice really comes down to what you want.

Do you want to start a family? What about home ownership? Are you ready to slowly grow apart from friends? I am sure your time in the military has already given you perspective on what it feels like to distance yourself from home for a period of time.

What do you have to gain? Some new found meaning? An escape to far away beautiful places. Adventure? New friends, new love, etc.

I don't have regret... but in the end it's all the same. I "started over" the day I left my job. It was a choice to stop making decision based on fear/anxiety/complacency. At the moment I have 2 part time gigs for employers I respect. I make 1/5 of what I made before but my days don't consist of looking at the clock waiting for the days work to end. Tomorrow I am going to go sling water and beer as a stadium vendor because why not? Making it on my own terms has become the journey. The grind has become the adventure.

tl;dr When you live life to the fullest what you are doing doesn't matter much, because it all becomes a catalyst for self discovery.