Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 10-17-2018, 01:01 AM   #35801
PJo336
THRILLHOUSE!
 
PJo336's Avatar
 
Join Date: Mar 2007
Posts: 21,657
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by RustyBrooks View Post
Woah, youtube appears to be hard down world wide for at least the last half hour or so.
How could this happen? Surely they're multi region? Must be a hell of a story...
PJo336 is offline   Reply With Quote
Old 10-17-2018, 02:11 AM   #35802
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

People who do all their stuff on AWS - how do you create intranets, monitoring sites, dev/test environments and static sites that can only be accessed locally and you don't want to expose to the internet?

I can limit S3 to IP addresses. But I can't get HTTPS worknig with just S3 static webhosting.

Cloudfront->S3 handles the HTTPS part, but it seems to ignore static IP restriction. Also Cloudfront is sooo slow to update and it caches crap forever. Terrible for dev and testing.

I managed to get API Gateway to proxy to S3 over https. But I can't figure out anyway to restrict the actual S3 bucket. It still needs to be read access for everyone in the world for my API Gateway proxy to work. Whatever IP API Gateway is sending it's not my source IP. Also w/o a custom domain (CloudFront again) API Gateway adds /{stage} to all its urls - which is hacky to work around.

There has to be some way to do this.

I could proxy all the way to lambda I guess and then give lambda programmatic access to S3. Still have to deal with the path-appending in API gateway though - which screws with static sites. But maybe the Cloudfront custom domain would only act as a DNS pointer and not try to cash everything. Hmmm.

Last edited by suzzer99; 10-17-2018 at 02:23 AM.
suzzer99 is offline   Reply With Quote
Old 10-17-2018, 03:14 PM   #35803
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Ok well I got it working more or less the way I want.
  1. Restrict access to s3 bucket to only cloudfront
  2. Turn off caching in cloudfront by setting the TTLs to 0 - this made a gigantic difference
  3. Add in a WAF and restrict access to cloudfront by IP there.

No idea how much extra this is going to cost us just for dev/internal sites. But YOLO.
suzzer99 is offline   Reply With Quote
Old 10-17-2018, 03:17 PM   #35804
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 28,686
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Craggoo View Post
How would you guys read this situation:

A company that's been around for 14 years, been profitable for the last 10, and has 40 employees? Most companies are all about growth so it seems really weird to me that a company would stay that small for that long.


Probably a good place to work, but management probably lacks ambition or the product is really niche.
jmakin is online now   Reply With Quote
Old 10-17-2018, 03:54 PM   #35805
iversonian
Carpal \'Tunnel
 
iversonian's Avatar
 
Join Date: Sep 2003
Location: Donkversonian
Posts: 20,541
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

People make a big deal about companies like basecamp that are happy to stay small. I’m of the mind that those are anomalies, and that everything in the world is either growing or dying.
iversonian is offline   Reply With Quote
Old 10-17-2018, 04:43 PM   #35806
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

On a civilization timescale - sure. But on a human timescale I think there's something to be said for just carving out a niche and being comfortable there. If humans lived forever I might feel differently. But it's not too hard to live your lifetime in a comfy spot that isn't growing or dying.

I've always thought one of the nice things about Kansas City is that it doesn't seem to grow or shrink. So it's not always having growing pains, nor is it a depressing wasteland. I assume people in Tuscany or Provence feel the same. Not gonna die but they sure don't want to grow.
suzzer99 is offline   Reply With Quote
Old 10-17-2018, 10:04 PM   #35807
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Is this a legit use case for var (in react)? let or const puts it out of scope. I want it to be null if I don't have any yet.

Code:
render () {

    if (this.state.signaturesValidated) {
      var validationResults = (
        <p>{this.state.idTokenSigValidMsg}</p>
      )
    }

    return (
      <div className="Main">
          {validationResults}
      </div>
    )
}
suzzer99 is offline   Reply With Quote
Old 10-17-2018, 10:12 PM   #35808
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,901
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

use let at the render() level? What do you want to return when !signaturesValidated?
let validationResults = whateverthatis
as the first line
RustyBrooks is offline   Reply With Quote
Old 10-17-2018, 10:24 PM   #35809
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 12,758
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

edit: as Rusty said

Idk seems like one would just use let above the if block to scope it suitably? (untested)
Code:
render () {
    let validationResults = null
    if (this.state.signaturesValidated) {
      validationResults = (
        <p>{this.state.idTokenSigValidMsg}</p>
      )
    }

    return (
      <div className="Main">
          {validationResults}
      </div>
    )
}
Though I think it can all be reduced to just this? (no variables, also untested)
Code:
render() {
    return <div className="Main">{this.state.signaturesValidated ? <p>{this.state.idTokenSigValidMsg}</p> : null}</div>
}
_dave_ is offline   Reply With Quote
Old 10-17-2018, 10:27 PM   #35810
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: It is pitch black.
Posts: 5,343
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Is this a legit use case for var (in react)? let or const puts it out of scope. I want it to be null if I don't have any yet.

Code:
render () {

    if (this.state.signaturesValidated) {
      var validationResults = (
        <p>{this.state.idTokenSigValidMsg}</p>
      )
    }

    return (
      <div className="Main">
          {validationResults}
      </div>
    )
}
yikes

Code:
render() {

    return this.state.signaturesValidated ? <div className="Main"><p>{this.state.idTokenSigValidMsg}</p></div> : <div className="Main" />
}
Grue is offline   Reply With Quote
Old 10-17-2018, 10:37 PM   #35811
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,522
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

^that
Larry Legend is offline   Reply With Quote
Old Yesterday, 12:37 AM   #35812
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

It's part of a larger template. I just simplified it.
suzzer99 is offline   Reply With Quote
Old Yesterday, 12:39 AM   #35813
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by _dave_ View Post
edit: as Rusty said

Idk seems like one would just use let above the if block to scope it suitably? (untested)
Code:
render () {
    let validationResults = null
    if (this.state.signaturesValidated) {
      validationResults = (
        <p>{this.state.idTokenSigValidMsg}</p>
      )
    }

    return (
      <div className="Main">
          {validationResults}
      </div>
    )
}
Yeah that works and is obviously the way I'd normally code. But I think it's kinda cool how react will just show nothing and not barf for null/undefined. So why bother declaring it outside the if condition?
suzzer99 is offline   Reply With Quote
Old Today, 02:00 AM   #35814
Barrin6
Carpal \'Tunnel
 
Barrin6's Avatar
 
Join Date: Dec 2005
Location: beyond legal blindness
Posts: 6,835
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Work started a CTF since it’s security awareness month. And it has been soo fun and addicting. I shamelessly have been doing no work and instead working on the challenges.
Barrin6 is offline   Reply With Quote
Old Today, 02:34 AM   #35815
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,700
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I came up with a way to implement component-based architecture in react that similar to my OS node frameworks.

Key principles:
  1. Components should define their own routes internally (/signin, /cool/stuff, /, etc).
  2. Components are auto-discovered, if they're in the right folder they just work, no extra configuration.
  3. Components can be moved, renamed, or deleted w/o any extra configuration or breaking anything in the app (except for any links that point to them of course).
  4. All supporting files like CSS files, test files, JSX files, stubs, etc. - live with the component.

It just makes development more fun imo when you don't have to go and register your routes in 5 different places just for your components to work. And it removes all friction from reorganizing or renaming - which is a good thing.

Just copy a component that's similar and go. Need to rename? No problem. A group of components is growing too big and you want to put it in a subfolder? No problem. Just move stuff into a subfolder and everything still works w/o any extra configuration.

Last edited by suzzer99; Today at 02:42 AM.
suzzer99 is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 04:06 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online