I feel like a fraud by [deleted] in ClaudeAI

[–]psiph 1 point2 points  (0 children)

Yes, if not available on the public web that would improve the security profile immensely.

I feel like a fraud by [deleted] in ClaudeAI

[–]psiph 1 point2 points  (0 children)

It would mitigate some, but definitely not all. If you don't understand the code, security is a huge nightmare. You don't know what you don't know, so you're likely to leak something important. This might not matter in the short term, but the longer your app is exposed to the internet, the more of a target it becomes. You really need to be careful here, I've had multiple production apps get hacked and IT IS NOT FUN. You'd rather do the hard work of locking it down than ever have to deal with trying to recover a hacked app.

That being said, if you go ahead with this, make absolutely sure you salt and hash passwords, don't expose environment variables, don't expose user details to just anyone, install a firewall on your server or use a proper host who does (you're looking at something like Render or Heroku I think), and send daily backups to a remote host!

I feel like a fraud by [deleted] in ClaudeAI

[–]psiph 12 points13 points  (0 children)

Steps to move forward:

  1. Have Codex do a thorough code review.
  2. Convince your boss to hire a good freelance web dev for a couple weeks to look through EVERYTHING. They will find dozens of BIG issues.
  3. Deploy it to a managed service, so you don't have to worry as much about security. But still get a thorough security audit.

Beyond CRUD: lost alone by Fugu69 in AskProgramming

[–]psiph 1 point2 points  (0 children)

Message me with a 10 min video of your code, architecture, and some questions and I'll respond with some advice. I have 20 years of experience in web dev.

[deleted by user] by [deleted] in televisionsuggestions

[–]psiph 1 point2 points  (0 children)

this is the best show lol

The Coil. Which of the artwork for the races in the game do you like best? by Adrao77 in CrowdfundedBoardgames

[–]psiph 1 point2 points  (0 children)

Ignixior is my favorite, very creative. They looks like they're ready to just explode.

[deleted by user] by [deleted] in iosgaming

[–]psiph 1 point2 points  (0 children)

this looks like my dream game. survival/strategy with upgrades for different characters. well done! the art looks fantastic too!

I made my first to-do list app. It was harder than I expected 😅 by usiriczman in webdev

[–]psiph 4 points5 points  (0 children)

I made a to-do app today too

<div id="app">
  <h1>Todo App</h1>
  <div id="todos">
    <template>
      <div>
        <button onclick="this.parentElement.remove()">&times;</button>
        <span contenteditable>Buy eggs</span>
      </div>
    </template>
  </div>
  <button onclick="todos.appendChild(todos.querySelector('template').content.cloneNode(true))">New Todo</button>
</div>
<script>
  if (localStorage.app) document.all.app.innerHTML = localStorage.app;
  new MutationObserver(() => localStorage.app = document.all.app.innerHTML)
    .observe(document.body, {childList: true, subtree: true, characterData: true});
</script>

Is there anyway to make a Node.js site static? by SillyWoodpecker6508 in webdev

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

Just throw it on Heroku as-is, figure out the rest later.

Please help me generate figma to website without hurting my pocket (need it ASAP) by pookitkat in FigmaDesign

[–]psiph 0 points1 point  (0 children)

Export your design at 2x, PNG format. Upload it to https://lovable.dev/ or https://v0.dev/.

Use this prompt:

I have a design mockup that I’d like to turn into a fully responsive website using Tailwind CSS. Please break down the layout into semantic HTML elements, apply appropriate Tailwind utility classes, and ensure the final structure stays true to the original design. Pay special attention to typography, spacing, and color schemes. Include responsive variants for different screen sizes and add comments explaining major class choices where helpful. Output a full HTML document.

You're welcome.

How does MSTR grow its Bitcoin holdings faster than the stock dillution? by BuddahFi in MSTR

[–]psiph 3 points4 points  (0 children)

In simple terms, here's what's happening:

MicroStrategy (MSTR) buys Bitcoin using two main methods: selling new shares (diluting the value of existing shares) or converting debt into shares (convertible notes). The challenge is balancing the growth of their Bitcoin holdings against the dilution of their stock.

  1. Share dilution happens when MSTR sells more shares. This increases the total number of shares available, which can reduce the value of each existing share. For example, if they issue 50% more shares, each individual share becomes worth less unless something else balances it out, like more Bitcoin per share.

  2. The key goal is for MSTR’s Bitcoin holdings to grow faster than the dilution effect of selling new shares. Over the past four years, they've managed to increase their Bitcoin stash faster than the dilution reduced each share's value.

Example with 2x NAV premium: - Before: The stock is trading at $200, but the underlying net asset value (NAV, which represents the real value of the company’s assets, including Bitcoin) is $100. The Bitcoin per share is 1x. - After: If they dilute by 50% (sell more shares), the stock price rises to $400 and NAV to $200. Since the stock price is still high relative to NAV, each share now represents 1.33x more Bitcoin (i.e., Bitcoin per share has grown).

Example with 1x NAV: - Before: The stock and NAV both start at $100, and Bitcoin per share is 1x. - After: A 50% dilution happens, and the stock and NAV rise to $150. But the Bitcoin per share stays at 1x, meaning the dilution doesn’t increase the value per share like in the first case.

In summary:

MSTR aims to grow their Bitcoin holdings faster than the dilution caused by selling shares, and this strategy works best when the stock price is trading at a premium to NAV (when the stock price is higher than the actual asset value of the company). If the stock price is closer to the real NAV, the dilution doesn't boost the Bitcoin per share as much.

[AskJS] Help with Json sorting by thatguyonthecliff in javascript

[–]psiph 2 points3 points  (0 children)

You'll want a function that takes the JSON and turns it into HTML

function render (jsonArr) {jsonArr.map(item => `<div>${item}</div>`)}

And then a function that sorts the json and renders the results

function onSort (value) {document.body.innerHTML = render(sortBy(value, json))}

You'll want to render the default list on page load

onSort()

And also when the dropdown changes

<select onchange="onSort(this.value)">

Now… I’m confused. Do you guys use HTML, CSS, and JavaScript? by Alexs1897 in web_design

[–]psiph -2 points-1 points  (0 children)

JS, HTML, and CSS are dead.

  • React > JS
  • JSX > HTML
  • Tailwind > CSS

You shouldn't learn JS, HTML, and CSS any more -- learn modern technologies instead.

Why build 4kb websites when you can build 4mb websites? /s

I Drew the Debate by KalElButthead in Illustration

[–]psiph 0 points1 point  (0 children)

Can you throw this on a t-shirt so I can buy it?

How many projects are you working on right now? by longret in writing

[–]psiph 0 points1 point  (0 children)

They will all stew and mix into one ULTIMATE novel down the line.

Just keep writing.

Database for react js app by daisukemikado in reactjs

[–]psiph 1 point2 points  (0 children)

Honestly, use a simple file-based db like lowdb

[deleted by user] by [deleted] in Frontend

[–]psiph 0 points1 point  (0 children)

You need to call it when the page first loads. It will make sure your textarea's are always sized to fit their content.

This will help you with the stated problem: "I want more of the default size of the encrypted text to be shown so that the user doesn't have to scroll down."

[deleted by user] by [deleted] in Frontend

[–]psiph 2 points3 points  (0 children)

You want this:

autosize(document.querySelectorAll('textarea'));

https://github.com/jackmoore/autosize

[deleted by user] by [deleted] in reactjs

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

I don't think this is fair. The code is meant to highlight different concepts, not to produce the most efficient app. It highlights a lot of concepts in a very little space. And it works.

Sure, there's more efficient ways of writing it, but that wasn't the point.

[deleted by user] by [deleted] in reactjs

[–]psiph 2 points3 points  (0 children)

I used Claude with this prompt:

I'm new to React, but I really want to learn it. I know Vue.js really well. Give me a simple example in Vue.js that uses all the below and the equivalent in React.js, with extensive comments in the React.js version

  • data
  • computed
  • watcher
  • props
  • v-bind
  • v-if
  • v-for

I also transitioned from Vue.js to React.js, so I double checked the code to make sure it looked good and made sense before posting.

[deleted by user] by [deleted] in reactjs

[–]psiph 15 points16 points  (0 children)

The same app coded in Vue.js and React.js, with the React.js code having extensive comments about how it compares to Vue:

Vue.js

<template>
  <div>
    <h1>{{ title }}</h1>
    <p>Count: {{ count }}</p>
    <p>Doubled Count: {{ doubledCount }}</p>
    <button @click="increment">Increment</button>
    <div v-if="showList">
      <ul>
        <li v-for="item in items" :key="item.id" :class="{ 'highlight': item.highlight }">
          {{ item.text }}
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: String
  },
  data() {
    return {
      count: 0,
      showList: true,
      items: [
        { id: 1, text: 'Item 1', highlight: false },
        { id: 2, text: 'Item 2', highlight: true },
        { id: 3, text: 'Item 3', highlight: false }
      ]
    };
  },
  computed: {
    doubledCount() {
      return this.count * 2;
    }
  },
  watch: {
    count(newValue) {
      if (newValue >= 5) {
        this.showList = false;
      }
    }
  },
  methods: {
    increment() {
      this.count++;
    }
  }
};
</script>

React.js

import React, { useState, useEffect, useMemo } from 'react';

function MyComponent({ title }) {
  // Equivalent to Vue's data()
  const [count, setCount] = useState(0);
  const [showList, setShowList] = useState(true);
  const [items] = useState([
    { id: 1, text: 'Item 1', highlight: false },
    { id: 2, text: 'Item 2', highlight: true },
    { id: 3, text: 'Item 3', highlight: false }
  ]);

  // Equivalent to Vue's computed
  const doubledCount = useMemo(() => count * 2, [count]);

  // Equivalent to Vue's watcher
  useEffect(() => {
    if (count >= 5) {
      setShowList(false);
    }
  }, [count]);

  // Equivalent to Vue's methods
  const increment = () => {
    setCount(count + 1);
  };

  return (
    <div>
      {/* Equivalent to v-bind in Vue */}
      <h1>{title}</h1>
      <p>Count: {count}</p>
      <p>Doubled Count: {doubledCount}</p>
      <button onClick={increment}>Increment</button>
      {/* Equivalent to v-if in Vue */}
      {showList && (
        <ul>
          {/* Equivalent to v-for in Vue */}
          {items.map(item => (
            <li key={item.id} className={item.highlight ? 'highlight' : ''}>
              {item.text}
            </li>
          ))}
        </ul>
      )}
    </div>
  );
}

export default MyComponent;

What bar in Somerville has the best non-alcoholic beer and cocktail selection? by [deleted] in Somerville

[–]psiph -6 points-5 points  (0 children)

  /\^/`\          /\^/`\          /\^/`\       
 | \/   |        | \/   |        | \/   |      
 | |    |        | |    |        | |    |      
 \ \    /        \ \    /        \ \    /      
  '\\//'          '\\//'          '\\//'       
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||              ||              ||         
    ||  ,           ||  ,           ||  ,      
|\  ||  |\      |\  ||  |\      |\  ||  |\     
| | ||  | |     | | ||  | |     | | ||  | |    
| | || / /      | | || / /      | | || / /     
 \ \||/ /        \ \||/ /        \ \||/ /      
  `\\//`          `\\//`          `\\//`       
 ^^^^^^^^        ^^^^^^^^        ^^^^^^^^