[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/wdg/ - Web Development General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 328
Thread images: 22

File: wdg.png (1MB, 822x552px) Image search: [Google]
wdg.png
1MB, 822x552px
jQuery Mobile is fun edition

> Discord
https://discord.gg/wdg
OR
https://discord.gg/0qLTzz5potDFXfdT
(they're the same)

>IRC Channel
#/g/wdg @ irc.rizon.net
Web client: https://www.rizon.net/chat

>Learning material
https://www.codecademy.com/
https://www.bento.io/
https://programming-motherfucker.com/
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md
https://www.theodinproject.com/
https://www.freecodecamp.com/
http://www.w3schools.com/
https://developer.mozilla.org/
http://www.codewars.com/
[YouTube] Crockford on JavaScript - Volume 1: The Early Years lecture series.

>Frontend development
https://github.com/dypsilon/frontend-dev-bookmarks

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
backendDevelopmentBookmarks.md

>Useful tools
https://pastebin.com/q5nB1Npt/
https://libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
https://developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
http://www.programmableweb.com/ - List of public APIs

>NEET guide to web dev employment
https://pastebin.com/4YeJAUbT/
>How to get started
[YouTube] WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
[YouTube] Javascript is Easy - "JavaScript is Easy" - If you can't into programming, you probably won't find a simpler introduction to JavaScript than this.


>cheap vps hosting in most western locations
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
https://www.openshift.com/
https://scaleway.com/
>>
For a floating menu button...

Just top:10px; left: 10px; and a high z-index with position: fixed?

Anyone have any good mobile nav bars? Was thinking about hamburger menu with a JQM panel.
>>
>>55872406
Why don't you just use
float: left;
?
>>
>>55872787
I've been using CSS for 17 years and I still don't understand float.
>>
>>55872885
I've been using CSS for 17 years and I still don't understand CSS
>>
>>55872885
It just takes some element and pushes it as far left or right as it can go.
>>
File: cecile.png (44KB, 321x351px) Image search: [Google]
cecile.png
44KB, 321x351px
>>55872901
If there was a good definition of float and it worked consistently every time then I might know about it.

Different things work differently for everything. Like left: 20px won't work for everything, so you have to margin which also doesn't work every time. Ever try to vertically align an image? Welp, better do some image size hack because it doesn't align from the top of the image.

CSS is balls.

captcha related, cecile
>>
Can someone help me decide on a language to write something with only textual user input and doesn't need sessions? Preferably usable with an SQL database but I suppose plain text files are OK too.

>python
Boring, I've made tens of web programs in Python.
>php
I'm worried about the security and the way to do routing is stupid
>perl
I don't like the arrays, and database interfacing sucks worse than PHP
>perl 6
the frameworks hide a lot of magic and the CGI/FastCGI isn't nowhere as nice as Perl 5
>common lisp
No libraries and stuff for web is very poorly documented
>scheme/racket
I couldn't get some code to work when I tried my implementation there so I gave up after a few days
>C
Too much hassle when worrying about sizes and inputs and implementing new features takes too long
>Elixir/Erlang and Haskell
I'm not in a position to learn new things right now, I want to get my program made
>golang
the packaging system is stupid and homemade solutions are fragmented
I tried once, but using a database in addition to gorilla routing meant I had to inline every function (route)
>ruby
RoR has too much magic and Sinatra has >>55872377
undecipherable errors
>node.js
npm, do I really have to say more?
>arc lisp
no regular expression library
>java
too much boilerplate and bullshit for something simple
>D
made by the people who created a proprietary compiler
>smalltalk
web development libraries are sparse and poorly documented
>io, ioke
No libraries
>shen
made by the people who whined that open sourcing their interpreter gave no benefit, so now are working on a proprietary compiler for another language
>lua
this is vaguely plausible actually, but I don't like tables
>ML or variants
poorly documented or non-existent web libraries
>nim
vaguely plausible, but frameworks available tend to hide away magic

Does nobody else feel this kind of dissatisfaction?
>>
>>55873127
>node.js
>npm, do I really have to say more?

Yes, say more. Seems like you're clutching at straws.
>>
Building a seedbox manager using lumen and I can't be arsed to do html. Any good administration panel templates out there?
>>
>new af
>having fun figuring out how to set up a localhost
>its set up and finish
>tfw don't know what to do next
i don't know what to do anymore. I wanted to set up a sql table that referenced video files, and which i could call through a search bar with php, but i'm lost as fuck. I can't stand learning to do all this through tutorials like codecademy. Ugh....
>>
Will I ever make money through my own website and become a NEET?
>>
>>55873656
yes
>>
>>55873690
You sure about that? :(
>>
>>55873707
yes. just work on it.
>>
On SQL, since PRIMARY KEYs can't be null, is there a point to putting NOT NULL with it?
>>
>>55873964
I don't need much to live a comfy NEET life, I already finished the HTML exercise of Codecadamy, it's fun so far.
>>
I have 2 months to find a remote job. I've finished Free Code Camps front end cert, used to mess around with PHP 7-8 years ago and have enough Ruby that I can put up simple, clean sites ala Jekyll.
My question is this, should I keep on with FCC and other MEAN based stuff or should I pivot to Wordpress and spend the next few weeks learning that? Which is the quicker, if not more lucrative, way to a freelance/remote paycheck?
>>
>>55873601
Learning is easy and the most fun part.

>read book on language you want to learn
>work on passion project as you read through book
>Google problems you can't solve

Never copy/paste code. Read how to do it. Read the code posted. Code it yourself. Don't reference the code until you've been lost for over 15 minutes.

>>55873656
Yes. It's not difficult.
>>
what type of data type should i use in SQL to store references to filepaths?
>>
why is React so based?
>>
I can't stop writing ugly code.

What can I do better here?
>>
>>55874309
and yes, I just realized I have data-role as role on the home buttons.

Those are going away.
>>
>>55874092
I use a TINYTEXT.
>>
File: 1453327614075.jpg (8KB, 323x241px) Image search: [Google]
1453327614075.jpg
8KB, 323x241px
>>55874309
>comments in HTML code
>>
>>55874421
Single page app. Figured it was important.1
>>
>>55874309
What are you talking about? The only thing you could have done to make it look better is to remove a few of the blank lines and indent a few so they fall within their parent div.
>>
>>55874487
Maybe that's it. Those few lines per page with no indentation.

This is what I get for years with no indentation at all.
>>
>>55874759
Try coding in Python for a few hours, you'll have no choice but to pay attention to indentation. :)
>>
>>55873988
just to make sure I guess
>>
can someone teach me angularjs?
>>
File: wG51k7v.png (66KB, 597x255px) Image search: [Google]
wG51k7v.png
66KB, 597x255px
>>55874984
I'm a Python dev. How does this look?
>>
>>55874309
>html
>code
>>
>>55875609
Doesn't fucking matter how Python looks, there's only one way to write it.
>>
>>55875686
Just look at the picture.

>>55875651
You saying it's not? Let's debate this. What is this markup language interpreted as?
>>
>>55875601
Yes, someone can.
>>
>>55875601

go with React
>>
Are the people that teach shit at bootcamps actually good?

Like really REALLY good?

They make 140k where I live and the average FAMILY income is 50k combined here.

Do you have to be god tier or can I show them a website that gets more traffic than theirs and maybe land the gig?

I rightfully have imposter's syndrome.
>>
>>55875775

most of them are software engineers turned web dev geeks, yes they are smart.
>>
>>55872377
Guys. I want to make a chrome-extension.

How do I do this?

I need to be able to access any kind of sound apis, and networking apis.

Are there any kind of "getting started" guides.
>>
>>55875765
why's that?
>>
>>55876015
http://www.lmgtfy.com/?q=build+a+chrome+extension
>>
>>55876234
Yes.
>>
Is there an agreed upon great guide for PHP? It seems like it's not really taught in courses much anymore, but I see a lot of job listings for it.
>>
>>55877460
Just set out to achieve something and figure out how to do it? I learnt all about PHP by making a blog with an account system and shit. Use PDO for databases and disregard anything <PHP7
>>
>>55877478
Cheers, I guess stumbling around with reference pages for a few hours to get something done is the best way to learn in end.
>>
>>55877496
it's the only way to learn stuff sempai
>>
>>55877496
>>55877533
Damn straight.

Don't copy/paste. Read what they did to solve the problem and attempt to solve it yourself. It's easy to copy/paste from stack overflow but you won't learn a damn thing most of the time.

Any book is good, but a lot of them have bad practices. Agreed with anon, definitely use PDO.

Once you can make a retarded version of Twitter then you are good to go.
>>
>>55877460
http://www.phptherightway.com
>>
window.open("\img/"+id+".jpg",'','resizable=no,width=300,heigth=300');

why the fuck is this not working ? the image is show, but almost every day the window is in a different and random size.
>>
>>55877691
Actually, using things before you fully understand them can be a good way to learn.
>>
>>55877984
pasted a supposedly working link, changed it's link and it works ! then changed my link to be the same as the first one, i mean both are 100% identical, mine still doesn't respect the height and weight...
>>
I'm finally learning back end. I'm reading about REST routes and how they're supposed to be laid out, but what if for example I have a blogpost I want to update without needing to go to another page? Edit them on the fly instead of going to /blogs/:id/edit ?
>>
>>55878271
javascript to turn the blog post into a text form and a save button which sends that new text to the database, then reload the page?
>>
>>55878291
i know I could just do that, but if I do I stop following the REST pattern?
>>
>>55878305
I don't really care about patterns like that
>>
I fucking hate jquery
I fucking hate javascript
I fucking hate MVC
I fucking hate the web
I haven't written a single line of code since yesterday because I need to use the fucking jquery to continue

Fuck everything
>>
What are the counterparts in the MEAN stack for the LAMP stack? MongoDB/MySQL, NodeJS and Express/Apache, JavaScript/PHP?
>>
>>55878712

MongoDB / MySQL,
NodeJS / Apache,
Angular & Express / PHP
>>
>>55878712
LEMP or bust
Linux / NGINX / MYSQL / PHP
the holy quadfecta(though to be fair I've only ever used MYSQL, I'm interested in postgresql)
>>
File: 1468466651403.gif (186KB, 460x460px) Image search: [Google]
1468466651403.gif
186KB, 460x460px
>>55874309
> Current year
> Using <br>
>>
>>55878823
literally what else would you use for breaking lines
>>
the Hartl book is starting to become really confusing I am at chapter 8 right now.

And it seems like I only know half of the things that he is talking about.

It seems really confusing especially after coming from just JavaScript/css

Is there a rails book that goes slower? for slow people.
>>
>>55879251
if you find rails hard i suggest you give up and go shovel dirt instead

theres literally no hope for u
>>
>>55879251
Overall though I kind of like the book, I sort of get Test driven development. It is nice to actually use git for projects and get used to it.

I also like the layouts and stuff that saves code you have to write.

What I don't understand is Controllers.

Application controllers/test controllers what ever controllers.

jesus.

>>55879293
>u
>>
>>55878844
You don't. You use CSS to space everything
>>
File: ISweartoGod.png (80KB, 1982x1133px) Image search: [Google]
ISweartoGod.png
80KB, 1982x1133px
>>55874006
Anyone?

Fastest route to a job, Wordpress or MEAN?
>>
>>55878712
>>55878792

Stop trying to make MEME stack a thing, it's not a thing. With node, you can use any or no frontend framework, any or no backend framework, and pretty much any database. Mongo is an objectively shit database, angular 1 is obsolete, angular 2 is a pile of broken beta shit, and express is...Actually express is pretty good.

Point is, stop locking yourselves into a "stack". Different tools are good for different jobs.
>>
>>55879847
WP will get you a job faster, MEME will get you a job that pays more than McDonalds.
>>
Let's say I'm running react on the front end and node/express on the back.

Which should handle the routing? I've seen a set up suggested that express only serves a bare html page at a wildcard route, while react handles all of the actual routing.
>>
>>55880297
I also want to know, react seems to do a job express also does and I don't know how to combine the two.
>>
>>55880297
>>55880500

React (or any other frontend framework) "routes" let you use a url to represent a certain state within your single page app so the user can bookmark urls and use the browser back button like a more traditional non-SPA site.

Typically you would then use Express's (or whatever backend you're using) routing to serve up API endpoints and hit them indirectly with AJAX calls.

If you're not making a SPA, you could have the user hit the routes directly and build pages dynamically from templates, or serve up static html (although in production, you'd want to use something like nginx for that).

Hope that makes sense.
>>
Anyone using angular here? I've been working with ionic and came across a strange syntax, I'm not sure how to create a service in:

angular.module('app.services', [])

.factory('BlankFactory', [function(){

}])

.service('BlankService', [function(){

}]);


why are there square brackets around functions?
>>
>>55878844
Use <br> if you want. You can also use <p> to divide it from the rest.
>>
>>55881318
for dependency injection.
>>
I'm finding it really hard to grasp JS. I learned a bit using FreeCodeCamp but I couldn't do the projects with my basic knowledge so I'm reading Eloquent JavaScript right now. However, it's killing me. I understand it eventually if I search for an explanation online but not enough to apply it myself. Sometimes I just don't understand it at all. I'm on chapter 6.

So what can I do to bring up my level of JS? fuk this mang
>>
>>55882425
How are you on chapter 6 and not grasping it? Are you doing the exercises? Are you playing around with alternative solutions? EQ is pretty damn great at encouraging such, it would be a shame if you're just straight reading through it without taking notes or doing the exercises.
>>
>>55882456
Yeah doing all the exercises, looking stuff up etc. I'm taking a lot of notes and like I said I understand it and why it works, but if you asked me to write it I wouldn't know how. Kind of like being able to understand a human language but not being able to speak it.
>>
>>55881318
ive always disliked that systax, i prefer to use
app.service("exampleDataService", exampleDataService);

function exampleDataService($rootScope)
{
this.title = "sample";

this.alert =
{
id: null,
data: null
};
}

app.controller("alertModal", alertModal);

function alertModal($scope, $uibModalInstance, exampleDataService)
{
$scope.title = exampleDataService.title;

$scope.alert = exampleDataService.alert;

$scope.ok = function()
{
$uibModalInstance.close($scope.alert);
};

$scope.cancel = function()
{
$uibModalInstance.dismiss('cancel');
};
}

which is much more readable, even with dependencies
>>
File: Kumiko.webm (793KB, 1920x1080px) Image search: [Google]
Kumiko.webm
793KB, 1920x1080px
Learning backend. Is it supposed to be this formulaic and easy? All I've seen is that you need to make routes and save shit in databases. It's very irritating and the many options for a backend language to choose as opposed to just JS in front end made it seem very daunting but it doesn't seem so bad now. Maybe I need to get myself wet with an actual complex project? All I've done so far are generic blogs and mini social networks.
>>
>>55881883

DINGY DING DING DING
>>
File: 1468809784798.png (135KB, 288x415px) Image search: [Google]
1468809784798.png
135KB, 288x415px
>>55874309

> text not inside of an HTML element
> links not wrapped in divs
>>
>>55883066
>divitis
>>
>>55883088

What if you needed to change the background of the link? What if you wanted to add subtext for the link, and move it all to the right or left?

If there's a unique section of a website, it should be in a div, IMO.
>>
>>55883146
All that can be done without wrapping it in another tag
>>
>>55882560
That's normal. I've been using javascript for roughly a year now and I still have to look up stuff all the time. There's no reason to memorize everything when google exists. You'll naturally memorize the stuff you use over time. Just make sure you have a solid understanding of the fundamentals and practice every day.
>>
Why does jquery mobile have such an ugly navbar?


Are there any alternatives I can use?
>>
>>55883617
make it yourself
>>
Are inline styles the best way to style shit in React? This feels very messy to me. React seems to really hate the notion of concern separation. I understand why they chose to go against it, but in the case of styling this does not feel like the ideal solution.
>>
Alright so I'm going to develop a quiz app and wanted to get your input if my idea of the implementation sounds correct.

The quiz part is going to be a webapplication, preferably SPA with VueJS. I'm also making a dashboard where an admin can log in and edit the questions. The questions will be saved in a MongoDB Database and the Dashboard also contains an API that returns the questions from the database. The quiz app queries this API and gets a JSON response with all of the questions. I want to build the Dashboard on a Node server with the sails framework, since I already have some experience with it.

So basically the quiz and the dashboard are two seperate projects that I'm going to host on subdomains. Does this sound somewhat reasonable or did I get the wrong idea? Still fairly new to webdev.
>>
>>55883845

That seems like a lot of stuff for one project.
>>
>>55884537
How else would you do it? I need the quiz app and a custom cms that saves the questions in a database.
>>
>>55883845
Sounds over-architectured to me.

Only bother making an API if there's a need, otherwise just access data directly.

Only use MongoDB if your application actually consists of "big data" i.e. more than a few Terabytes. Otherwise just use a regular RDBMS such as MySQL or PostgreSQL.
>>
Very confused with the term API. Before I got into web dev I usually heard that word in game development like in the Havok engine or OpenGL. But in web development they use that term for basically just paths.
>>
>>55883789
react components have exactly the same styling options as regular html. Only difference is you need to use className="" instead of class="".
>>
>>55884719
An API is just a bunch of standardized protocols used for writing software.

>But in web development they use that term for basically just paths

Are you referring to a Rest API?
e.g. https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood4

It's a way of calling external services or software via a URL, nothing special about it. You call a URL and get some data back representing the output of a process on the external server.
>>
>>55884716
The reason I want to use a relational database is, because the questions don't have a set amount of answers. It seems to fit better than a traditional database with columns. I'd also like to learn MongoDB for future use.

>don't bother making an API
What's the alternative? Sending the queries from the frontend? That seems insecure.
>>
>>55882425
Try A Smarter Way to Learn JavaScript.
>>
>>55884798
So it'd be alright to link a stylesheet to the html page I anchor all my components on and style them that way?
>>
>>55884871
>because the questions don't have a set amount of answers
So what? With two tables you can solve this
Question
-------------
QuestionId
Text


Answer
-----------
AnswerId
QuestionId (FK)
Text


And your "traditional databases" are relational databases. MongoDB is a NoSQL/non-relational database.

>learn MongoDB for future use
Only for pet projects I hope.
>>
>>55884580
There's nothing wrong with your way. I don't know as much as you do, so I'd probably go with Node and Mongo + Angular or React.
>>
>>55884871
That anon doesn't know what they're talking about, ignore them. If the data you plan on storing maps well to a relational database, you should use a relational database. If it maps better to a document-oriented database, use that. Mongo in particular is shit though. It's fine for a personal project, but for production usage, relational is almost always a better choice.

>>55885069
Yep.
>>
Is there any way to dynamically add HTML code right after a specific div via JS? Not talking about innerHTML or append, or creating divs with JS. Im talking about already generated html content that has been created backend and sent via Ajax to be placed after a given div.
>>
>>55885299
Depending on what you're trying to do, there are about a billion SPA frameworks and template libraries to do that. Also:

https://en.wikipedia.org/wiki/Web_Components
>>
>>55874309
Man I hate how windows renders fonts. I'm using Sublime too with the same font and mine looks like shit in comparison.
>>
>>55885570
It's been a while since I last formatted my PC but I always install a better font renderer. Fonts are as clear as in OSX with it, forgot what's it called though.
>>
You guys are all fag wannabes. Enjoy your code monkey life.

Peace out...
>>
>>55887094
y- you too...
>>
how dank is the odin project?
>>
>>55876700

Thanks man! Truly invaluable advice!
>>
>>55877984

window method 1:

var lunaPic = "http://orig12.deviantart.net/4559/f/2014/229/e/8/tiberius_want_by_otakuap-d7vjmbv.jpg";
window.open(lunaPic, 'LunaWindow', 'height=300,width=300');


my post is too long, window method 2 will follow:
>>
>>55877984
>>55888204
(function(){

var urls = {
"styles": [
"https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/classic/theme-classic/resources/theme-classic-all.css"
],
"scripts": [
"https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/ext-all.js",
"https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/classic/theme-classic/theme-classic.js"
]
};

var insertScript = function(url){
var a = document.createElement('script');
a.setAttribute('src', url);
a.setAttribute('type', 'application/javascript');
document.head.appendChild(a);
};

var insertStyle = function(url){
var a = document.createElement('link');
a.setAttribute('rel', 'stylesheet');
a.setAttribute('type', 'text/css');
a.setAttribute('href', url);
document.head.appendChild(a);
};

var timeoutPromise = function(fn, delay){
var iPromise = new Promise(function(resolve, reject){
setTimeout(function(){
resolve(fn());
}, delay);
});
return iPromise;
}

urls.styles.forEach(function(styleUrl){ insertStyle(styleUrl); });

insertScript(urls.scripts[0]);

timeoutPromise(function(){
insertScript(urls.scripts[1]);
}, 5000).then(function(){
setTimeout(function(){
Ext.window.Window.create({
height: 300,
width: 300,
items: [
{
html:'<img style="height: 300px; width: 300px;" src="http://orig12.deviantart.net/4559/f/2014/229/e/8/tiberius_want_by_otakuap-d7vjmbv.jpg">',
height:300,
width:300
}
],
autoShow: true
});
}, 1000);
});

})();
>>
>>55888204
>>55888218

Next time use JSFiddle
>>
>>55888278
Why? You can just try it right here with developer console.
(it takes approximately 6 seconds for results to show up)
>>
>>55873127

You post makes no sense.
Have you looked in each language for one day?

>python

So python is "Boring".. does this mean you are the ultimate Django master or do you need a more "exciting" langauge? WTF?!

>php

Laravel is pretty secure:
>http://www.easylaravelbook.com/blog/2015/07/22/laravel-key-security-features/


>ruby

Ruby is not just Rails or Sinatra, maybe a smaller framework is for you, like Rack, Cuba or Ramaze?


>node.js

Node is pretty decent, what's your problem?
>>
>>55888328

Because you won't clutter up the thread, you won't have to break it into sections because it's too long, and its easier for other people to debug it and share their own version of the solution with you.
>>
>>55887443
Breddy gud if you like ruby
>>
>>55889075
I did it: https://jsfiddle.net/3rhfbfe1/2/

We haz'ing some fun now.
>>
>>55890178
Nah, if nobody hasn't helped you yet you might be here for a while before someone does.

Haz fun waiting though. :)
>>
>>55882972
Yes, do something with a semi-complex database structure at least.
>>
I have a lot of education in typical CS (C++, Python) but I'm a lot more drawn to web dev and my classes weren't very modern (old C# practices). I've been "doing" web-dev for years, but really basic stuff and I've just been getting into MEAN stack stuff (tutorials, etc), but I'm wondering what I should really practice and what interviews are like for front-end dev jobs?
>>
>>55877984
>heigth=300');
heigth
>>
File: boringcarousel.png (291KB, 1253x493px) Image search: [Google]
boringcarousel.png
291KB, 1253x493px
I have these 2 boring carousel slides on my website, and I want to make them look like old newspaper adverts, but I have no idea how to style that, does anyone have any links to places where you can just put the image and text in and it. I will link to this what I want it to look like.
>>
File: bikeadverts.jpg (139KB, 1000x1278px) Image search: [Google]
bikeadverts.jpg
139KB, 1000x1278px
>>55895200

I want it to be this sort of style
>>
does anyone here have any experience with node.js / nw.js ?
I'm trying to use an addon that's not very well documented and it's not working on node 4.0.0 or any later version, but it's been updated on github and npm 9 months ago so I'm guessing it should work?
I'd appreciate some advice, will detail the problem if someone wants to help ( a "cannot read property of undefined")
it's https://www.npmjs.com/package/phidgetapi
>>
I just got an offer for implementing an e-shop to exisiting website. However, I never did this before. What details should I know? How much should I ask? Any advice will be appreciated..
>>
>>55895674
ok I kinda fixed some shit by removing stuff I don't need from the code but I get a "object.observe is not a function" frome nw.js 0.16, isn't this supposed to be supported in nw ?
>>
>>55883563
I really hope so. There are times where I understand some concepts, and then others where I feel so fucking stupid because people seem to glide through that book and I don't understand it even after hours and hours of practice each day. I hope I actually make progress soon.

>>55884983
thanks, I'll look into it
>>
>>55888204
>>55888218
thank you, already figured it out.

>>55893344
shit
>>
File: raspiwifidrive.jpg (1MB, 2393x2393px) Image search: [Google]
raspiwifidrive.jpg
1MB, 2393x2393px
i am working on a project, that reads from a DB consisting of people data, prints on the webpage the records, by clicking on the name you get a popup window with the person's ID number+.jpg, which is stored on the server in /img folder. Also after showing the popup, a query is executed, which does a count++ for the person (how many times his picture has been shown. Everything works so far. Now comes the second part I need to think through, and would like to see some opinions. I have to implement a way to manage the images : add/remove/change. Should I put the three according links next to each person e.g. remove calls function remove(id), which deletes or archives some the file id.jpg ? And add/change to be overwrite the id.jpg with a new file and save again with the same name ? I;m kinda new to web dev
>>
>>55896594
> Should I put the three according links next to each person e.g. remove calls function remove(id), which deletes or archives some the file id.jpg ?

Sounds fine for a basic implementation. Once you get it working, you could do it with AJAX so the user doesn't experience a page reload.

>And add/change to be overwrite the id.jpg with a new file and save again with the same name ?

Yep.
>>
>>55897003
>you could do it with AJAX
you mean calling another php file, instead of a js function in the current one ?
>>
Quick question: I need to learn Apache2 ASAP. Don't have prior experience with servers. Any good books?
>>
>>55897155

http://httpd.apache.org/docs/2.4/getting-started.html

http://httpd.apache.org/docs/2.4/

There is no better source.
>>
I started with FreeCodeCamp to learn front end dev but veered off course to other resources to polish up my skills.

Do you guys recommend I continue with FCC or something else?
>>
>>55897054
I mean the delete button would have a click event handler to call a js function to do an ajax call to a php page which would delete the image (or flag it removed, whatever) and return some JSON indicating the results of that call. Then if the JSON indicates the request was successful, the button's text might change to 'Image deleted' or something.
>>
>>55897280
I'd say keep doing it unless FCC gets on your nerves or something. Their projects are good practice and there are plenty of good and bad examples to learn from since FCC is relatively popular. Of course, you shouldn't *only* use FCC; if you find other good resources to use, there's no reason not to try them too.
>>
Do you guys know of any good freelance websites to HIRE a graphic designer? Its only to make a few banners and maybe a logo, don't mind where the designer is from as long as they can speak English and don't cost too much.

I am in the UK if that makes a difference.
>>
Have an interview tomorrow for a company that does webinars and webcasts,

Haven't studied HTML or CSS for almost two years

Any good websites for quick refreshers? Used Google but nothing of substance came up. Thanks in advance
>>
>>55898002
unironically
reddit.com/r/forhire
>>
Should I mock up my react component in html, and try some styling with css, then transfer it into jsx within a component?

It seems like it'd be a bit more convoluted to just do it from scratch in JSX first.
>>
>>55897380
thank you, sir!
>>
what is a website's 'client id', and how would i be able to obtain one without the site having an API?
>>
I often hear of frameworks like RoR, Meteor, etc. referred to as being targeted toward startups because of their ease of getting things up and running.

What would /wdg/ consider to be a more mature framework for building web applications? Meaning, if time was not a concern in getting your app out, what would you write it in?

Go seems pretty cool and stable but obviously not "tried-and-true."
>>
>>55898021
>interview tomorrow
>Haven't studied HTML or CSS for almost two years
>google-fu so weak that you can't even find one of the trillions of html & css guides

lol you're fucked.
>>
>>55898021

cram by reading this http://learn.shayhowe.com/html-css/
>>
how long does it take to git gud at javascript?
>>
>>55898577
Depends on how smart you are and how much previous programming experience you have. On average maybe a couple months to get comfortable with it and a year to pretty much know all the ins and outs? There are plenty of people who have been using JS for 20 years and still can't do shit so YMMV.
>>
>>55898684
no programming experience except html and css which I learned very quickly (but then again it is super simple). javascript I've been studying for 2 months now and I still feel like I'm climbing the steepest, crumbliest mountain in the world and never making a step up.
>>
>>55898021
HTML/CSS is the lowest denominator in this field. You don't even need to study unless they give you pen and paper and tell you to write the basic backbone of a HTML page.
>>
>>55898768
The first programming language you try to learn is always the most difficult. Keep at it and try to improve your study methods.
>>
>>55898768
>>55898830

JS is a bit of a rough first language in some ways - it has characteristics unique to it, and lacks some characteristics common to most other programming languages.

But as a general tip, albeit one you'll hear over and over: if you want to get good and really grasp programming as a whole, do it every single day.
>>
>>55898830
>>55898849
I console myself with the fact that the first time I saw what JS code looked like I felt like crying while now I can at least somewhat follow it despite not being able to write shit.

I study it hours per day, let's hope a miracle happens like it did with Spanish where it suddenly all fell in place and I understood much more seemingly overnight.
>>
>>55899050
Yeah all the pieces will fit together suddenly, just keep coding.
>>
My hands are shaking.

Did you guys have help from bosses during internships?

2/3s of my current internship as a frontend dev has been spent on fighting with tons of bugs and deprecated libraries which weren't updated for years, unhealthy amounts of googling and reading broken english on stack overflow and configuring badly documented projects just so I can start working.

A whole ecosystem is based around java and they use hundreds of libraries for pretty much everything they can. Every project has thousands of files even though it is just a CRUD app, and not to mention how slow that shit is (we are talking about seconds just to load a page with ajax).

I am barely making anything productive and my head hurts every day after I go home.

Fuck this job. Nothing is worth doing this. I don't think I'll do this for a living, might go down the design route instead, even though the payment is shittier.
>>
>>55899847
tell me friendo, how much work do you have to do daily ? can't you just work on a slower phase ? will someone notice ?
>>
>>55899896
Not really, I have nothing to complain about because of that. I can work around 5-7 hours daily if I want. If I can solve something, I do it faster than they would expect, but when I have problems with errors, I can spend half a week doing nothing.

But I am mad even with this, if I had to work full time there I would burn out.

And I'll inb4 because I know somebody will tell me I am ungrateful or something. Yeah, this is probably not that bad, but I just don't enjoy this. It's basically being a professional googler for everyone there. Is this really a reality of a development job today? It's my first work in this industry so I wouldn't know.
>>
>>55900116
thats why I am asking, bro.

I am searching for a job, I can pretty much make a website from scratch front and back end with only js, or MEAN stack.

And I have made 3 sites in freelancer with bootstrap and wordpress the first one from scratch (took me 2 weeks) and the second and third I used the ready work and few plugins.

And right now I am building my portfolio and wondering should I aim for internship or try to jump straight into junior position.

I don't know if I have the required skills yet.

Also I have worked for personal projects with C++ and OpenCV which has nothing to do with /wdg/ but still, its programming and I guess its valuable right ??
>>
Do you guys use either Docker or Vagrant??
>>
>>55900279
Apart from those skills, do you have qualifications? I think you should try for a junior position, fuck internships.

>>55900319
We use Docker with GitLab's Continuous Integration (CI) at work, useful.
>>
Best sites to look at for startup web dev positions?
>>
>>55900279
Oh, I should mention that my internship is only for a month and it is obligatory in my college, so I didn't choose to work in this place. It's not like one of those that you get before you get a job at that place.
>>
>>55899050
What's your biggest problem at the moment? And what kind of exercises are you dong? Just DOM Manipuulation or more complicated stuff?
>>
>>55899050
Javascript is a horrible language imo. It's very powerful, but learning it is a nightmare.

If you're coding serious amounts of Javascript, I personally would use another language which transcompiles to JS.

I use Google Web Toolkit (as very familiar with Java), but there's also Dart, Typescript (which looks really good), etc
>>
>>55900486
angel list

the fucking cunts hardly ever reply though
>>
>>55900319
>Docker
>Requires Windows 10 Professional or Enterprise 64-bit

Well, fuck you then.
>>
>>55900958
Windows is a second-tier environment for development now, it's to be expected.
>>
>>55900958
>windows for dev
top kek
>>
>>55900637
I'm going through Eloquent JS right now, I'm on the Objects chapter. Just basic stuff, but it's like Chinese to me. Occasionally I grasp some stuff, other times it just flies over my head.

I understand what each bit of the code does separately and what it's used for, but putting it together is difficult. I guess the "grammar" of it.

From time to time I do some exercises on CodeWars.

If you have any tips on how to go about it I'm all ears

>>55900886
I want to work in front end dev so JS is necessary, no? Either way I will look into your suggestions!
>>
>>55900958

>Development
>Windows

OH SHIT NIGGA WHAT ARE YOU DOING?
>>
>>55900977
>>55900990
>>55901043
Is Docker even on Linux? All I see on their site is Mac/Windows versions.
>>
>>55901172

you are trolling, aren't you?
>>
>>55901172
Docker is only on Linux really, it's deployed in its own VM for the OS X and Windows versions.
>>
>>55901172
Because they detected you are using Win/Mac for browsing their site.
And yes, it was originally on Linux, and only recently ported to Win/Mac (without the need of 3rd parties like boot2docker
>>
>>55901296
>>55901357

Thanks. I've never used anything besides the basic tools for development. I'm switching to Linux when I'm done with these projects anyway so I'll learn more about it.
>>
>>55901023
Don't worry, it took a while before it clicked with me as well. The best thing to do is practice. Codewars is a good start, but try to think of a simple application and code it from scratch. Googling is fine but don't just copy and paste the solutions.

When I'm trying to solve a problem, I always break it down into its smallest components. Let's say you want to reverse a string. First of all you need an input string. Then you start at the last letter of that string. Then you save that somewhere. Then you go to the second last letter and save it etc... That seems pretty repetitive so the best way to do that is probably a loop. Write out your idea in pseudocode so you don't get too hung up on syntax. If you think you have the solution, code it for real.

This method has helped me getting started with programming and I still use it for complex stuff.
>>
>>55901434
Thanks anon. I was initially doing FCC's challenges but found that I was just copy/pasting code since they didn't teach me enough to go out and code the challenges.

I always start coding from scratch but it always turns out that the way to reach the solution is completely different to mine! Ah well no one learned to speak a language in a day either right
>>
>>55900319
I tried integrating vagrant into my workflow (flask applications with JS front + a DB like SQLite or Postgres) but I couldn't get use to it. Maybe it was the fact that I was using fabric to make the deployments to my VPS, but I needed a separate set of instructions for Vagrant. It became really messy quite fast.
Docker on the other side is 'clicking' good on my workflow. I haven't tried deploying with docker to my VPS yet, tho.
>>
>>55901501
It doesn't matter that your solution is different. For every programming problem there are hundreds of ways to do it. Some are obviously better or more efficient than others. But once you understand the basics you can focus on writing cleaner code and slowly get rid of your beginner style.
>>
>>55901501
Read Code Complete and a couple of books on design patterns.
>>
Does anyone else get super fucking brain fog after 6~ hours of this shit?

I can't seem to focus past a certain, when I'm at work. I just feel like my thoughts are being vacuumed in real-time.

Have you guys taken some sort of drug to amend this horrible sensation?
>>
>>55901676
Coffee.
>>
>>55901676
Not really. I take 10 ~ 15 minute breaks every hour. I go outside and walk around, play a game on my phone, or whatever, then get back to it.

If I was working in an office I wouldn't be able to do that though unless it's a really chill work environment. Plus I work better at night.
>>
>>55901676
I'm productive for typically 5-6 hours. The rest of the time I walk around drinking hot chocolate or playing mobile games in the toilet.
>>
>>55901676
you need to do something else, but programming after work, and I am not talking about drinking or socializing, I am talking about something creative.

I was like that for the first year or so, but then I started going to my dad's garage and help with minor car fixes, while helping him earn extra buck too. I felt satisfied and even more focused on the next day.

Try something like that, visit /diy/ start a project, work on it after work, don't set goals, just be consistent.

Also, drugs are bad, they will cause even more brainfog in the long run.
>>
>>55901676
Try different work/rest patterns. I use Flat Tomato to time work/rest. It basically has you working for 25 mins and resting for 5. Works best for me at least.

It's better to split your work into sections rather than go all out for hours and then take one huge break.

Also, >>55901704. Alternatively, less coffee could work. Take too much stimulants and the opposite will happen. You'll feel wired but tired at the same time.
>>
>>55901704
I feel this way even after drinking coffee. My body offers little to no resistance to drugs, so they normally hit like a fucking train, but coffee hasn't done shit to help me out with this. The only thing it does is become a nuisance, as it'll have me stay awake until two AM, thus ruining my following day of work.

>>55901742
Breaks every hour? I wish. We're allowed one every two hours, I think. The environment is chill and all, but I just fucking block after a certain time, and then it takes me a good hour-long walk to wear off the fog and get back at it, which I normally do, after leaving work and getting home.

>>55901765
You know what, I think you just laid out what's wrong with me right there... I have a very vapid life. I live entirely on a routine basis. Work, home, work, home. I need to pick up a hobby that isn't sitting on my ass only to wait for the next day to come around.

>>55901770
The problem with the position I am in is that it's very "on-demand basis". I have to dole out fixes and shit for projects. I am seriously fucking yearning for a project of my own that I can start from the fucking ground up. I feel so fucking lost in the shit my colleagues made. I have to consult them every time some shit happened in the - oftentimes - super messy shit they put together.


Also, what's a good book to pick up for web development, mainly back-end and more oriented towards .NET? Preferably C#. Does anyone know? I feel like I need to supplement the shit I learn at work with some shit at home.
>>
>>55901676
I used to get this and looked into in some detail. I used to drink coffee to curb the effects, but it made me too anxious to actually write code. I also exercise during my lunch break to help prevent this from happening. Anyway, the thing I found that works incredibly well is nicotine. 3mg juice from a vape is enough to mellow, energize, and clear my mind. I had never done drugs up to that point, but nicotine really is a wonder drug. I see why it was so prominent in days since past.
>>
>>55900886
the nodeschool.io workshops on javascript are pretty good for getting a grasp on some features you wouldn't normally use. The functional-javascript one is especially exceptional.
>>
>>55901833
>I feel this way even after drinking coffee.

Caffeine has a long half-life and you build tolerance quickly. If you regularly drink a lot of coffee, it'll stop affecting you. Try drinking half your normal amount tomorrow, then stop drinking it (or switch to decaf) for like a week or so.

>I need to pick up a hobby that isn't sitting on my ass only to wait for the next day to come around.

Try camping or a similar outdoors activity. Something low-intensity but still involved enough to get you away from your computer for a while.

>Also, what's a good book to pick up for web development
Web dev books are usually outdated shit before the ink even dries.
>>
>>55902017
Exercise is another thing I definitely need to throw into my schedule. I used to exercise quite often, but I've lost it as of late. Time to pick it back up.

And about nicotine... yeah, I don't know about it. I don't want to incur in the possibility of becoming hooked to it. I'm wholly uninformed about vaping, but it's in any way as bad as conventional smoking, then it's not for me. I grew up watching my family struggle with their addictions. That was enough to set me straight for life.
>>
>>55901833
>I need to pick up a hobby
I'm about to start painting miniatures and building terrains and stuff, to do something with my hands that isn't fapping to roris.
>>
>>>55902017
vaping actually helps me keep focused as well. Whenever I encounter a difficult problem, I lean back and take a hit, helps relieve the momentary stress and clear my head
>>
>>55902121
Yeah, I really need to do something outside of the computer. That's for sure. I never really feel like I am rested, and it's likely because I do the same shit over and over and over and over. The only moments when I truly feel at peace are when I'm either laying in bed or during my daily commute to & from work.
>>
>>55902192
>The only moments when I truly feel at peace are when I'm either laying in bed or during my daily commute to & from work.
I love commuting to work in the early morning, listening to podcasts. It's so chill before the clusterfuck of the day begins. Such a contrast to the pounding headache I have towards the end of the day.
>>
>>55901833
>but coffee hasn't done shit to help me out with this

the feels.

Coffee hasn't affected my brain since I was 24.

Trying Ritalin soon.
>>
How do I link an external stylesheet to a react app?

I've looked at inline styles, but I don't want to try them immediately.

When I link to the stylesheet within the html page I attach my react components to it throws an error, saying that the get request for the stylesheet failed.

I'm running the webpack-dev-server, is that the issue?
>>
Can't seem to motivate myself anymore, professional web dev was a mistake
>>
File: leSmugLizardMan.png (249KB, 1213x1483px) Image search: [Google]
leSmugLizardMan.png
249KB, 1213x1483px
>>55901676
I take regular breaks, drink water, lift weights, and try to get a good night's sleep.

Also I spend most of my work day browsing Reddit :^)
>>
>>55903166
I know how you feel. I haven't even had my first full-time dev job yet.

There aren't many tech jobs where I live besides the basic Tech Support shit. I was hoping web dev would be my way out by at least working remotely. I've been sending out apps for months and now I'm depressed.
>>
What OS do you guys do your web dev on and why?
>>
>>55903166
How's your workplace and the work they have you do?
>>
is eval() not accurate for normal math? I'm doing 1.2 * 3 and it's giving me 3.5999999999999999
>>
>>55903389
>working remotely

Pajeet please.

Where do you live that there are no webdev jobs at all?
>>
>>55903418
Floating point can't represent decimal fractions accurately. Multiply your numbers up to whole numbers before doing multiplication and division.

https://en.wikipedia.org/wiki/Floating_point

Also if you're using Javascript, please don't use eval();
>>
>>55903398
OSX. Because it has a unix terminal and a nice desktop environment, and you're not wasting hours chasing stupid fucking quirks and edge-cases like in Linux.

Also because work provides Macbook Pros.
>>
>>55903479
Seconded.
>>
>>55903433
Jamaica.
Applied for a J1-Internship in the US, hopefully I get placed in a dev company.
>>
>>55903398
OSX on my desktop hackintosh and xubuntu on my laptop because I'm too poor to afford a macbook
>>
Not sure what to make of react's iconoclastic approach to accepted best practices. I understand the notion that js and html are inherently coupled, so to ignore the separation of these concerns makes sense.

Inlining styling looks like shit and feels awkward as fuck to write.
>>
>>55903505
>Jamaica.
Yeah good luck anon.
>>
I want to get a junior web dev job. Do I need a degree, multiple years of experience, or both?
>>
>>55878332
what Jquery is so easy and helpful why dont you get on my fucking level
>>
>>55903786
I had both and I got a "experienced full stack web developer" position
>>
>>55903786
all you need is to know some buzzwords and say you like computers and stuff, and a portfolio full of other peoples work that you copy pasted to your site. If they ask you any technical questions just say "I use emacs." literally a foolproof strat to becoming a web dev, and if you disagree, prove me wrong.
>>
>>55903786
I have neither a degree nor years of experience and got a webdev job.

Though I have been programming as a hobby for over 10 years, so I can sit and talk to people about automatic computing machines.

Quick, without Googling, what's the difference between composition and inheritance?

Also knowing how to Google things is important.
>>
>>55903937
>prove me wrong.
ran this strat on numerous companies; even small time webshops ran me out laughing.

crucial flaw in the meta: emacs. everything went fine until i said that. i was always informed via email that they were looking for someone who uses vim, or maybe even atom, but not an emacs shitter like myself.
>>
>>55903937
>lie to get a job you can't do.

My work once accidentally hired a guy who didn't know what a for loop was.

He's not there anymore.
>>
File: 732034_42845cd_900x2999[1].jpg (211KB, 900x598px) Image search: [Google]
732034_42845cd_900x2999[1].jpg
211KB, 900x598px
I set up a localhost on my Thinkpad that has Ubuntu on it. My desktop is running Windows 10. I want to be able t write my code on my desktop, but I need access to the localhost in order to run and test my code.

Is it possible to write code on my desktop and test it on my desktop while having my laptop host?
>>
>>55904026
rofl I'd be worried about working for a company that didn't catch that in the hiring stage. I guess he was one of the higher ups friends son or something.
>>
>>55904103
set up a samba share and edit from there or set up a grunt/gulp watcher that pushes files to your laptop when they change.
>>
>>55904103
https://atom.io/packages/remote-atom
>>
>>55904103
Any sauce on pic
>>
>>55904103
http://Browsersync.io

On another note, are those triplets?
>>
>tfw spent a whole day trying to fix some "bootrun failed" error, all because for some reason I can't git stash apply files that I changed and everything fucked up after a pull, deleting all the changes, including those that were crucial for server to run on my machine

Why is this such a pain...

Even git pull is telling me I'm up to date when it didn't add any new changes at all.

Idk man, this shit is literally harder for me than it was in programming classes.
>>
I just started learning front-end, so don't be mad, famalams. I'm writing a code in SCSS using SASS to make it CSS. I'm also using Bootstrap and JQuery. From what I know
@include make-col;
Should work thanks to Bootstrap and SASS, but I have a feeling that I'm making some rookie mistake. Solution is nowhere to be found on stackoverflow and other sites. Help me, /g/.
>>
>>55904173
>>55904220
no clue just googled big tits
>>
>>55881883
>>55882615
cheers
>>
What's the difference between a frontend dev and web designer? Web designers also have to know how to code, right?

Does anybody know how much the salaries differ between those? I am thinking a little bit if I should maybe get some job as a designer if I can.

Suprisingly, everyone thinks I'm a professional designer when they see my html+css work, and if some opportunity rises, idk if I should accept it. That thought just hangs around my head because I realized that programming is not really for me, at least not backend dev. I was always more creative person than technical in the past and I don't want to throw that down the river.
>>
>>55904616
>What's the difference between a frontend dev and web designer?

This is just a guess but I'd say frontend dev is more about using technologies like Angular, React, etc. in order to make the site as functional as possible while still making it look great; A designer is more concerned with the overall UX/UI composition of the elements.

Since you're more creative than technical I'd say go check out resources that teach you about UX/UI and design patterns.
>>
>>55904765
designers use cuckweaver, front-end dev's use their brains
>>
>>55901676
l-theanine
>>
>>55904823
Nice projection, my friend.
>>
>>55904823
Like clockwork, a shill shows up to tell us why he thinks X is better than Y.
4chan in a nutshell. Not even the classy expensive nuts like Cashews/Macanddamien either.
>>
File: 1453924678561.jpg (19KB, 402x498px) Image search: [Google]
1453924678561.jpg
19KB, 402x498px
>>55905142
>>55905144
found the cucks
>>
>>55904908
in combination with caffeine

I chew nicotine gum also to reward myself when I'm feeling fatigue
>>
>>55904103
As long as they're on the same (W)LAN you should be able to. Just type in the local IP of the machine that's hosting.
>>
>>55872377
Hey so I'm a Python hobbyist of 3 years, and now I'm experimenting with web development shit using the Flask framework, and so far I've gotten to to where I can get a form displayed on the test server using this html

http://pastebin.com/gacWhiGE

As you can see I have no idea what I'm doing. Never written HTML/.CSS before, but I've gotten the form to display correctly: I see the two input boxes and submission button.

Now, the real problem is: How do I get the names that the user inputs into the boxes and then perform the logic on them, and then return the new form? I have no idea what to do.
>>
Trying to create a video search engine using php and mysql. I have no idea how to or even where to start. Someone help?
>>
>>55906888

Read this section, and probably the whole document:
http://flask.pocoo.org/docs/0.11/quickstart/#http-methods

As an aside, you might want to do a quick run-through of an html tutorial and then redo your page and run it through an html validator. In particular, the <title> and <link> elements should be inside a <head>, and everything after that should be inside <body>, followed by </body> and </html>.
>>
>>55906975
Do you know PHP and SQL? If not, fix that first.
>>
>>55907171
I've done the tutorials but am trying to do this to practice. I know the basics. I'm not sure how to mix the 2 along with html and css and that's what's stumping me.
>>
>>55907288
>I'm not sure how to mix the 2
PDO

>along with html and css
Make an html file as normal, with css as desired. Put a form on it. Give it an action attribute that points to "/some_php_script.php". Now, make some_php_script.php in the webserver's root directory. put <?php on the first line. Now, when you submit the form, it will do whatever you put in the php file.

Presumably, you will want to pull the user's search query out of the form data and do an SQL query using PDO to return whatever matches that search query. Then plop those results into a results page and return it to the user. Then they can click on a particular result and it will return a details page about whatever they clicked on.

Then learn about SQL injections and how to protect against them. (Using PDO and prepared statements is a good chunk of it)

Finally, please be aware that PHP is a festering pile of dogshit surrounded by a trainwreck, which is, in turn, surrounded by a community of retards, crybabies, pajeets, and script kiddies who fight tooth and nail to make sure PHP is as insecure and outdated as possible. In short: it's garbage. Get rid of it.

Have fun.
>>
>>55907549
I mean thanks for the first part, but that ending was unnecessary. I'm trying to get a job down the line not impress a bunch of NEETs with my elite language
>>
File: 1445289536126.jpg (192KB, 800x1148px) Image search: [Google]
1445289536126.jpg
192KB, 800x1148px
>>55907867
you honestly should give up on php before you start to poo in the loo irl.
>>
>>55907977
that doesn't mean anything to me. I'm not racist.
>>
>>55907867
The only jobs you're going to get with PHP is wordpress shit and maintaining "legacy" systems. PHP devs also make less money on average than devs for other languages.
>>
>>55908066
That's okay. Just looking for work I can put on resume when I graduate with a CS degree. I also have this project for a website that I want to pursue.
>>
>>55908053
sorry, I didn't mean to assume your gender.
>>
>>55908082
Hey I don't want to throw bantz around. That's a distraction and I will not have any of it.
>>
Got roped into some web dev stuff... Are you guys seriously using JSON for everything under the god damn sun nowadays? Wtf happened to XML? Fucking web dev is full bandwagonning faggots, don't get me started on Javascript frameworks.
>>
>>55908132
json is superior to xml in readability, parsing speed, and filesize. XML is like a turtle climbing a cliff with only a pair of nikes.
>>
>>55908132
>XML
We actually have color TV now too, it's pretty neat.
>>
how do I create a comments section of a site in Javascript?
>>
>>55907153
Any tutorials you have in mind?
>>
                <form action="sqlscript1.php" method="post">
<input type="text" name="search" placeholder="search..."><br>
</form>


That's my form code. I'm creating a script that will call the column which is called through a search. I want to use the user input to match with an Id on my sql table. What would I put on the query after "SELECT "?

I have the script set like this...

              $sql = "SELECT " . (what goes here?)
>>
>>55908543
That's seriously basic SQL. You should go learn the fundamentals before you ask, or else you'll be back here every time you need to do something even slightly different.

http://sqlzoo.net/wiki/SELECT_basics
>>
>>55908611
just learning as i go. i figured it out and its something i learned a while back.
$_POST["blah"]


This is how I learn. I don't have a good memory so I have to go back a lot.
>>
>>55908633
i suggest finding a new career. jesus christ.
>>
>>55908673
I can't even!
>>
>>55908633
how old are you?
>>
>>55908714
forgot
>>
>>55908633

$blah = $_POST['blah'];

$query = "SELECT * FROM table_name WHERE column_name LIKE '%$blah%'";


I'll just assume you don't know how to escape post data and that you're not even using PDO.
>>
>>55908785
$sql = "SELECT " . $_POST['search'] . " FROM VIDEO_SEARCH";


just used this. haven't tried it out yet though. if this doesn't work ill do what you did and put the $_post in a var. that's all i was confused on. not on anything really related to sql. just the html part
>>
>>55906888
So I'm still not sure what I should be doing to display data on an html doc. So far, after much needed reading, I've learned how to efficiently display static HTML docs with nothing interesting on them but text and decorate them with CSS, but I want to have the user input text and have it reverse the string. No idea how to get the text still.
>>
>>55908500
you need a database my son
>>
>>55909111
Oh wait I got it!

So I can return the string that the user input in the textbox reversed, but now I have a new problem: trying to get that string to be displayed in another HTML document. Any ideas?
>>
File: artboard_2_copy.png (50KB, 800x600px) Image search: [Google]
artboard_2_copy.png
50KB, 800x600px
Was looking for something cool to make and came across this which inspired me. Pretty sure I could make this interface in a few days but I don't want to make it front-end only, I want to put something behind it but I don't know what.
>>
How would I go about referencing a video file through mysql and then playing it through the website?
>>
>>55872885
I removes a block content from the layout and makes inline content wrap around it, like the OPs text wraps around the OPs picture
>>
I did a git pull but my files didn't update. Now it says it up-to-date. What to do?
>>
>>55908066
You will however, have a much easier time getting said job, imo.

>tfw sat through technical interview for Ruby job, and a JavaScript job
>both of them went "actually that's one possible future, but for right now, we're looking for someone to maintain our PHP codebase"
>>
>>55911343

git reset --hard origin/master

this will make your branch exactly the same as the one on the remote
>>
i fucking hate chrome and google in general
>trying to do a basic mod for chrome (i.e., removing theme_frame)
>anything i look up for resources leads me to autocorrected results
>even when i put explicit quotation marks around it
i just came here to vent, don't worry
polite sage
>>
It took me two weeks to build a basic but stable and fully functional app that works on both iOS and Android. Did it with React Native.

If I were going for platform-native implementations I'd still be trying to figure out how to do shit in Swift and trying to Android configured to receive push notifications.
>>
>>55911343
Wrong branch?
>>
>>55911477

I know it's annoying but 99% of the time it gives better results.

If you want 'raw' results (not influenced by suggestions, your location, your history and profile) try DuckDuckGo and see how bad it can be.

Also Google doesn't ignore quotation marks unless it literally hasn't indexed anything with the quoted query, most of the time you just don't see quoted string in the page results, but click on the actual website and view the source, you'll see it there.
>>
>>55911460
>>55911502
I'm still new to git. I can't fuck up anything on the main master?

Ok I'll try that. And yes, I'm on my master branch and since I cloned the project I could just "git pull" it afaik.

Can I ask one more question?

Basically it was like this: I wanted to pull a new version and when I did git pull it said I should commit or stash before doing it. Since I was still working on my code, I did "git stash (think I added "--all", as I've seen somewhere on the internet)", after that I pulled. When I did "git stash apply" every single file returned a message like it already exists and can't be added, and in the end it said that it can't do it because of untracked files. So now I can't return my files as they were before stashing. I backuped most of them (only few files), but I forgot about some file with server properties that was important for me in order to get the server running, and I "think" I needed that one, since it stopped working now.

Since I can't stash apply, I lost that piece of code.

If I do "git stash list" are those really all the changes I did to files since cloning the project for the first time? Because if so, I didn't even need that one file because it is not listed here.

But I don't get it how can all those files be considered untracked when I didn't add any new file and they are supposed to be tracked automatically when I clone the project.
>>
Thoughts on TypeScript?

I've got a website which provides a lot of statistics and tools for a game, lots of XHR requests for modifying user data, etc, 3000+ lines of JS. One thing I'm concerned about with TypeScript though is final size of main JS file for the site, right now I'm just using grunt-uglify for size reduction. If I now redo it in TS, have that compile to JS, then uglify that, should I expect a significant increase or would it be roughly the same?
>>
can i become rich by coming up with a new idea for a website and building it? simple yes or no.
>>
>>55911460
Btw, I did this and it said it places HEAD on x, but the files are still unchanged. But actually, HEAD is placed on a commit that is not the newest one. How?
>>
>>55911693
>Thoughts on TypeScript?

It's a lot of effort to setup for a small and basic service.

At your size though, I think it's particularly good. The worst possible parts of JavaScript are when you start seeing functions take inputs that aren't immediately obvious, and Typescript resolves that.

You won't need to worry about filesize, the transpiler pretty much does its work at compile time and removes it.
>>
My head hurts every day after work.

Fuck computers.
>>
>>55909317
ajax ?
>>
>>55911680
Untracked should mean that not selected to be commited- can be new file or simply changed file.
>>
>>55908535
Check the OP. The codecademy html & css course is a pretty good intro.
>>
Hey op, you should probably remove linode from your list, they're pretty fucking terrible
>>
File: 1464043015141.jpg (16KB, 412x412px) Image search: [Google]
1464043015141.jpg
16KB, 412x412px
>>55875609
>ternary inside argument list
>>
>>55911444
>actually that's one possible future,

If they need a PHP guy, they need a PHP guy, but wow, what a douchey way to phrase that.
>>
Would ASP.NET MVC be overkill if I'm just building a REST API for a simple multiplayer game server? I'd be learning from scratch (except for already knowing C#).

My main worry is hosting it, last time I checked Azure was really expensive.
>>
how do i properly reference a local file for html on ubuntu?
>>
>>55913227
If you only know C#, you might as well go with it unless you're willing to learn something else. If you need a dirt simple REST API, Flask and Express are both pretty minimalistic, using python and js respectively.

There's not really any reason to host it on Azure unless you're just a hardcore Microsoft fanboy. AWS has a year free trial you can use, and after that, fairly reasonable. Google cloud is also comparable, depending on what you need. You can also get a digitalocean droplet for like $5/month, or use one of the 50,000 other companies no one has heard of.

>>55913275
What the fuck are you talking about?
>>
>>55913227
>>55913315

I almost forgot, if it's small you could potentially host your app on heroku or redhat openshift. They both have a free tier worth looking at.
>>
>>55913275
you mean this ?

>>55904326
>>
I'm trying to rename a file let's say 1.jpg to 1(timestamp).jpg, but constantly get:
rename(..\img\1.jpg,1(161331-040816).jpg): The system cannot find the path specified. (code: 3).

and the file 1.jpg is 100% there, also tried using __DIR__
I get the needed $id with ajax and :
    $timestamp = date("(His-dmy)");
$jpg = ".jpg";
$path = __DIR__ . "\img\\";

$newName = $id . $timestamp . $jpg;
$oldName = $id . ".jpg";

//echo $path;


rename(".." . DIRECTORY_SEPARATOR . "img" . DIRECTORY_SEPARATOR . $oldName,$newName);
>>
>>55909493
Store the link to it in the database. Like "http://mysite.com/videos/myfile.webm"
Then echo it in the video tags.
>>
>>55913227
New .NET core is platform independent so you can run it anywhere.
>>
>>55914170
There was function to convert relative paths to absolute, use it to test it.
>>
>>55913275
it depends on your web server

I presume you are using Apache? Stop. Learn node.js /w express.
>>
>>55908132
You are a retard.
>>
>>55904103
my VM software forwards the ports for me based on settings I configured but Im not using windows
>>
>>55914380
thanks, will look into it!
>>
>>55914869
Realpath
>>
>>55914895
ty, but still

rename(D:\xampp\htdocs\webdev\project\img\1.jpg,1(172553-040816).jpg): The system cannot find the file specified. (code: 2)
>>
>>55915002
Try absolute paths for both parameters.
>>
>>55915151
good idea, but still no
>>
Updated video for the meme tech you need to know

https://www.youtube.com/watch?v=sBzRwzY7G-k
>>
>>55909362
That's pretty nice, anon.

Do you have more concept art?
>>
>>55915237
FINALLY got it to work:

$path = $path = __DIR__ . "\img\\" ;

$newName = $path . $id . $timestamp . $jpg;
$oldName = $path . $id . $jpg;

rename($oldName, $newName);

But stumpled upon another problem: after the images get rename/archived, they can still be opened under
http://127.0.0.1/webdev/project/img/1.jpg
ctrl + f5 doesn't help. I will try to force some reload with cache in the function.
>>
  var locationinfo = $.getJSON("http://ipinfo.io/json", function(data) {
return data;
});
console.log(locationinfo);


this is returning "Object { readyState: 1, getResponseHeader: .ajax/w.getResponseHeader(), getAllResponseHeaders: .ajax/w.getAllResponseHeaders(), setRequestHeader: .ajax/w.setRequestHeader(), overrideMimeType: .ajax/w.overrideMimeType(), statusCode..."

why isn't it just returning the target object?
>>
>>55914442
I swear this type of reply is the most popular on this board.

"X language is shit. Do Y."

At least state a good reason, you fucking hipster.
>>
I had the first commission purchase through my website yesterday!

It was, admittedly, a test purchase that I brought from a friend, but at least it worked. Now I just have to polish some shit, fix my description page, and then somehow try to market it. Oh, and hire a designer/frontend guy so I can stop making progress so slowly.

So I still have a shitload of work to do, but at least it's progress.
>>
>>55916190
because getjson returns the jquery jqXHR object.

ajax is asynchronous, look up on how callbacks work.
you want
  $.getJSON("http://ipinfo.io/json", function(data) {
console.log(data);
});
>>
>>55914256
can you give an example of how to echo through video tags?

Also I'm on Ubuntu. How do I properly write the filepath into the column in the DB table? You know in windows it has c: http//// or w/e. In Ubuntu I drag the folder to the terminal and get simply /user/public/folder/thinginfolder.mkv. Would that be fine?
>>
>>55916326

I'm trying to store the object to a variable, could I do that with the .success callback function? currently I'm only succeeding at logging the object to the console from within the getJSON statement, haven't been able to store to var at all
>>
>rent goes up 10%
>15 cent raise after a year at shit job
>no one will hire me


Guess I'll just keep making websites until someone takes me on board. My little dinky website with 5k weekly views isn't good enough compared to the canned websites that CS students made that one week they read a paragraph about HTML and followed a tutorial back in year 1.
>>
Is there a better way to do this?

http://codepen.io/anon/pen/JKmbyW
>>
>>55916371
What language are you using?
Are you accepting videos from users or are they static videos you're linking to?

When the user uploads a video, save the name of the video file in the database and move it to a folder (lets say thevideos folder).
When you're ready to output it, select the name of the video from the DB and store it in a variable, then use that variable in the <video> tags.

<video width="320" height="240" autoplay>
<source src="videos/<?= $video_link ?>" type="video/mp4">
</video>
>>
>>55916633
What's the reason this won't work?


<video width="320" height="240" autoplay>
<source src="user/video/etc/etc/etc" type="video/mp4">
</video>



src being an actual file path.

Using php and sql
>>
so if I'm doing a jsonGET first to get my latitude/longitude, then once I have that I do another one to get the current weather at that location, do I just nest the second jsonGET in the callback of the first one?
>>
>>55917025
or is there a way to have the second jsonGET to wait for a "success" from the first one?
>>
>>55916985
Because then the user's browser is going to look at user/video/etc/etc instead of whatever URL you're serving the video from.
>>
>>55917045
>>55917025
If the second jsonGET depends on the first, yes. If it doesn't, you can use Promise.all to send both requests at once.
>>
>>55916985
Because browser can't access your files. You must make your webserver serve them.
>>
>>55917455
>>55917480
Ohhh duh! So I'd do this by referencing through a DB?
>>
>>55917467
thanks, yeah the second depends on the first. nesting it is
>>
How to open a pop-up window without cache ?

>>55917551
just make a /videos folder in the root of your project and store them there.
>>
>>55917613
>>55917551
also. like anon said before, store the names in the DB, then use them to reference /videos+videoname.mp4, echoing video tags around it.
Thread posts: 328
Thread images: 22


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.