r/stackoverflow • • Dec 20 '24

Javascript Storing env files in surge deployments?

1 Upvotes

I have 3 projects I want to share but I built them when I was more noobish in web development. For the first, it’s frontend purely, but my api key is exposed in code, the link to my backend (Render) for my personal MEN stack (HTML/CSS/JS, no React) is exposed in #2.

The third is on heroku so I’m pretty sure it isn’t exposed, thus safe to share, but I’m not so sure otherwise.

I can in theory make an env file in the root directory for project 1 to get a singular, dedicated link. For #2 I have a bunch of backend logic in the repo and therefore I need to go into the client folder to deploy/update the webpage in surge, and I’m not sure how dotenv would react to that. On top of that, I’d like conditional logic depending on if I’m getting calls from my own local host for testing, or Render.


r/stackoverflow • • Dec 20 '24

Question How come i can edit others posts and answers earlier than i can comment on them

1 Upvotes

Where is the logic here? I want to ask for a clarification on someone else's answer and i can't do it, but i can just go and edit that post and practically ruin it even without 50 reputation


r/stackoverflow • • Dec 11 '24

Javascript Need help with a failing fetch request

Thumbnail reddit.com
1 Upvotes

r/stackoverflow • • Nov 27 '24

Question Using Socket.io with Flutter stream and BLoC pattern

1 Upvotes

I'm trying to learn BLoC pattern using flutter_bloc package in flutter. I'm aslo using socket_io_client package to connect to a local Node.js server.

I have 3 problems:

  • The first, when the state changes from connected (initial state) to disconnected, the "Disconnected" text doesn't persists on the screen, and it immediately goes to "Nothing".

  • Secondly, If the connection is severed between the app and Node.js, socket.io tries to reconnect. And when it succeeds, it never goes back to "Connected" again. Although I made another event to reconnect.

  • Thirdly, when the app (the client) emits a socket event to the server, to receive certain data (I see it in the terminal), the data is not displayed on the screen. Although the event is triggered.

The code is in the following stackoverflow link:
https://stackoverflow.com/questions/79230656/using-socket-io-with-flutter-stream-and-bloc-pattern


r/stackoverflow • • Nov 27 '24

C++ Hash tables in CUDA C++ program, bug!

Thumbnail reddit.com
1 Upvotes

r/stackoverflow • • Nov 24 '24

Android Android Deep Linking: How to programmatically trigger LINE app user search of a specific ID?

1 Upvotes

Hi, I'm developing an Android app to creates deep link into the LINE messaging app to search a specific user

Current implementation:

val searchIntent = Intent(Intent.ACTION_VIEW).apply {
    data = Uri.parse("https://line.me/R/nv/addFriends")
    `package` = "jp.naver.line.android"
    addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
startActivity(searchIntent)

This successfully opens LINE's Add Friends screen, but I need to automatically trigger the search with a specific ID.

What I've tried:

  1. Direct profile URL:

Uri.parse("https://line.me/R/ti/p/%40${encodedId}")

2. Search endpoint with parameters:

Uri.parse("https://line.me/R/nv/searchId")
putExtra("id", searchId)

3. Recommended format from LINE docs:

Uri.parse("https://line.me/R/ti/p/%40userid%C2%A0and%C2%A0https://line.me/R/nv/recommendOA/%40userid")

All attempts either:

  • Show "check whether link is correct" error

  • Open LINE but don't trigger search

  • Open wrong screen

Environment:

  • Android 14

  • LINE app latest version

  • Testing on physical device

Is there a correct URL scheme or intent extra to programmatically trigger LINE's user search?


r/stackoverflow • • Nov 16 '24

Javascript Morphing SVG with FLubber and Framer Motion

1 Upvotes

I tried to morph 2 SVGs with Flubber on click with Framer motion, it worked, but not as expected.

The first click on the 'Hi" div triggered a change in the open state from 0 to 1, but it didn't animate the SVG. Another click event on the div did. But now the 'open' and 'progress' are not in sync.

Here's the codesandbox link to demonstrate my working code:
https://codesandbox.io/p/sandbox/framer-motion-morphsvg-example-forked-mhxl33?file=%2Fsrc%2FApp.tsx%3A12%2C24

How can I solve this?

Thanks in advance...


r/stackoverflow • • Nov 13 '24

Javascript Invoke function on mouse over with framer motion

1 Upvotes

I'm trying to recreate the following codepen with framer motion:

https://codepen.io/Hyperplexed/pen/rNrJgrd?editors=0010

It doesn't animate, and I think the ref is not used by the function or framer motion.

The code is on the following stackoverflow link:

https://stackoverflow.com/questions/79184014/invoke-function-on-mouse-over-with-framer-motion


r/stackoverflow • • Nov 04 '24

Question Heroku alternatives

1 Upvotes

I have question about selling API's. Does somebody of you know alternatives for Heroku? I try to upload my API on the rapidAPI, but i need to host it somewhere, and the only site that i know is Heroku, but they are requiring a credit card, which i don't have. I would be happy if somebody can help me with alternatives:) Have a great day!


r/stackoverflow • • Nov 03 '24

Question Deadlock due to low reputation?

1 Upvotes

I have a problem with my Stack Overflow account, where I feel I'm in a deadlock and it's about to solve this longstanding problem. My reputation is at 5, so I cannot do anything. I can't answer, can't comment and even can't vote. Is it a true deadend or am I overseeing something?

I already consulted the help pages and ChatGPT, however they suggest things like voting and commenting, which I simply am not allowed to do.


r/stackoverflow • • Oct 29 '24

Question I need a technique that makes two programs perform a specific function if they are connected

1 Upvotes

This is a project. We are supposed to make a program with two interfaces:

Admin interface

User interface, and there are many of them.

The user is supposed to be allowed to have a function in his account, but he will not be able to do it, only works if it is geographically close to the admin (a meeting room, for example).

I need a technique or feature that is: the admin account works as a radar and when users enter its range, the specific function is opened automatically.

Are there any techniques that can do this?


r/stackoverflow • • Oct 23 '24

Question If you think that one of the moderator is on the main site is a problem, what do you do?

1 Upvotes

I know about meta. The general response over there, if you complain, is a lot of downvotes and yelling. It feels very inclusionary.

But I've run into a problem with a moderator twice now and it's very frustrating.

Edit: ugh typo in the headline. Oh well I think you get the idea


r/stackoverflow • • Oct 23 '24

Question (NOOB) looking for a script (?) that automatically fills AND submits data sequentially from a libreoffice calc compatible file type

1 Upvotes

Title pretty much explains it all! I'm a biologist and have NO clue how internet stuff works lol. I would like to block VERY long lists of blogs on tumblr. There is a place on the website you can paste a blog title to block. How to I automate this so I can block thousands of blogs without having to manually do it?

Thank you!


r/stackoverflow • • Oct 18 '24

Java curso de java gratis donde lo puedo encontrar que sea bueno porfavor

1 Upvotes

?


r/stackoverflow • • Oct 18 '24

Question Please suggest a python course for a beginner

1 Upvotes

r/stackoverflow • • Oct 17 '24

Javascript How to collect an embedded Youtube Video link for my API

1 Upvotes

I'm new to web development (Javascript, HTML, CSS) and I am making a personal use API, and a website to show it off

One idea I have is a list of media followed by a description below said media, most are images but some are videos.

How do I implement the links to said video URL into my API's object so that it will simply be pulled in and assorted like the image URLs are when I set the src to the link?

Should I use a direct link? (https://www.youtube.com/watch?v=Ly36Bkmamt8)

Or is the embedded link enough? (https://www.youtube.com/embed/Ly36Bkmamt8?si=4omTI2QhfzVJDNuM)

Do I have to delve into youtube's API to do this?


r/stackoverflow • • Oct 17 '24

Question socket.io help -- understanding how socket connections work between tabs

1 Upvotes

TLDR I'm trying to understand how sockets behave between tabs and how to not have two connections at the same time on two different tabs for the same application.

I have a React application. When I successfully log into my application, I hit a useEffect which establishes a socket connection. This is in my routes component.

useEffect() => {
    if (auth) {
      socketService.connect();
      socketService.onMessage(...callback function)
    }
  }, [auth]);

I then need to navigate to another component within this application, but I can only do so via url (there is no internal navigation on purpose).

When I do this, I need to be hooked up to the onMessage callback above as well as join a room / listen for messages in this new component.

Component via URL navigation:

useEffect(() => {
**ISSUE: this room is never joined, because no socketService connection is established in this new tab. Why?**
    socketService.joinRoom(windowQueueRoom);
    socketService.onMessage(...callback function);
  }, []);

If I socketService.connect() in this (^) useEffect, a second connection is established in addition to the connection established in my routes file.

Original stack overflow post


r/stackoverflow • • Oct 10 '24

Other code Help with bash scripting

1 Upvotes

I am new with bash scripting, i have a behaviour that I dont understand.

I have a variable INCR=3 Then in a function that i use, i have a for loop for ((i = 0; i < max; i = i + $INCR)) {do stuff}

I dont know why but it seems like that the loop increments the INCR variable. So i defined It as readonly so It doesnt change, but still i wonder why It does that (infact now i am getting the warning INCR: readonly variable)


r/stackoverflow • • Oct 06 '24

Python Create a plot with a different colour for each year using Pandas

1 Upvotes
import pandas as pd
import matplotlib.pyplot as plt


columns = [
        "LOCAL_DATE",
        "MEAN_TEMPERATURE",
    ]


df = pd.read_csv("climate-daily-clean.csv", usecols=columns, index_col = 0, parse_dates=['LOCAL_DATE'])
monthly_average = pd.DataFrame((df.groupby(pd.Grouper(freq='ME'))['MEAN_TEMPERATURE']
           .mean()
           .rename_axis(index=['year-month'],)
           .reset_index()))
print(monthly_average)

I have a CSV file with local climate data from 1883 to present and I want to be able to graph each year separately. One complication I have is there's no data for Feb 1889 to Dec 1897 and a couple days there and there over the years. This is my code so far and my data looks like this

year-month MEAN_TEMPERATURE

0 1883-12-31 -17.387097

1 1884-01-31 -21.093548

2 1884-02-29 -24.020690

3 1884-03-31 -12.774194

4 1884-04-30 0.506667

... ... ...

1685 2024-05-31 10.690323

1686 2024-06-30 13.740000

1687 2024-07-31 20.477419

1688 2024-08-31 19.117742

1689 2024-09-30 16.451064


r/stackoverflow • • Oct 05 '24

Question What is the hyperlink to the modal window "Войти" in this page?

1 Upvotes

Page: mybook.ru


r/stackoverflow • • Oct 04 '24

Android Galaxy A14G - Camera video feedback different than captured photo

1 Upvotes

Hi All,

I'm working on a web app that uses WebRTC to capture video from a cellphone camera. I've noticed a color accuracy issue on A14G devices. In low-light conditions, the camera's video preview appears significantly duller than the actual captured images. For instance, a photo with four distinct green, blue, red, and light pink dots shows vibrant colors, while the video feed portrays them as muted, especially the light pink which appears completely gray. This problem persists with automatic settings enabled. However, manually adjusting the ISO improves the video preview. I've tested other phones with identical settings (ISO, shutter, white balance, etc.), but only the A14G exhibits this color inaccuracy. Has anyone else experienced this issue, and if so, how did you resolve it?

Thanks.


r/stackoverflow • • Oct 04 '24

Question PDF flattening with hyperlinks intact

1 Upvotes

Hi all,

I've created a file in a WYSIWYG editor (Canva), which contains loads of images and other graphic design elements. Hence, it is very big in file size, when I export it to pdf. The site offers the option to flatten the pdf for me, but this also leaves the included hyperlinks not working. So do other flattening or compression tools I've tried.

I have researched different pdf modification tools (e.g. imagemagick, pdf24 and qpdf) and could not find one that provides options on what to flatten. I also read different git issues and stackoverflow questions on similar topics (mostly annotations) but did not find an answer that solved this.

Does anyone know of a tool (preferably linux command line, but I'm open to other solutions), that lets you partially flatten or otherwise compress a pdf, so that all the image layers will be flattened to one, but interactive fields like hyperlinks stay intact? Ideally, it would also have an option to keep the text as a seperate layer, so that it can still be marked, copied and pasted, but this is optional.

Thanks in advance!


r/stackoverflow • • Sep 20 '24

Question stackoverflow.com blocked at CloudFlare bot detection?

1 Upvotes

anyone facing this issue?

Not able to enter stackoverflow as it just loop at asking "Verify you are human"


r/stackoverflow • • Sep 19 '24

C# A Modern Way to Create Value Objects to Solve Primitive Obsession in .NET

1 Upvotes

Primitive obsession is a tendency to use basic data types to represent more complex concepts. It is a common anti-pattern that can lead to unclear code and harder-to-maintain systems.

In this blog post, I will explain to you why primitive obsession can lead to problems in your applications and how to address this issue using Value Objects in .NET.

https://antondevtips.com/blog/a-modern-way-to-create-value-objects-to-solve-primitive-obsession-in-net

Source code for blog post available


r/stackoverflow • • Sep 18 '24

Question New laptop and smartcard

1 Upvotes

Hello, I'm about to buy a new laptop and I need suggestions about two things.

  1. I will work on backend stuff like databases and python (no GPU required for data analysis). Is an HP elitebook a good choice? The one I would like to buy has a Ryzen 9 7940HS, 32 GB DDR5-SDRAM. Do you think it is enough or too much?

  2. I was also wandering if it possible to configure a smartcard to block the laptop if it not inserted. Is it something I can do on my own? If so, is there some software I can use to do that?

Thanks in advance.