/wdg/ - Web Development General

Always archived during the nights - Edition

>Getting started
Get a good understanding of HTML, CSS and JavaScript.
MDN web docs offer a good intro (independent of your browser choice)
developer.mozilla.org/en-US/docs/Learn

>Free online courses
codecademy.com/
freecodecamp.com/
bento.io/

>Roadmap
github.com/kamranahmedse/developer-roadmap

>Resources
developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
stackoverflow.com/ - Developers asking questions and helping each other
caniuse.com/ - Check browser support for front-end web technologies

>Youtube channels
youtube.com/user/TechGuyWeb - Traversy Media
youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ - freeCodeCamp
youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q - funfunfunction
youtube.com/learncodeacademy - codecademy
youtube.com/derekbanas

>in-depth comparison of VPS hosts
webstack.de/blog/e/cloud-hosting-provider-comparison-2017/

Other urls found in this thread:

codepen.io/jonnyd94/pen/eEdPje
thefastlaneforum.com/community/threads/how-to-learn-code-start-a-web-company-15k-per-month-within-9-months.69971/
codepen.io/user/pen/qXXEKg?editors=1010
amsul.ca/pickadate.js/date/
discord.gg/wdg
chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en
twitter.com/SFWRedditVideos

I want to either freelance or work a completely remote job.

What's the best thing to learn to achieve this? Right now I know basic JS and React, HTML & CSS, bit and bobs

Freelancers rules:

(+)
1) You can pretty much chose what technology you want to use. The customer woun't care if it's Elixir/Phoenix or Wordpress. It's only about the outcome.

2) You can choose when to work and when not.

3) You have no boss, you can pretty much do what you want if the result is good.


(-)
1) You have to be a one man army. You have to do your own marketing (making your own web dev website, talking to people, aquiring customers), your own management (estimating costs, make a REALISTIC schedule, talk about expectiation, negotiate about costs and handle customer problems), your own support (if you are sick for a week you simply don't earn money and nobody is gonna do your work) and probably even your own designer/front end team.

2) Design really matters. It's not just about glueing some functionality together. You have to put a lot of effort into finding youtr what the customer really want and create a good UI and UX. You have to do all this requirement engineering shit: mood boards, wireframes, make a few different approaches until your customer is satisfied..

3) Nobody is gonna save your ass. There's nobody who can help you. If the customer is not satisfied nobody is gonna get into ugly negotiations for you. If you underestimate the problem and miscalculate the costs/time, nobody is gonna tell you that your planning is bullshit. And trust me, in the beginning you WILL make a lot of mistakes and work unpaid overtime. A lot. Estimating man hours in the IT is incredibly hard and requires a lot of experience.

4) You have to be your own motivator. It sounds great to not be expected to show up 9 o'clock at work, but in the end a website requires a certain amount of work, no matter how you look at it. This mean you can either kick yourself in the ass and be disciplined, or you will have to do death marches with little sleep when the deadlines gets closer.


(Conclusion)

Freelancing is fun, but hard. Don't underestimate it.

Also highly interested in this. In fact, I would like to reiterate the entire post.


/r/ing some excellent/actionable freelance steps and primers

If you don't at least have 5 impressive personal projects under your belt, you're a failure.

How do you host images on client side? I know you can preview them.

I want to make an app where you upload 6-15 images. Can that be hosted on client side? If so, how?

If I want to just host a blog somewhere what host do I use and where is a good place to get domains?

Using Django, if that influences things somehow.

namecheap is good

> Using Django, if that influences things somehow
no relation at all

Is there a way to make this work without repeating myself with two separate event listeners as I am doing?
inputEl.addEventListener('focus', function() {
document.getElementById('notes-input-info').style = 'visibility: visible';
inputEl.style = 'border: 1px solid #aaa';
})

inputEl.addEventListener('blur', function() {
document.getElementById('notes-input-info').style = 'visibility: hidden';
inputEl.style = 'border: 0px';
})

I'm working on making my projects look impressive before embarking on this. I plan on having a good income from freelancing while working a normal job before just doing full-time freelance.

I have most trouble with marketing. I am completely and utterly shit at it. Say I have awesome service, everything is perfect except for my marketing. Where do I start? How do i get clients?

How much money can reasonably be expected from fulltime freelancing work, aka a standard 40-hour workweek?

Start with a website that displays your projects all nice and fancy and in a "this is what I can do for you" professional manner. Then attend meetups. Beyond that idk, good luck user.

Get a dev job.

Start networking from there.

Sup dudes, web dev newb here.

I'm making a local weather app for FreeCodeCamp. One of the user stories is to add a button to change from celsius to fahrenheit and vice versa. I can only get the button to fire once though. Here is my code, sorry I don't know how to use quotes yet;

// Function to change ˚C to ˚F via button //

function convertToF (number) {
return (number*1.8) + 32;
};

var body = document.body;

if (body.textContent.includes("Fahrenheit") || body.innerText.includes("Fahrenheit")) {
$(".temp-button").on("click", function() {
$("#temp").text(Math.round(convertToF(temperature)) + "˚F");
$(".temp-button").text("Celsius ˚C")
});
} else if (body.textContent.includes("Celsius") || body.innerText.includes("Celsius")) {
$(".temp-button").on("click", function() {
$("#temp").text(Math.round(temperature) + "˚C");
$(".temp-button").text("Fahrenheit ˚F")
});
}

I tried to set it so that when the word 'Fahrenheit' is read on the button, clicking the button will change it to celsius and vice versa. I'm guessing the problem might be that there's nothing to be read once the button has been clicked. The console isn't returning anything.

Link to codepen: codepen.io/jonnyd94/pen/eEdPje

Feel free to make any other constructive criticisms on my code. I'm pretty new and could do with an experienced eye or two.

I am the same guy as the post above, so I'm not an expert but this thread is worth a read;

thefastlaneforum.com/community/threads/how-to-learn-code-start-a-web-company-15k-per-month-within-9-months.69971/

Salesmanship > ability is the message basically

Ok, but what hosting?

Got a sidejob to make a booking calendar system. Wondering if I should make it myself or use some shit

>How do i get clients?
My first clients were local business. Quite literally walked into a shop and said "lets make some websites". I worked for them for food basically but it boosted my reputation. They told about me to their colleagues, etc.

that code to assign the function to your button only runs once, when the page loads.
At that time the button says fahrenheit.
The "else" part never actually runs.

Better to keep track of the current temperature unit in a variable and show Celsius/Fahrenheit based on that.

let isCelcius = false

$(".temp-button").on("click", function() {
isCelcius = !isCelcius
$("#temp").text(isCelcius ? Math.round(convertToF(temperature)) + "˚F" : Math.round(temperature) + "°C");
$(".temp-button").text(isCelcius ? "Celsius ˚C" : "Fahrenheit ˚F")
});


codepen.io/user/pen/qXXEKg?editors=1010

Let's say I have 20 pages or less, how hard would it be for me to implement my own search engine for it. Opposed to paying a monthly fee for a premade one?

whoops got the if/else a bit backwards there, but shows how it would work nonetheless

Digitalocean or Vultr

just find an existing calendar / datapicker ui module

I am also doing this, what module do you recommend ?

it would be super ez
supposing you want to index web pages just run tf-idf for search queries on said pages and return top 5 or something
to improve perfs pre compute tf-idf results for each term in web pages, index results in memory
to get fuzzy results, index terms using phonetic algorithm instead, get phonetic representation of search term and find closest indexed terms using string distance calculation algorithm (levenstein), this way you can find results even tho user misspelled search query

Dunno, haven't used one in forever
this one looks fine amsul.ca/pickadate.js/date/
only issue is it seems to require jquerry

Our official Discord server:

discord.gg/wdg

Yes, we even have our own custom link.

i'm going to need an in depth guide for this.

yo want to
1. process query terms
2. sort your pages for relevance against query terms
3. return most relevant pages

An easy metric for 2. is tf-idf.
So yuo could precompute tf-idf scores for terms present in your pages and keep them in memory. This way if user searches for a term you just lookup tf-idf scores and return documents with highest scores. You can then fancy everything up by not taking stop-words into account, stemming words or using phonetic stuff to account for spelling errors

Should I grow a fancy beard?

fucking christ kill yourself

any example on that
i really need to know what level of skill i need to demonstrate

would it be possible to completely hide my js source code if I use node?

Is this the correct way to embed an N number of documents inside other documents in MongoDB/Mongoose?

somethingSchema = mongoose.Schema({
name: String,
description: String,
sections: [{
name: String,
arrayOfThings: [{
text: String,
type: String,
value: Number
}]
}]
});

hide it from whom? Another person running your program in Node?

I don't want to hide all the code, just the JSON data and the calculations of the algorithm. Can't you do these server-side?

const inputEl = ...;
const notesInputInfo = document.getElementById('notes-input-info');

['focus', 'blur'].forEach(type => inputEl.addEventListener(type, notesToggle));

function notesToggle(e) {
notesInputInfo.style.visibility = e.type === 'focus' ? 'visible' : 'hidden';
inputEl.style.border = e.type === 'focus' ? '1px solid #aaa' : '0';
}


Or something.

Seconding this.

Freelancing fucking sucks. Get a comfy startup job.

Currently in the process of starting my own small web services company, and im having difficulty deciding what to use for the website. Whats the best option for creating a site with basic payment gateway compatibility? Should I just purchase a WHMCS subscription to use with my WHM? Or are there free alternatives that I should use?

tl:dr alternatives to WHMCS

Last time I used WHMCS (maybe 10 years ago?) it was pretty simple, I've been using Stripe for some time now and really enjoy it

Does anyone know how to use shortid in mongo? The trash documentation is very lacking.

Stripe looks alright, no monthly subscription fee is a good thing to have, even if it costs 2.9% per transaction. Do you have an example site you could show me using Stripe? Id like to know how much customization I can put into the front end.

Learning CakePHP.

Why was this created?

This is some 2010 shit. Who has pages that need to load anymore?

are you asking if if you can do calculations serverside? sending json to the client will let the client see the json. Just send the result of the calculation to the client

With Stripe, you can use their checkout elements (not incredibly customizable, but very easy to integrate) or do it raw. Checkout is essentially just a button. WHMCS is definitely more turnkey if you're looking for easy of integration, I'd go with that. As for a site, mine is a SaaS application, but I'm weary of posting it here

still not clear exactly.
since Node is server-side, what's there to hide from clients. They only see what you send them.
like said

So for stripe, I would just create a site from scratch or with a CMS, and then add the Stripe add to cart & checkout buttons to the site?

Sort of, its a bit more than that, Stripe stores payments/payment details/subscriptions but the way it works is your application sends the info straight to stripe, which verifies and returns a token to you which use. It's a more setup, but if you are just looking for webhosting, whmcs probably makes more sense

Wtf is your problem?

Can you guys help me out, I changed the color off a couple off texts and borders in a website via the google inspector, I want to save this file so I don't have to do the same thing again when I open a new page, how can I do this?

And if theres no way I want to at least be able to save this style.

Much appreciated.

desu I haven't used node yet so I have no idea how it works, I just want the client to receive only the final results you get in html and the source data be inaccessible

It really depends on if its a website you own or not. If its a public website (youtube, for example) save the CSS to a text file on your desktop, then download stylish (browser addon) and add a new style to the website and copy + paste the CSS into stylish. If you own the site download the CSS file you just edited and overwrite the old CSS file on the server.

chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en

How can I download the existing css from the chrome inspector? Sorry I'm new

might want to read up on frontend/backend in general then.
The client has no way of knowing what your backend actually looks like. What kind of database you are running, which functions get called, or even that you are running Node in the first place and not something else.

ok thanks

another thing, how hard would it be to implement my app into node? will I need to remake the whole thing?

This.

>Wtf
Kill yourself.

>how hard would it be to implement my app into node?
You need to post some actual information if you want to have useful answers.

Is your app currently frontend-only and you want to move it to a server instead? (If it's just for hiding the code, then that is not a good reason at all)
Or are you using something like Django, etc. and want to move to Node instead?
There is a bit of worked involved in any case, but probably less if it's already written in JS.

the app is completely in js and uses few libraries including jquery

hiding the code is one reason but I think the app is getting a bit laggy the more complex stuff I add in, wouldn't server side make it run faster? (at least in mobiles)

alright I need to make a private messenger website using reactjs & nodejs and I don't even know where to start. Just a normal chat program where you can send private messages to eachother. Are there any libraries for reactjs I could use or a good tutorial I can follow? PLEASE help, I need to do this to get a job.

Hi user,

Join the .net team and use signalR! ;^)

Sounds like you're fucked, honestly. You obviously have no idea what you're doing.

how did you find yourself in dis situation

possibly, if you plan to utilize server-side rendering.

If your app is slow already, then that's something you have to fix first though.
Node won't miraculously take care of that problem.

easiest approach is probably something like socket.io
>need to
how come?

Stfu, nobody asked you anything, faggot.

>Stfu

Seems like you need to fix some problems first. What does the app do?
Node is for the backend. What are you using for backend now?

Stop posting.

Stop lying on your cv

why does webpack suck at including vendor css.

I have an interview for a mid-level front end developer job in two days. I'm junior level.

What specific algorithms or technical questions should I drill? Looking at big lists of interview questions doesn't help because I have limited time and can't go through them all

Good job specifying those job requirements in your post.

you're not gonna make it.

can someone explain what these parts want. does mod cookie mean owner trip or just any mod trip. and what is the secure tripsalt.

Anybody here using selenium? Or in QA business? Should I use it to check user role using selenium, or just use it to test buttons and forms?

redditors OUT

>tfw learning magento 2 and seeing the new programming style
I hate that its making me like it, so much conciseness and good design

halp!

>spamming
>tripfagging
>halp
Kill yourself.

No (you)

bulma is comfy
.net core is comfy
react is comfy

also will wdg be anything but tech support for normies who are trying to alter their tumblr theme

what's the simplest way to send a request to an API in PHP? I prepare the JSON with the data, then what? I've seen several libraries and such, but I wanna see what you guys think.

is it something wrong with hph7?

Yeah, that error about a file being missing is definitely a problem with hph7.
>ESL

do you know a way to fix it?

With comfy 12-hour days?

I want to build a sort of scraper that looks for any image from a url and compares it to an existing database of images stored locally. Before comparing, it needs to identify the content of the image, basically if the image depics Pepe, for instance, the program compares it with other pepes stored locally to check if it is missing or not. I know how to work on images, the only problem is that I have no idea about the image recognition. I know there is some Machine Learning involved here.
Has anyone developed something similar?
I'd do it in Php/JS.

>opencv
>study machine learning
>study image recognition
>to do your idea you need to already have a trained model/set
If you don't have a web frontend you wouldn't even need any js for this.

How do you guys upload projects made with composer?

I know that a lot of people are using shared hosting for production. Many shared hosting providers do not let you have command line access necessary for running composer on the production deployment. In that case, do you deploy the project with the /vendor folder included?

In the frontend side I just use webpack to automatically inject node_modules dependencies into the final build, therefore eliminating the need to upload the entire node_modules folder.

I'm just kind of confused with this

>tfw can't find motivation to continue with reactjs
Every time I work on it I just get swamped with shit I need to learn: reactjs, redux, reactor (though that one's easy af desu)...

I actually joined it and the guys on /wdg/ are chill.

Here's an invite if you want to join the club.

discord.gg/wdg

WHat are some ways to tie in webdev and security?

Can I run a freelancing pentesting site on the side?

Then move on to something else you enjoy.
I honestly can't even learn about anything in stages like that. It has to all be working towards a personal project otherwise it starts feeling vague.
So try that, either work towards a project and learning necessary components as they arise or as I said earlier just move on.

Look up data urls.

it's for a project but it's just hard because I'm trying to go about it in a "proper" way. I built out a prototype, now I'm building it without states, then I have to get it working with states, then I need to get it ready for the backend's API, then build the backend. It's just taking such a long time that I feel like it's pointless when I know it isn't.

If it's taking such a long time that you're starting to feel like it's pointless, why not speed up the process? Granted, this advice isn't that great if you're working on an enterprise tier bank system or some major shit, but otherwise it's a very important skill to know where to cut corners. Not every step has to be polished to perfection.

This was posted in /dpt/ but is kinda relevant to /wdg/ too

keep your garbage in the /nevergetanythingdonebecauseautism/ containment thread

naw it's just some media hosting site. I probably should though, get states working along with the pages and have the bare minimums working.

lol just build a mailing system with PHP and have it refresh the inbox page every 5 seconds :^)
you can do it in no time, it's better than nothing

Anyone here doing anything with ethereum/solidity?

Suppose I have a CRUD app working off a database of 1000 records. Fetching the entire list is pretty expensive(2-4seconds). How often am I supposed to read all 1000 records from the database?

Just once, at the beginning of the app? Every time after an insert/update/delete? Or is the best practice some weird middle ground of the two?