Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Dominoes
Sep 20, 2007

Might do that; keeping dist off the repo seems more elegant, but perhaps Heroku's use of the repo to deploy might counter this. I'm going through my files cleaning up the TS errors (some legit errors in my code, some TS being dumb... I miss Python's static type checker...); will post results after.

Related; more of a JS question. TS raises errors when setting globals from another module; apparently this is part of the ES6 import spec. Is the easiest workaround exporting setter funcs? (You can just set the vars and the code works; TS just doesn't like it / it's noncompliant with ES6)

Dominoes fucked around with this message at 20:23 on Apr 11, 2017

Adbot
ADBOT LOVES YOU

Dominoes
Sep 20, 2007

Dominoes posted:

will post results after.
No luck; can get heroku to post valid console out from webpack that looks right, but the browser can't find the bundles; recommitted dist.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Dominoes posted:

No luck; can get heroku to post valid console out from webpack that looks right, but the browser can't find the bundles; recommitted dist.

Sounds like your static files setup is misconfigured.

Dominoes
Sep 20, 2007

Thermopyle posted:

Sounds like your static files setup is misconfigured.
Prob; I'm usting dj-static with its recommended config and have no intention of messing with it; what a nightmare!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Django static files on heroku are very easy if you just do this: http://w4t.pw/1ycabe

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Passing on a recommendation here: https://www.gitbook.com/book/frontendmasters/front-end-handbook-2017/details

It's an e-book that is basically a huge list of links to other websites (videos, courses, and articles; both paid and free) sorted by topic for everything you'll ever need to learn about front-end stuff. It has like 10~20 links to resources for every topic.

Space Kablooey
May 6, 2009


Love Stole the Day posted:

Passing on a recommendation here: https://www.gitbook.com/book/frontendmasters/front-end-handbook-2017/details

It's an e-book that is basically a huge list of links to other websites (videos, courses, and articles; both paid and free) sorted by topic for everything you'll ever need to learn about front-end stuff. It has like 10~20 links to resources for every topic.

This looks like an interesting read, thanks!

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Love Stole the Day posted:

Passing on a recommendation here: https://www.gitbook.com/book/frontendmasters/front-end-handbook-2017/details

It's an e-book that is basically a huge list of links to other websites (videos, courses, and articles; both paid and free) sorted by topic for everything you'll ever need to learn about front-end stuff. It has like 10~20 links to resources for every topic.

bookmarked!

e: or downloaded whatever

BlackMK4
Aug 23, 2006

wat.
Megamarm
Is this the proper place to get a gut check on my scaling plans?

Mush Man
Jun 25, 2010

Nintendo announces Frolf means Frog Golf.
Oven Wrangler
I have a problem where running a very long script prevents users from loading any other pages until it finishes. A PHP script calls on wkHTMLtoPDF to render a series of customisable web templates and download a single file when complete.

It can take more than ten seconds to render each template. So for a forty page document, the script can run for about five minutes before the download is ready. This wouldn't be a big deal if people could still navigate and use the website while waiting. For instance, if you click download, then open a new tab, it'll stay blank with the loading spinner until the PDF finalises and then the new page will load instantly.

The problem is I don't know why this happens. I've tried searching but am a bit in the dark to what keywords I should use, because none of the results match my problem, let alone hint at a solution. Happy to provide more details. What am I doing wrong?

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India
Why not run the script in a separate worker?

Mush Man
Jun 25, 2010

Nintendo announces Frolf means Frog Golf.
Oven Wrangler
I'm unaware about PHP workers. Regardless, I was lucky and found the solution shortly after posting. It was due to PHP session locking. Calling session_write_close() before the script does any heavy processing makes everything responsive as expected. Thanks though!

ProperCauldron
Oct 11, 2004

nah chill
Question about SharePoint Online:

There's a page I've been asked to fix that has a Web Part with several tabs. One tab's text populates to all the other tabs. Does anyone have an idea why that'd be happening? I spent a few hours trying many different edits and the problem wouldn't stop. Any insights?

The Fool
Oct 16, 2003


ProperCoochie posted:

Question about SharePoint Online:

There's a page I've been asked to fix that has a Web Part with several tabs. One tab's text populates to all the other tabs. Does anyone have an idea why that'd be happening? I spent a few hours trying many different edits and the problem wouldn't stop. Any insights?

Totes not enough info

sorry

lunar detritus
May 6, 2009


Is there a standard for database setup in node environments?

Most of my experience has been with mongo (which allows you to just throw crap at it and it'll work) and Rails which has a nice db:setup/migrate thing going on.

Chron
Dec 24, 2000

Forum Absurdist

gmq posted:

Is there a standard for database setup in node environments?

Most of my experience has been with mongo (which allows you to just throw crap at it and it'll work) and Rails which has a nice db:setup/migrate thing going on.

Nope. Node, afaik, doesn't have a database module in its standard library. There are modules for every kind of db you could think of though.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

gmq posted:

Is there a standard for database setup in node environments?

Most of my experience has been with mongo (which allows you to just throw crap at it and it'll work) and Rails which has a nice db:setup/migrate thing going on.

One of my contract jobs used http://knexjs.org to try and get away from having all data in nosql and has had decent results. Has migrations plus query building, so it's not an ORM, probs worth a shot.

ProperCauldron
Oct 11, 2004

nah chill

The Fool posted:

Totes not enough info

sorry

THANKS FOR NUTHIN. No but really, I wasn't sure what to share or not. I did resolve the issue so I'm happy. To contribute: I swear I tried this and variations of this previously but the main problem was the id="tabs-9" not correlating across all the code. I had to connect the code for the tabs navigation and the tab content.

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

I'm about 6 hours deep into trying to fix this one bug and thought I'd better ask for help...

I am trying to implement a mobile push menu based on this article. The problem I'm having is the further down you scroll on mobile (the phone only, not in the simulator) the slide out menu also gets displaced. So by the time you've scrolled all the way down to the bottom the slide out menu is off by a few hundred pixels or so. Page is here. The Codrops example doesn't have this problem so it must be some combination of styles and structure specific to my page... Any ideas would be very much appreciated.


Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

awesomeolion posted:

I'm about 6 hours deep into trying to fix this one bug and thought I'd better ask for help...

I am trying to implement a mobile push menu based on this article. The problem I'm having is the further down you scroll on mobile (the phone only, not in the simulator) the slide out menu also gets displaced. So by the time you've scrolled all the way down to the bottom the slide out menu is off by a few hundred pixels or so. Page is here. The Codrops example doesn't have this problem so it must be some combination of styles and structure specific to my page... Any ideas would be very much appreciated.




Is position fixed, not relative or absolute?

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

Lumpy posted:

Is position fixed, not relative or absolute?

The position of the slide out container is fixed (all styles on the slide out container below).

code:
    min-height: 100% !important;
    position: fixed !important;
    top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
    z-index: 0 !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    box-sizing: border-box;

NewForumSoftware
Oct 8, 2016

by Lowtax
jesus that is some hellish css

at least just do padding:0 you animal

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

NewForumSoftware posted:

jesus that is some hellish css

at least just do padding:0 you animal

I was debating whether or not to explain my mess. I've been throwing all kinds of crap at this trying to get it to stop moving around. That's how I arrived at this hellish state please understand...

fuf
Sep 12, 2004

haha
Is there a way to go from a side-by-side tabbed layout like this on desktop:



to a stacked layout like this on mobile:



with just CSS? Sorry for my terrible mockup.

I can't figure out if there's a way to go from:

code:
Header     Header
Content
Content
to
code:
Header
Content
Header
Content
without also having to change the HTML.

Sergeant Rock
Apr 28, 2002

"... call the expert at kissing and stuff..."
Either display:grid, with a media query, or display:flex (with a media query that changes 'order') can do that.

Which you use depends on your required browser support.

fuf
Sep 12, 2004

haha
Nice, thanks.

So many of my CSS issues would be solved if I just loving updated my 15 year old knowledge and learnt poo poo like display: flex properly.

kedo
Nov 27, 2007

You could also do it with floats and/or positioning and setting things to display none/block.

fuf
Sep 12, 2004

haha

kedo posted:

You could also do it with floats and/or positioning and setting things to display none/block.

Oh hey you're right. I think I figured something out by making the tab content position:absolute on desktop and position:relative on mobile. Thanks.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

You've found your solution, and it's probably a better one, but I did a similar thing with CSS3 columns. Might not work for you because I was going from 3 on desktop to 2 on mobile but thought I'd throw it out there.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

fuf posted:

Nice, thanks.

So many of my CSS issues would be solved if I just loving updated my 15 year old knowledge and learnt poo poo like display: flex properly.

Yeah flex layout is supported enough now to be well worth your time learning. But I know how you feel, I only took the time to do so recently myself.

Sergeant Rock
Apr 28, 2002

"... call the expert at kissing and stuff..."
I would agree with that. Layout via float and absolute positioning is really nasty, bodgy and prone to breaking horribly, especially with resolution changes. Neither method was intended to be used to solve a problem like this.

Flexbox and grid are *the* standards for layout.

fuf
Sep 12, 2004

haha
Yeah I went back to the flexbox solution in the end, it works really well.

Thanks for all the input.

Pollyanna
Mar 5, 2005

Milk's on them.


I'm dealing with a situation where our input fields are stupid long and it turned out to be a duplicated/superseding class because of some dumb merge conflict and I want to die because I couldn't figure out the problem no matter what I did.

Maleh-Vor
Oct 26, 2003

Artificial difficulty.
I'm a Web Designer, and we're working on a pretty big project in Drupal. The company that's in charge of development has been lacking the bandwidth for the dozens of little design edits we keep requesting, so I offered to help them out a bit and got a git repo.
The CSS is fine, but everything is in Twig. I don't know PHP but can kind of understand what I've been looking at so far, and Twig looks simple enough where I could easily rip it out and leave it as HTML, but it's a pretty large volume of files to do so manually. I'd rather just have a PHP file where I can change the Twig file that's printed and the placeholder variables I send it so I can display it on a browser and get poo poo done. Is there any easy way to set this up? I just want to fix all these spacing and sizing errors and would like to see what I'm doing :negative:

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Dumb question:

A long time ago I learned about the Singleton design pattern in the context of "never do this!!!1" but recently as I learn more and see examples of React stuff and MERN projects and tutorials I notice that everything seems to be doing that same scary Singleton design pattern (i.e. everything or almost everything contained in a <App /> DOM element or whatever). Is there a reason for this? Is it really a best practice somehow? Because up to now I have always been told that the Singleton thing is never necessary, albeit in a different context.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I wouldn't call it a best practice as much as a here's how we settled on doing it this way thing. React apps are a bit weird though because well designed it ends up being just a stack of functional components technically. Functional components dot really mean the same concept of a singleton, because they just get composed into something bigger, usually your <App> at the end, but there are a lot of implementation details that can get hidden on the way to such a set up.

Personally with my most recent project I've been looking to keep React from being my top level component, so I've got more flexibility to plug in another view renderer in certain cases or just make it easier to offload common functionality to libraries rather than force myself into depending on the React ecosystem for every little thing.

I think the thing to remember though is many of these libraries need to be demonstrated in simple ways, and that usually means singletons that illustrate the concept rather than complex software patterns. JavaScript is so permissive and flexible that you really can structure your program however you like, but that's both good and bad. If you write your code to work more like functional transforms than objects with state though, you can throw out a bunch OOP principles because of the guarantees and testability a functional style can give you.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Speaking of great programming ideas I read a summary of what this guy is doing 2 days ago but didn't look in depth:
https://github.com/Michaelkielstra/Object-oriented-HTML

He says he's made an HTML pre-processor that adds OOP to HTML. Any of you guys heard of it?

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Scaramouche posted:

Speaking of great programming ideas I read a summary of what this guy is doing 2 days ago but didn't look in depth:
https://github.com/Michaelkielstra/Object-oriented-HTML

He says he's made an HTML pre-processor that adds OOP to HTML. Any of you guys heard of it?

Sounds like what Angular and React are doing, but on the server side and crappier.

Warbird
May 23, 2012

America's Favorite Dumbass

Anyone here use Velocity for Windows? Would you recommend paying for it vs something like Zeal or DevDocs? I know there's a WinRAR style trial for Velocity, but I'm curious if there's any appreciable differences between the programs.

Adbot
ADBOT LOVES YOU

Odette
Mar 19, 2011

Warbird posted:

Anyone here use Velocity for Windows? Would you recommend paying for it vs something like Zeal or DevDocs? I know there's a WinRAR style trial for Velocity, but I'm curious if there's any appreciable differences between the programs.

Velocity & Zeal both use Dash's API docs, so what's the point in paying for Velocity when Zeal is free? I use Zeal all the time on my Windows/Linux boxes and it's great.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply