jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS 3v4l.org/ - Use this and post a link, if you need help with PHP/HackLang
I'm going to be working on a social media business.
I'm going to use command line tools to create graphical content that businesses can post to social media. My idea is similar to quoteworkshop.com/#pricing
Where I make tools to mass produce content. I will then look on instagram for a company that posts freqneuntly. I will make 100 branded images for them, post them to a website. Share the link with them and offer to sell them the unwatermarked versions for ~$150.
Ryder Thomas
i made the previous 5 threads, i came back home to find the previous one archived so i made this, didn't notice that someone made it, sorry i guess ?
Connor Walker
Yours is better, the thumbnail helps identification in the catalogue. I will post here.
Carson Clark
delete it
Joseph Martin
Just startted a webdev course, what exactly is the point of php? And why not python or js?
Adrian Scott
The point of php is to be irrelevant.
Out of all the scripting languages it was literally born to fill a void, becoming a jack of all trades, now better stuff has come along that specialize in certain fields and the time has come to take php out back.
But yeah technically it's a server side scripting language, it compiles automagically whenever you edit the source and is meant to handle and process incomming requests on your page like forms, logins etc. If you want to give it a spin try WAMP or LAMP if that shit is still around.
Michael Bell
>WAMP or LAMP if that shit is still around it is
Ethan Mitchell
Anons, how do I get svg to maintain their aspect ratio when the browser is resized in a CSS grid.
Here is and example, to picture is a .svg and bottom is a png. When you shrink the browser the png maintains it's aspect ratio while the svg shrinks.
Why does everybody hate you so much? Is it you or your preference of programming?
Robert Barnes
promoting PHP + being a namefag, two in one
Evan Sullivan
not everybody hates him though
Benjamin Collins
What's wrong with PHP?
Nolan Anderson
These days it's pretty ok I guess, but it used to be notoriously bad, no real surprise to anyone since the developer himself said that he didn't like programming much and that he preferred quick and dirty solutions to investing time and effort.
Bonus funpost: google the following php-a-fractal-of-bad-design
Levi Baker
For a given Single Page Application, is it horrible to store state serverside?
Jordan Walker
the PHP community are improving the language after a decade of shitty code and broken functions. PHP 7 brings new stuff to the table and fix a lot of stuff in the code.
Jaxson Stewart
Have you tried using an svg element instead of an img one?
Michael Gutierrez
>svg element
Sorted it by adding the height to the html
Ian Sanders
nope
Josiah Nguyen
How is PHP these days actually? Does it do something particularly well? Or is it more for the people, who for some reason, don't want to or can't leave the PHP compound.
Cooper Edwards
Anyone here getting this warning out of nowhere while using React and React Router?
Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function
Just updated to React 16.4, I'm sure this wasn't here before
Doing this triggers it
But passing a function doesn't Hello} />
This doesn't work, though SomeComponent} />
Adam Johnson
Make sure that some-component are all valid React components.
The whole .NET framework is very enjoyable to use. C# is a good language, very common in "enterprise" environments, and the tooling is excellent (you may argue that's slow, but alt+enter-and-right-click-on-squiggles driven development is totally worth it). You'll most likely bound to use other Microsoft, proprietary tools, but if your objective is just having a decently paid job doing internal LOB system development, then it's quite nice. Don't expect hard development challenges or motivated colleagues though. In many places, they still use waterfall, and in even more, office politics is a very real thing you have to deal with.
Caleb Thomas
ASP.NET Core is good
William Davis
Ugh, people still use water fall in industry? Shy on earth isn't everyone using a modular incremental build system with groups of teams using the agile workflow? it is THE BEST way to develop projects.
Zachary Gomez
there are cases you can't use the agile workflow on everything, m8
Aiden Diaz
That's why you use a hybrid of agile and incremental, and all your sprints simply become your modular components and when you design your architecture right you give each team a sprint for a different module that needs to be developed. Straight agile kinda sucks imo, but with proper architecture and slightly more flexible sprint lengths depending on the module you are making, it rocks.
Matthew Gomez
How are webpages really made these days? I took a ‘webpage design’ class once and we basically learned how to write html but i never really felt like thats how webpages are made. It felt really incomplete. If I wanted to create webpages for small businesses around town. Whats the best method of actually doing this. What do I need to learn.
Jonathan Robinson
This is how webpages are made.
index.html
Hello World OP is always a faggot
This is a web page OP is always a faggot
top kek much lel
Nicholas Smith
You put HTML in the HTML folder You manipulate that HTML with javascript You style that HTML with CSS
Most web pages are made using wordpress or some other site generator where your job is 95% automated, and you just kind of plug in the correct info in the right spots, change some style to make it fit in properly etc.
>including html tags in the head you are lacking CSS and javascript, and don't forget the server side, php mysql for starters
Carson Walker
>not putting text in your header
Jace James
you are confusing head with header, you absolute brainlet
Jace Moore
That is where the header goes you faggot
Justin Sanders
Apologies for the noob question. What should I look into if I wish to buld a old-fashioned forum system running on Node? Maybe an imageboard system perhaps, like Jow Forums. A good ol' CRUD application. Not with PHP in any way, but with JavaScript. Like how do I use SQL with Node, and what npm packages should I look into installing?
oh and the body isn't some structure tag, body is what encloses everything like header nav main and footer
like:
This is a web page OP is always a faggot
top kek much lel
Xavier Ward
I've run into a difficult problem. I have these objects from a JS library I'm using client-side that require configurations that depend on calculations from data server-side. What I want to do is somehow configure those objects server-side then simply create the object client-side. So basically do all those nasty calculations on the server before I even serve the page, then send down the configurations in a way that on the client-side I can just create the object and attach it to an element. How do I accomplish this? No frameworks. Vanilla JS on client, PHP on server.
accidentally fucked up with npm publishing some changes (package.json had a private package set to file:../{{local_dir}} instead of the npm version and we accidentally published it as that, it got corrected but shit man)
ajax call to a php script that does the calculations...
Asher Ross
yeah thats what I was thinking. throw a script block at the end that immediately makes an ajax call to get some json containing configurations, then create my object
Kayden Watson
>why not python or js? what's the point of using python or js ? php can have a better performance and was meant to be used for the web. >WAMP or LAMP no, just no. you don't need them, for a database, you can just use PDOSqlite ( bundled with PHP ) , for a development web server, php have its own built-in web server since 5.4. PDOSqlite :secure.php.net/manual/en/ref.pdo-sqlite.php php built-in web server : secure.php.net/manual/en/features.commandline.webserver.php see : and nothing well if you are referring to me, i never said that i don't like programming much , i love it >fractal of bad design the article is outdated, most of it is invalid nowadays, look for more recent resources please, and i will happily gone in debate over it. php now have a package manager, modern frameworks, improved security ( in 2018, it had only 11 core security issues, while java had over 45 ), you can now do async in php using swoole or a pure php implementations such as ReactPHP, AMP... etc, you can also use any of these implementation to create a http/websockets server in seconds, php engine ( zend engine ) was rewritten from the ground for php 7, its twice as fast and uses half the resources, type hinting is now a thing in php, you can also declare strict typing ( you can read more about that in the official php website ), in 7.4 php is gonna have typed properties ( see : wiki.php.net/rfc/typed_properties_v2 ), php 8 is gonna have a JIT Compiler and much more.
>well if you are referring to me, i never said that i don't like programming much , i love it He's talking about the creator of PHP, Rasmus Lerdorf, who I think said that in one interview or another.
Carson Williams
as someone who hates spending time on web design, what's the easiest CSS framework to get HTML presentable as fast as possible? bootstrap? I don't care if it looks generic as long as the result is usable.
Benjamin Parker
i don't recall rasmus saying that, but at some point ( first when php was a templating language ) he didn't like the idea adding features to it until it became a programming language, the engine at the point was a mess, until andi and zeev rewrite the engine as Zend Engine ( ze from zeev and nd from andi )
Camden Taylor
I remember installing a javascript addon for VS code a while ago that added semicolons and swapped "" for '' like import something from "something" to 'something', does anyone know the name? I formated my PC and can't find it anymore
Adrian Kelly
>implying people defend Java
Levi Jenkins
i was just giving an example for those who say php is insecure. :)
Camden Torres
bootstrap will just give you rounded corners on everything and make sure it looks kind-of-sort-of the same on every device.
define "presentable" if you want to just make a layout for one device and you don't really care about how it looks as long as it conveys the information it needs, just write the CSS yourself. Use grid and flexbox.
Austin Phillips
Anyone want a free website or web app? It has to be something cool/fun and I get to dictate the tech stack. We can chat about it over discord or Kik or something.
Robert Wilson
lol
Yes. Bootstrap or Bulma will get you there. Probably other options as well but both of them are quite popular and very supported. Also lesser known alternatives like Lit which are pretty great too. Bootstrap comes with JS, Bulma is exclusively CSS and requires you bring your own JS if you want things like carousels. But regardless, you're going to have to learn just how classes are used in each system, so like a day of getting it and you'll be good to go.
Either way, all of them will be MUCH more usable across numerous devices and browsers than running your own CSS if you hate CSS/are a backend person/etc.
Ethan Lee
why dont you just suck my dick already queer
Leo Stewart
What is the equivalent of getElementsByTagName but for css? I wanted to replace a background-image url, the script I use works for and similar tags but I can't find a way to make it work with css.
Bentley Brooks
What? >I want to replace the background-image CSS attribute for a given class No You want to change a given element's CSS class given some change in state.
Nathan Smith
That's disgusting. I'm disgusted.
Jackson Martinez
>getElementsByTagName but for css It's literally just the tag name. Doing getElementsByClassName('h1') selects the same set of elements as the CSS h1 { /* ... */ }
>I wanted to replace a background-image url What do you mean by "replace"? Are you overriding an existing CSS rule, or are you changing it when something happens?
Naturally, it doesn't work because it's a tricky element that doesn't generate an tag. This works with normal elements, I've been using this method on other sites so there should be no errors.
Overriding I guess, like above.
Brayden Phillips
dude there's a better way to do that. You could have used a hosts file to redirect to an HTTP server serving pictures of carrots You could have used a custom DNS server that routes everything to the same HTTP server
I thought about the hosts file but I'm not sure it can handle individual directories, blocking i.4cdn.org whole isn't good, all normal images will disappear too. Is it really impossible to make a regex script that looks for specific values in css files?
Caleb Perry
Thanks. didn't know about bulma, might go with that since I'm writing my own JS anyway.
Tyler Ward
>profile says im a fresh graduate why the fuck are these recruiters contacting me for senior positions? does senior not mean what it's used to?
Ohhhhh, I get it, you actually want to query the source stylesheet itself, like you would with HTML.
Yeah, that's not a thing; you can't "select" elements by what CSS they already have applied to them*. And there's no easy way to search the stylesheet itself. You'd have to load it yourself (assuming you have a same-origin exception), search through it, and regex the URLs to your own, then insert your modified stylesheet preferably directly after the spot where the original is loaded.
Anyway, this CSS works for me for removing ads on Jow Forums: .adg-rects { display: none; }
*unless it's actually inside a style attribute, but that's probably not the case
Nicholas Johnson
>there's no easy way to search the stylesheet itself. You'd have to load it yourself (assuming you have a same-origin exception), search through it, and regex I also thought of doing that but my power level just isn't high enough yet.
>adg-rects For some reason I didn't notice there was another above. Thanks, this will definitely get rid of that gross ad... I wish Hiro would keep them 2D-related at least, I just finished dinner for Pete's sake.
Maybe the job doesn't have many requirements? senior also implies graduate.
>senior also implies graduate. where do you live? I've never heard it used like this in burgerland
Asher Morris
I could be wrong, I'm ESL but in my country people refer to graduates older than oneself as seniors if they've graduated from the same branch, so technically you're a senior to all those whop will graduate after you and those that are still studying.
Ian Robinson
That's valid in some cases, like "he's senior to me" would mean that the person in question is older or has more experience than you.
But in the case of jobs, generally the fresh graduate in the workplace is one of the younger people, and therefore would be "junior" to most of his coworkers. I would say to be a senior, you have to have at least some full-time experience in the industry. And I think people putting "senior" in the job description agree with this definition at least in part.
I agree with that the recruiter is probably fucking up.
Cameron Perez
This website is fucking around with me and blocking my userscripts from working.
I've have a simple click script like this in Tampermonkey function redClick() { document.getElementById("middleTable").getElementsByClassName("red_button")[0].click(); } But it's somehow blocked by the website.
That's a lie. All of those are rendered obsolete when css grid, flex box, and media queries exist. There's no reason to ever use a css framework anymore
Dylan Turner
>somehow blocked by the website
in what way? is it the content security policy header doing it?
Caleb Smith
I'm not sure which way, this is on a testing server so they are probably experimenting with something.
All I can see is the CSS structure hasn't changed, the ID and Class names remain exactly the same. And the userscript is running, I can see it active in the Tampermonkey menu, but it doesn't have the same effect like outside of the test server. It's like the userscript is ignored.
Something wacky is going on.
Brayden Gomez
What's the proper javascript syntax/regex to grab the room name(room5) in mysite.com/r/room5
Lincoln Ramirez
>You solve a problem that you've been stuck on for a few days now Love it, bros. LOVE IT.
I would probably just do var url = 'mysite.com/r/room5'; var urlParts = url.split('/'); // ['mysite.com', 'r', 'room5'] var roomName = urlParts[urlParts.length - 1]; // last element
There's probably cleaner way to do it with regex, but whatever.
Samuel Phillips
I have to make my own microservice at work for a new product we're working on. It need to be in Python. I only know Django but is it worth learning Flask for a smaller project?
>what's the point of using python or js ? Ew no. PHP is tolerable and certainly more sane than some idiotic craplang like Java, but still sucks.
- No actual module system - Because of the above, have to package everything inside classes - ...but class variables have some kind of retarded limited initialization syntax so you can't just write your static variables freely inside the class, you gotta declare them and then specifically write an initializer function to initialize them and call it - Array vs object relationships are a hot mess. Why on earth are they the same construct? - ...and then objects and dicts (arrays) are separate constructs with different syntax, even though they're practically identical concepts and separating them provides absolutely no benefit, only inconveniences the programmer - Closures suck, you have to explicitly type the RSI-inducing &$variable atrocity for every variable you wanna capture - ...about that, how are they STILL too incompetent to get rid of the $variables? - Arrays cause PHP to shit itself if you happen to refer to a key that doesn't have a value associated with it, who knows how they thought this was a good default behavior - No actual in-built async at all
I could come up with more points too.
James Diaz
Wat do if i'm blocked by a bunch of pull requests?
I literally cannot continue my development without these PR's but my reviewers are soooooo busy and cannot set anyone else to review. They ignored me when i told them this, should i waste my time on Jow Forums?
Robert Howard
>No actual module system we have extensions, there totally 0 need for modules and php doesn't need it >Because of the above, have to package everything inside classes not really, we use namespaces, there's no need of classes. for example, take a look at this framework : github.com/leocavalcante/siler it doesn't use any OOP, it 100% functional programming here's another package : github.com/lstrojny/functional-php >class variables have some kind of retarded limited initialization syntax so you can't just write your static variables freely inside the class, you gotta declare them and then specifically write an initializer function to initialize them and call it yes, that how php works and static classes are rarely used, but there's an rfc for that : wiki.php.net/rfc/static_class_constructor i don't think its gonna be accepted and i never needed it. > Array vs object relationships are a hot mess. Why on earth are they the same construct? i don't really understand this, can you explain more ? maybe give some examples ? >and then objects and dicts (arrays) are separate constructs with different syntax, even though they're practically identical concepts and separating them provides absolutely no benefit, only inconveniences the programmer i don't see how arrays and objects in php are the same, as above, please explain more. >about that, how are they STILL too incompetent to get rid of the $variables? lets say we remove the '$' today, every website/package is not gonna work, we used to it, that's how php variables are written. its not gonna change.
...
Dominic Price
> Arrays cause PHP to shit itself if you happen to refer to a key that doesn't have a value associated with it, who knows how they thought this was a good default behavior again, i don't really understand this clearly, but i think you mean something like this : $array = [];
$a = $array['a']; // error
in this case you are referring to a key that doesn't exist, ofc its an error, but in php 7, you can always add a fallback : $array = [];
$a = $array['a'] ?? 'default value'; // same as doing this in php 5.x $a = isset($array['a']) ? $array['a'] : 'default value';
desu, i never seen someone complain about this and i don't see what else is php supposed to do, return null maybe ? ugh
>No actual in-built async at all will there's third-party packages/extensions, php needs async and i agree with you in that. that's why its coming in php 8 :) you can see this : externals.io/message/102415
Evan Sanders
i would like to add that you can do async currently in php without using a package like AMP or ReactPHP ( ps : both are written 100% in php ), just like they did it, using generators also, php have some built-in async functions for dealing with resources and mysql databases
Christopher Gonzalez
>we have extensions, there totally 0 need for modules and php doesn't need it Extensions? How are those a replacement for a normal module system where you can import code from file x and have it namespaced? >not really, we use namespaces, there's no need of classes. Far as I understand, you can't use them to define variables or complex constants? >for example, take a look at this framework : github.com/leocavalcante/siler >github.com/lstrojny/functional-php Well, looks cool on a first glance >yes, that how php works and static classes are rarely used, but there's an rfc for that : Good, maybe they could get off their asses and implement it. There's several good features I've seen they've had as RFCs for years. >i don't really understand this, can you explain more ? maybe give some examples ? php.net/manual/en/array.sorting.php Just look at this. You wouldn't need usort, uasort and uksort if you didn't introduce a pointless implicit order to array key-value pairs. It's the wrong abstraction. JS does it right by using maps in the background but exposing a regular array API to the programmer, instead of this monstrosity. >i don't see how arrays and objects in php are the same, as above, please explain more. What functionality do objects have over arrays? Why is the distinction needed? >lets say we remove the '$' today, every website/package is not gonna work, we used to it, that's how php variables are written. its not gonna change. They could make it optional.
>ofc its an error Why? Querying if a key is in a dict doesn't cause a full-blown crash in any other language. Except maybe a segfault C, but that can be forgiven since C is low-level and treats arrays as mere stack pointers, PHP is supposed to be high-level.
Like I said PHP is not bad but it's not exactly good either.
Bentley Green
>Why? Querying if a key is in a dict doesn't cause a full-blown crash in any other language. Except maybe a segfault C, but that can be forgiven since C is low-level and treats arrays as mere stack pointers, PHP is supposed to be high-level. >Just look at this. You wouldn't need usort, uasort and uksort if you didn't introduce a pointless implicit order to array key-value pairs. It's the wrong abstraction. JS does it right by using maps in the background but exposing a regular array API to the programmer, instead of this monstrosity. >Just look at this. You wouldn't need usort, uasort and uksort if you didn't introduce a pointless implicit order to array key-value pairs. It's the wrong abstraction. JS does it right by using maps in the background but exposing a regular array API to the programmer, instead of this monstrosity. ARRAYS IN PHP ARE HASHMAPS ! you can't declare constants inside arrays, you can's have methods, or at least methods visibility, you can't have namespaced variables
>They could make it optional. there 0 need for that, that's how the language syntax is. >Good, maybe they could get off their asses and implement it. There's several good features I've seen they've had as RFCs for years. all RFCs ( or most ) are already implemented, including that one, however the php internals have to vote for it, most of are involved in the modern php ecosystem and will take the community prospective on it and if it fits in the next release, currently its not gonna be accepted on php 7.3 ( php 7.3 is feature freeze now ) and not gonna be accepted on 7.4 ( 7.4 is a deprecation version, adding deprecation errors for the functions / features that are gonna be removed in the next release which is php 8 ), maybe its gonna be in php 8.0
Christopher Bailey
>Extensions? How are those a replacement for a normal module system where you can import code from file x and have it namespaced? you can packges for that, constants, classes, functions can be namespaced in php but not variables, but you can use something like a container how ever, a package can declare a variable inside the global namespace but we try to avoid messing the global namespace in php, for example in zend expressive 0 variables are declare in the global variable and the index.php looks like this :
Parker Robinson
i would like to note that 7.4 is gonna contain only 1 feature, and its the typed properties since the community kept on asking for it to be merged. wiki.php.net/rfc/typed_properties_v2
Brayden Jones
>ARRAYS IN PHP ARE HASHMAPS ! Yes and the problem is that they're ordered hashmaps, with an associated implicit key order. Makes it convoluted whether you're trying to sort an array by its values in a normal way, or change they key-value order. And then some array methods expect numeric arrays (ie lists in any other language) as arguments, others expect dicts (which are also arrays, yay).
>there 0 need for that, that's how the language syntax is. I still don't see why they hate our fingers
Now this just seems like a big mess to me. Why not just have a normal file-based module system like any modern language?
Jack Lewis
and that's 1 more thing you can't do with arrays, also php objects are passed by reference everywhere for example :
Jordan Flores
Yeah I don't actively use PHP, I just occasionally maintain a backend written in it.
I understand that you can get used to this stuff but from a semantic perspective it's just wrong and not something I can just be ok with when there are other popular languages that don't have those warts. Namely JS and Python to some extent.
Nathan Gray
will i guess php classifies more with C/C++/Java/C# than Js and python as i said, if you php developers know more about what's best for the language and its ecosystem, changes arrays behavior, adding modules and remove `$`, are not good for php in anyway or just useless ( e.g: modules ). if you were actively using php you will see how is that. your points is just like me complain why python and js don't have the same behavior as php.