[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: 325
Thread images: 19

File: 1469120068052.png (868KB, 822x552px) Image search: [Google]
1469120068052.png
868KB, 822x552px
Previous >>55740568

> 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/
>>
/wdg/ what is your opinion of hamburger menus in desktop sites?
>>
How can I display a table column which basicallh just acts like a row counter (not id) using ng-repeat? I can use $index+1 e.g., but the problem is that there are multiple pages because the table is too long, so when I change a page with angular, $index starts counting from 1 again. Can't use id's because those change, just need a simple row counter that keeps the current position when I switch to another page.
>>
>>55777387
Don't do that if you have enough space and are doing it just for the looks.
>>
>>55777777->
>>
>>55777400
>table
>basicallh
>ng-repeat
>>
File: 1416852085957.png (193KB, 637x517px) Image search: [Google]
1416852085957.png
193KB, 637x517px
W-we're all gonna make it...
>>
A while back I created a wifi hotspot mapper, but I kinda realized it eats data like crazy. The data-payload starts getting in the megabyte range after only about an hour of use. (polling a complete list of wifi hotspots, with detailed info about each hotspot, every 10 seconds, and associating it with your geographical position and time-index)

So today I decided to take the wifi hotspot mapper, and reduce it to a mere geographical position logger. Which logs your position over time. And nothing else.

But now it is pretty light-weight, and can be used to map out my drives. And I like driving around quite a lot, so this is pretty cool for me. I never have to worry about getting lost, or forgetting which way I came, because now I have my own webapp to keep track of it for me, and its light weight enough that I don't have to worry about how much data I'm storing

I can't wait to conduct more drives with my position logger
>>
>>55779158
oh, and I wrote a little something to keep reminding me what my laptop battery level is at. If it doesn't print to console, then i'll forget to check, and my laptop will die on me.

So now I have it printing to console so I'll keep seeing it
>>
Any advice on this use case?

I'm building a fantasy football clone webapp. It will be barebone af, only using openresty+postgres for now + plain html/js/css for frontend, no frameworks.

I have my tables set up e.g, users, players, teams. I have this use case:
players can see any team going to a url like
../team/{team-id} but can only edit a team if it is their own.

1. I guess I need something conditional in my js based on some kind of session information to only add relevant html someone is browsing their own team e.g. can't POST a new lineup from the UI

2. Restrict not to access the API by creating requests with e.g. curl

Is this the right track? Can I achieve this by picking a nginx session module?
>>
>>55779295
<?php
function renderTeamInformationTable($team){
/* someone else will have to write this because I don't know shit about sports */
}
?>
<?php
$user = (isset($_REQUEST['user'])) ? $_REQUEST['user'] : die("need username");
$pass = (isset($_REQUEST['pass'])) ? $_REQUEST['pass'] : die("need password");
$lnk = new mysqli('localhost', 'my_user', 'my_password', 'my_db');
$escaped = (object) [
"user" => $lnk->real_escape_string($user),
"pass" => $lnk->real_escape_string($pass)
];
$resultUser = $lnk->query('SELECT * FROM `fantasy_users` WHERE `username` = "'.$escaped->user.'" AND `pass` = PASSWORD("'.$escaped->pass.'");')->fetch_object();

if ($resultUser){
$_SESSION['authenticated'] = true;
$_SESSION['user'] = $resultUser;
if ($resultUser->{'teams'}){
foreach($resultUser->{'teams'} as $team){
renderTeamInformationTable($team);
}
}
}
else {
$_SESSION['authenticated'] = false;
}
?>
>>
>>55779295
or you can just use openresty or whatever (i'm not familiar with this technology).

- The basic idea is just to require a user to authenticate themselves
- associate user data with a session/cookie/token
- somewhere associated with the user needs to be an array of names of all the teams they are a part of.

Then you show the data/markup for each team.

-------------

DO NOT think of it as "having all the teams, hiding the ones that are not relevant to this user"

DO think of it as "having a user, showing all teams relevant to the user"
>>
>>55779492
>>55779574
appreciated, thanks
>>
>>55779295
>fantasy football clone webapp
why is this such a common idea lately
>>
I'm starting a web design and development course in September, anything that I should expect?
>>
>>55779492
WOw, PHP is disgusting
>>
>>55780440
outdated information
>>
>>55780360
It will be more like a general manager game, but generally it is fun, easy, football is popular and exploding, if it becomes successful you might get some dosh in return.
Not that I'm seeing it everywhere.
>>
>>55780611
Really? The uni i'm going to is pretty good and they have really good technologies, the teachers seem to be very good and well informed.
>>
>>55779492
STOP. Go fucking learn how to use PDO instead of mysqli. It'll only take you two hours.

Secondly, define your connection data somewhere else then include it. That way when you make the switch from development to a production server and you need to change the password/user you only have to do it once.

Third, you don't need to section off your code into multiple <?php tags. Use one tag and if you have nothing but PHP in that file you do not include a closing ?> tag.
>>
>>55780440
Pajeets and SJW
>>
>>55780689
Academia for Convocationals are always behind unless your school has proper R&D or an Open Source program
>>
>>55780901
I am aware of this, I am into 3 years of diversity dindu hell. The uni im going to is very liberal and trying to push multiculturalism. Its just that this uni seems to be the best for web development and networking. Then im straight out of the country to find a job somewhere more white.
>>
>>55780446
Because that is beginners code.
>>
is there any cheap + reliable paas for Symfony applications? I like platform.sh but their PHP version is older than my last entry in the "I had sex"-log and they are too expensive.
>>
>>55781492
You can probably self teach yourself more than you'll learn in that course in a shorter period of time.
>>
>>55782604
And hand himself a degree at the end too, right?
>>
>>55782953
Because degrees are so useful, right?
>>
>>55783297
A degree might not teach you much, but it will look better than not having one when you are attempting to get out of your parent's basement.
>>
>>55783297
Indeed, they are. Not having one won't close any doors, but having one will surely give you an advantage.
>>
>>55777400
>another page

What is this, not 2016?
>>
File: domains.png (25KB, 1039x335px) Image search: [Google]
domains.png
25KB, 1039x335px
what should i do with these?
>>
>>55784302
Those are terrible + .xyz.

Let them expire
>>
>>55784302
Obviously make websites about weeb shit

>>55784311
xyz is good enough for google
>>
>>55784476
i bought them but i dont know how to do web stuff, im struggling with making a homepage for firefox
>>
>>55784512
Why did you buy them then?
>>
>>55784553
they were on sale
at the time i thought "ill learn and make a cool site"
and i just started the introduction page at w3schools an hour ago
>>
>>55784553
>Buy some shitty domains
>low key advertise them on Tibetan yak breeding enthusiast sites
> ?????
> Not profit because .xyz namespace is still wide open and dirt cheap so nobody wants them
>>
>>55784575
w3 is outdated shit, start with one of the resources in the OP
>>
>>55784575
avoid w3schools as much as possible, all the shit there was copypasted from stackoverflow answers

if you need documentation use https://developer.mozilla.org/en-US/
>>
PHP hate aside, is Drupal still the best free CMS for developing sites?

The custom post types of Wordpress look incredibly limited and I'm unfamiliar with other systems.

Without writing code, can another CMS provide:
>Custom image cropping selection for users
>Youtube parsing
>Automatic geocoding and mapping layer
>Apache Solr integration for granular search
>Complete control over custom data types and fields
>>
>>55784624
>>55784648
im looking through them currently, and w3 is in the learning material anon. shouldn't OP take it out?
>>
Fuck django-formtools, I can see why it's no longer part of the core library
>>
>>55784663
Fuck, you're right. The idiot even copied only the YT titles. This is what happens when you let a faggot create the thread.
>>
>>55784663
>>55784681
I made a new OP like a month ago with updated links, but some fuckass keeps using the old version
>>
>>55784650
No, Drupal is a bloated piece of shit. Wordpress isn't limited at all.
>>
If you HAD to choose one, React or Angular2? Angular1 is not an option due to the inevitability that support drops for it completely sooner than 2
>>
For a non-real time app that deals with user submissions and relies on geospatial data, should I use PHP (easy and fast) or Node.js (What DB? Mongo? Redis?)
>>
>>55784766
I've developed custom Wordpress theme so I know a little about it. I don't care if it's "bloated" (which usually just means flexible), I care about how long it takes me to develop the website.

If Wordpress isn't limited, how would you (for example) add a custom field which is an image (restricted to JPG/PNG less than 400KB), which lets the user dynamically crop it on screen, and then you create a thumbnail scaling on the x axis. All without writing any code.

If it can't do that, it's limited in comparison to Drupal.
>>
>>55784792
React, but neither is an awful option.
>>
Is it worth switching to Angular or React from jQuery?
>>
>>55784806
Without writing code? Use the ACF plugin.
>>
>>55784829
pretty sure they go hand in hand, I know that angular at least requires jQuery (an older version though, 2)
>>
>>55784720
post it
I'll make the next thread with it if I'm here
>>
>>55784804
Why does everyone jump to meme databases like Mongo?

Just use a proper ACID database like Postgres. I think people underestimate how much data and speed you can get out of a standard Relational Database. Without the limitations.

As for language, whichever you're familiar with. If you don't know anything, I'd pick Scala.
>>
>>55784839
Doesn't offer cropping
>>
>>55784853
>Why does everyone jump to meme databases like Mongo?
Same reason people jump to meme frameworks.
>>
>>55784829
totally dfifferent things, with completly different objectives
>>55784846
>I know that angular at least requires jQuery (an older version though, 2)
wrong on all levels, uyou are probably thinking about the bootstrap js/extensions which requires jquery (there are native angular syntax only "ports" though, angular-ui-bootstrap so that you dont mneed to include jquery on a angular project just because of bootstrap)
>>
>>55784885
So you little want to do 0% amount of coding? It's called Web Development for a reason.
>>
>>55784911
I was just curious what other powerful CMS systems there are.

I don't mind coding, but I don't wish to spend 20 days developing a site in a CMS when another could do it in 10.
>>
>>55784829
All three of those things are completely different. Angular is an MVC framework, React is just the V, and jQuery is a common general purpose library.

>>55784847
It's on my other PC, but I'll reply to this post with it later when I get a chance later if I don't forget.

>>55784853
Mongo is popular because they market the MEME stack bullshit to noobs and then they enter the workforce thinking it's a real database.
>>
>>55784650
Drupal is good if you want more than a blogging platform where users can register and post content themselves.

Like >>55784766 said, it's slow compared to WP, this is where cache comes into play and can make it as fast as WP and offer a lot more in terms of customization.

Use Drupal 8 if you're going to use it.
>>
>>55784977
Wordpress has a cache too though.
>>
>>55785017
Sure, but once you're serving cached pages it doesn't matter which backend you're using and should use the one that suits your site the best.
>>
What's /wdg/s preferred method?

Say we were to build a login system. How would /wdg/ go about it? I know there's no right or wrong here. I've done this before but I'm interested in other peoples views.

Server side languages like PHP, etc offer session functionality. I understand when creating a PHP session you are telling PHP to store a cookie in the users browser, it would use the value of that cookie to relate to some data stored on the server, these being the session variables you created.

On the other hand, you might prefer to skip PHP sessions and create your own method of keeping track of login session. Say you generated an access token, a random string of characters, etc. Then storing this in a data base, and then setting it as a cookie in the users browser, however you wanna do it, hashed, etc, so long as the server can read that cookie and relate it to a an access token value in the database that relates to a user.

What are the advantages and disadvantages in your opinions of using either methods.
>>
>>55785204
I've written custom systems with PHP, and just used the phpass library for hashing passwords in the db (bcrypt implementation) and PHP Sessions.

>create your own method
Only if you know what you're doing. Read this https://stackoverflow.com/questions/549/the-definitive-guide-to-form-based-website-authentication
>>
>>55785204
my preferred method? use a framework with login and auth api because there's no point in doing that yourself in this day and age
>>
>>55785307
>phpass library for hashing passwords in the db (bcrypt implementation)
What's the point of this when password_hash() exists?
>>
why the fuck is stroking 20 circles in a canvas slower than filling hundreds?
>>
God I hate Cloudflare. It's timing out again, when using the IP loads the page just fine. Wish there was some better free solution.
>>
>>55785448
password_hash only existed since PHP 5.5, I was making sites before that.
>>
>>55784804
Use postgres. You can store objects as Json blobs and write sql queries against said blobs. No need for meemgodb or cache storing shit in redis
>>
>>55777400
Use react. Ng wasn't meant for large scale data.

I can't be bothered to find it but there was a guy who glued react together with ng so that you could render massive amounts of data real quick, while still keeping ng in the loop. Could always try that
>>
>>55783369
This
I would rather a degree to show off to employers.
I'm still not 100% on the course or whether I should do networking and just get a job building and maintain a network.
I can change if I realise in the first term that I dont enjoy the course.
>>
>>55785204

using a nodejs server I would use passport + restify for the backend

front end, would use angular 2, or react + fetch and a css library like bootstrap or basscss
>>
>>55785667
Thing is that this is a project from a place I intern in and I can't control it. I know it's deprecated and the amount of bloat is amazing. Literally everything that could be made with angular was made with it, even css bootstrap has some angular framework on top of it.
>>
>>55785758
You could try to find work WHILE working on the degree. I'm actually planning to finish up my degree this next year after taking a 2 year break. I've been freelancing off and on the past year and a half, so I'm just going to continue doing that while taking courses.
>>
>>55785204
I'd install Devise and be done with it in 30 seconds.
>>
>>55777387
A button that says "menu" wins in all usability tests. Hamburger and kebab menus are garbage on any size device.
>>
>>55786638
>kebab menus
What are kebab menus?
>>
File: kebab-menu.jpg (245KB, 1084x768px) Image search: [Google]
kebab-menu.jpg
245KB, 1084x768px
>>55787070
>>
Hey guys I'm learning web development

Is Phoenix/elixir worth learning or should I learn the standard web stack?

I'm really liking Phoenix because it's functional and I hear erlang is a beast
>>
>>55787697
If you're just doing it for fun, go for it. Not a huge amount of erlang jobs around though, especially outside the bay area.
>>
>>55785537
It's actually existed some time before that
> https://github.com/ircmaxell/password_compat
>>
File: niggers.jpg (25KB, 638x479px) Image search: [Google]
niggers.jpg
25KB, 638x479px
>>55787070
>>
>>55787697
If you're just learning I'd go with Rails. There are a lot of Rails jobs, there's a lot more documentation, third party packages exist for almost everything, and Rails is a huge inspiration on Phoenix. Several of the Phoenix developers are also Rails core developers.

I know both and I'd still use Rails in most cases because the community is so much bigger and it's still much faster than anything at getting a website up and running and features implemented.

If you're already experienced at web development, are just doing it for fun and don't mind reimplementing a lot Phoenix is a good choice.
>>
>>55784650
Developing on WP is very basic- there is usually way to add needed functionality but anything advanced will quickly become very complicated and hackish. Also very bad codebase.
Drupal is very powerful and good code but you are expected to adapt Drupals way of thinking what usually means plugin for everything, a lot of configuring in admin and learning million different APIs.
>>
>>55784911
In Drupal you are expted to install plugin and configure needed functionality out of it. Good if you are beginner or nonprogrammer.
>>
>>55787860
oh I hate kebab menus

hamburger and bento are okay, though I agree with the anon that said just having the text is best option.
>>
Will an app using the node.js built in http module hold up under low-mid usage on its own? Or should I definitely always put it behind nginx or something?
>>
>>55788264
What do you consider low-mid usage? In general, people stress way too much about server side performance when it will never, ever be an issue for 99.9% of all websites. I have a $5/month server on Digital Ocean running an RoR app that regularly needs to handle about 1,500 requests per second with no caching and I've never had a problem with it.

I'd always serve the static assets with nginx or put them on a CDN though.
>>
>>55787860
>Double Hamburger

Stay classy, America.
>>
>>55788380
I guess what I wanted to know was how much usage can a minimally built node server take before I seriously need to start dealing with caching and whatnot, but based on your numbers it sounds like I should be fine.
>>
>>55787697
>Is Phoenix/elixir worth learning

no lol
>>
>>55783297
I might as well wipe my ass with mine. It would be just as useful.
>>
>>55789939
Phoenix is great.
>>
File: i3eVTJm.gif (3MB, 365x273px) Image search: [Google]
i3eVTJm.gif
3MB, 365x273px
>Work on website
>Push up a major update
>Just have to test out the payments system in production and polish some stuff before I can try to do a real release
>Family vacation sneaks up on me
>Leave for it for two weeks, have a good time
>Time to leave
>Already made plans to test site out with some buddies when I get back
>Suddenly, flight issues
>I am not stuck in New Jersey until Saturday
>Can't test out the shit I want to in person
>Website launch is delayed
>I will most likely be just starting college up again when launching, so I'll have to deal with all that stress and getting acclimated to my new classes

Jesus, webdev is suffering even when you aren't programming in horrible languages like JS.
>>
whaddap

I'm looking for a hosting service that can handle about 5000 simultaneous visits.

I'm in Chile if that makes any difference.

Can anyone reccomend?

Cheers
>>
>>55790606
AWS
>>
>>55790286
You sound like a little bitch. Stop whining and get it done.
>>
>>55777188

Do any of these links teach how to use Dreamweaver?
>>
>>55790819
looks nice, thank you.
>>
>>55790819
seconded.
You don't even need to learn to use the CLI.
>>
can someone explain how you would program something simple like space email

basically just takes in messages and chucks it in a pool of messages and any other user can pick a random message and it deletes it from the database and gives it to the user

first time using node.js and it seems like theres a billion damn data-base solutions when I just want something simple. maybe just saving it all in one "messages" file
>>
>>55781520
Exactly, PHP is strictly for beginners to learn web development
>>
>>55784650
Ghost
>>
>>55791477
It shouldn't even be used for this anymore. It's a relic of the days back when ASP.NET was a popular server backend. There's no use case for PHP that Ruby or Python wouldn't be better for.
>>
>>55791544
Are there any popular .net backends now? I've always had a soft spot for C# because it was the first programming language I really learned (thanks to XNA).
>>
>>55792131
Not that I know of, but I'm at the far hipster end of the dev spectrum so it's not something I would be intimately familiar with anyway. C# is a sweet language though, what Java should have been.
>>
>55792196
Nancy sounded interesting, but I haven't looked into it much.
https://github.com/NancyFx/Nancy
>>
File: 1461714769523.jpg (44KB, 1080x717px) Image search: [Google]
1461714769523.jpg
44KB, 1080x717px
>front-end shop sends you a mock-up to do as a test
>the mock-up doesn't match the dimensions of any viewport in existence
>>
>>55792402
That's part of the test
>>
>>55792450
So how do I get "pixel-perfect" on something that I have to completely change from the get-go?
>>
>>55792554
Did they actually say pixel perfect? I would assume it's just a general layout. If not, just put everything in a div or something with their requested size?
>>
>>55792751
Has to be pixel-perfect, responsive to tablet and mobile, and has to use Bootstrap.

Also gradient overlays, parallax effects, and image pre-loaders. Just kill me.
>>
>>55792891
what the fuck stop crying and just google how do do all of those things

front end anything is piss easy
>>
File: 1371216656493.gif (119KB, 320x600px) Image search: [Google]
1371216656493.gif
119KB, 320x600px
>>55793544
That's great maybe while I'm at it I'll google "contradictory instructions"
>>
File: FU.jpg (57KB, 640x430px) Image search: [Google]
FU.jpg
57KB, 640x430px
>>55793568
If you want to make it anywhere in the industry you have to deliver on impossible and incomprehensible requests regularly.
>>
>>55793589
>t. weeb perma-NEET who wandered in here from /dpt/ explicitly to shitpost
>>
>>55777188
So I just started using Octopress and I was wondering what you should do in order to update a site already hosted on github. Do you deploy and then push changes to source?
>>
>>55793638
Octopress won't run on Github like Jekyll does, so you have to push the HTML output to your gh-pages branch or github.io repo
>>
So do you guys consider frontend easy or not?

I realized I actually don't know shit about backend, even though I had classes in databases and backend languages, because I never really practiced it. Everything now seems overwhelming about it.

Everything I did with frontend wasn't really hard to do (and if it was, it was because I was just stupid), it was just annoying. I see that backend guys can usually do frontend too, except they are not that good with html+css specifics and definitely bad at design.
>>
>>55794116
The only time anything is hard is when the documentation sucks and there are no examples anywhere so you are literally forced to do trial and error to solve your problems. Otherwise you just have to either brush up on your google skills or your reading comprehension to RTFM
>>
I'm just starting out. I'm trying to get my PHP to enter records into my database.

$con = mysql_connect("localhost","LoginAcc","password");

if (!$con) {
die('Could not connect: ' . mysql_error());
echo "Not Connected";
}
else{
mysql_select_db("signup", $con);
echo "Connected to DB";

$email = $_POST["email"];
$password = $_POST["password"];

$query = "INSERT INTO `accounts` (`ID`, `Username`, `Password`) VALUES (NULL, '$email', '$password');";

mysql_query($query);


That's what I've got and for some reason it won't even give me the "Connected to DB" or "Not Connected messages". Can someone help me fix where I fucked up?
>>
>>55794228
we dont like PHP here
>>
>>55794351
Kys
>>
>>55794228
Mysql is deprecated, use PDO.
>>
>>55794351
Neither do I, although I figured it out now.

>>55794437
It keeps telling me that and I will figure out how. Thanks.
>>
>>55779158
same guy as before, I took another drive

God this is so cool

and my phone kept up like a real trooper. 7.5 fucken hours on the road, and my phone managed to not run out of RAM, while constantly recording my position, and updating my server

What you see in the pic is a re-draw of the data, based on a 'saved file' selection menu I just created a few minutes ago
>>
File: screenshot.jpg (417KB, 1700x760px) Image search: [Google]
screenshot.jpg
417KB, 1700x760px
Got a problem with changing values in string (in Wordpress Content) when importing, got this functions:

function replace_content_safety($safety) {
$replace = array(
"1" => "Alarm",
"2" => "Airbag",
"3" => "ABS",
"|" => ", "
);

$safety = str_replace(array_keys($replace), $replace, $safety);
return $safety;
}
add_filter('the_content','replace_content');

function replace_content_comfort($comfort) {
$replace = array(
"1" => "Air conditioning",
"2" => "Radio/CD",
"3" => "Head-up display",
"|" => ", "
);

$comfort = str_replace(array_keys($replace), $replace, $comfort);
return $comfort;
}
add_filter('the_content','replace_content');

1,2,3,etc...

But the functions are in conflict, any ideas?
>>
>>55796424
Are you sure you are setting right function as filter callback?
>>
File: 1469507071601.jpg (82KB, 736x883px) Image search: [Google]
1469507071601.jpg
82KB, 736x883px
What's the best way to find customers as a beginner freelancer?
Obviously I won't stand a chance on major freelancing platforms, since everyone seeks freelancers with lots of stars and reputation.
>>
>>55796455
>Are you sure you are setting right function as filter callback?

Actually i'm not sure, 'the_content' applies to all content (i guess?) but I don't really know how to limit it only for exact strings placed in shortcode
(for example {safety[1]})
>>
>>55794228
Define your connection details in another file then use require() to use it elsewhere.

If not you'll end up having to change details on every page if your server information changes.
>>
>>55790830
I am a bit of a bitch, you're right.

Thankfully I do have some shit I can do today.
>>
>>55796460
Networking. Find family, friends, or local businesses around you who are in need of websites.
You might have to lowball it in terms of asking price since you're just starting out.
>>
>>55796490
Ok, first figure out what the heck are you even doing. Second WP has shortcode API.
>>
How important is using a virtualized environment with automation?

Like Vagrant/Docker + Puppet/Chef/Ansible?

At my start up (four devs), even though we're using different environment, we just stage our commits to a test server to make sure it runs in production.

Never had a problem with incompatibility. Our VMs overkill for our size?
>>
>>55796460
It's extremely difficult. It's better to work at a 9-to-5 for a few years to gain experience and contacts, then go freelance. If you don't know anybody, basically you need to get yourself out there.

Find businesses with shitty or nonexistent websites and convince them that upgrading will make them more money. Knock on doors, make phone calls, go to business meetups, whatever you have to do to get in front of business owners.

Most of all, be aware that business owners talk to each other, especially in small towns. If you impress them with your work, and generally seem like you know what you're doing and can communicate well, they'll be telling their buddies all about it next golf game or at $localUpperMiddleClassOldWhiteGuyPub, some of which will contact you for more work.

Overall, it's important to know that freelance dev is essentially a sales job where you occasionally do some coding. It's usually made out to be a good NEET job, but you really need to be a "people-person" to make it.
>>
>>55796921
>Never had a problem with incompatibility.
Yet.

>VMs overkill for our size?
Imho, if you're doing a project with any kind of backend whatsoever you should be using docker or a vm, especially if you're devving on your own laptop. Frontend-only, the benefits are negligible. I always use docker even for my own solo stuff, just because it keeps things nicely organized.

Also, presumably your startup is planning on growing at some point, right? The likelihood that you're going to run into some 'works on my machine' issues increases exponentially the more machines there are. Containerizing and micro-servicing everything has its benefits.
>>
>pass the function in window.onload
>innerhtml text undefined (while it should be loaded at that point, since the function is called after everything is loaded)
>pass the function in settimeout
>innerhtml text is loaded

What is this shit? So during those few seconds that text inside of a tag is loaded, but it is still not there on window.onload.
>>
>>55791477
yeah in 1995 maybe

Now it would be like learning to ride a mutant 6-headed horse because youre just a beginner driver of cars.
>>
>>55797320
>innerhtml
That's innerHTML. Could be your source of problems.
>>
>>55797198

I actually use vagrant myself because I don't like all these projects clogging up my personal space.

But it's got a yuge overhead. If your platform has several services running at once, you'll need multiple VMs up, which isn't going to go well on a laptop. Which is why I can only work on one service at a time (e.g. the API, mobile app, analytics...)

Docker seems more lightweight, but can it solve the problem of everyone having an identical environment? From what I understand it uses some of the resources from the host OS...
>>
>>55797320
So youre a vanilla javascript cuckold fetishist and you think you mght have been memed. Well I can't ay its an uncommon story...

document.onload is what you want

but

window.onload is more widely supported

this is why you use jquery because $( document ).ready() just fucking werks. Don't get memed again, use jquery.
>>
>>55797479
>use jquery
Nice meme!
>>
>>55797479
>>55797462
No, you didn't understand. I didn't pay attention now in correct spelling of functions, but I don't have a problem with syntax and I also tried all vanilla JS and jQ on load functions but it still doesn't work.

It's like that text inside a tag isn't loaded yet, even though it is showed on a page, but after a few seconds I can get it without problems.
>>
>>55797479
>vanilla javascript cuckold fetishist
that's going on my CV
>>
>>55797509
Does your wife have a visible php/python tattoo so real devs like me can easily identify you in public?
>>
>>55797463

>If your platform has several services running at once, you'll need multiple VMs up, which isn't going to go well on a laptop. Which is why I can only work on one service at a time

Unless you're running on an old as dirt laptop or are allocating a ton of memory to each VM, you should generally be able to do more than one at a time. My old windows 7 laptop with 4GB RAM can run 3-ish ubuntu VMs (512MB RAM each) before it starts to be a problem. The same laptop can run probably a dozen docker containers though. (Obviously it all depends heavily on what you're doing).

>can it solve the problem of everyone having an identical environment?
That's pretty much the point...

>From what I understand it uses some of the resources from the host OS

Not to my knowledge. The way docker manages to be super lightweight is that if multiple containers are all based on an ubuntu image, for example, they'll all use the same ubuntu base image instead of a completely separate os instance for each container. It's all just as detached from the host machine as a regular VM is though.
>>
>>55794116
Everything is doable if you put in some effort.
Front end is easier to get into, but still very difficult to master (as seen by all of these shit designs, shit functionality, etc). Back end is harder to get into, but easier to master imo.
It's all just about what you enjoy doing more, as that leads to curiosity which leads to mastery.

That being said, both the front end and back end suffer from a whole giant group of fucking frauds giving shit advice.
>>
I was just reading some VPS tutorials and I noticed that usually very few things are suggested to secure your server.
Change your passwords, set SSH, fail2ban and maybe a firewall. But that's pretty much it.

Is Debian and Ubuntu secure that way? Should file permissions also be checked by default?
>>
>>55798017
You are assumed to not be a retard and run things as root. Generally, even fail2ban is excessive. Simply setting SSH to only accept keys is enough for mostly anything.
>>
>>55797463
>>55797810
>From what I understand it uses some of the resources from the host OS

In very broad terms, this is true, but not in any way that matters. Docker containers use the host OS's kernal, but supply their own bins and libs. They aren't exactly the same as full hardware virtualization with a VM, but an app inside a container can't get escape or anything. (If you found a way to do that, some people at Docker would be very interested and possibly have a comically large check to give you)

When running Docker on a non-linux machine, I believe it actually just runs inside a VM anyway, although I could be wrong on that.
>>
>>55798099
Alright. Sounds good. So things are fairly secure by default.
>>
>>55798168
Yes. I mean, you're still putting in some effort so it's not like you're just pressing a button and everything is in tip top shape, but yeah by default you are on the safer side.
>>
best way to learn html/css/js?
>>
>>55795408
Use polylines or something, that's terrible having a billion markers.
>>
>>55798992
The Odin project and FreeCodeCamp, and codecademy are all pretty good places to start learning the basics. Then, start doing some projects and google shit as you go when you get stuck.
>>
>>55796925
>It's usually made out to be a good NEET job, but you really need to be a "people-person" to make it

Brb loading my gun
>>
In JS, how do I automatically round up to two decimals the values of my floats?

For example:
var x = 2.0;
var y = 1.8;
var z = 0.1;

then x*y*z would return 0.36000000000000004 when I only want 0.36 to be displayed on the web browser.
>>
>>55800144
(x*y*z).toFixed(2)
>>
>>55777188
>>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"

Is the youtube link missing on purpose? I would like to watch it if anyone has it.
>>
>>55800266
the retard who made the thread just copied the OP, including the linkified youtube links

real links are here >>55685119
>>
>>55800281
Thanks!
>>
File: 1316297866563.jpg (190KB, 704x396px) Image search: [Google]
1316297866563.jpg
190KB, 704x396px
I can't believe what a nightmare mysql is. I keep getting an error related to a socket and there's apparently bazillion different things that can cause it. People say it's easy to digure out via error files, but my mysql error log is simply EMPTY. The official documentation just assumes you already know how mysql works when it explains how to set the program up... wo.

What a fucking mess. I can't believe s.t. like this is going to force me back to shared webhosting.
>>
>>55801406
it's as simple as doing apt-get install mysql.
you can tweak the config files later, but it'll work out of the box
>>
>>55801493
no it doesn't that program doesn't even exist in any of the repositories my vps came with.

I think I'm running mysql-server or something...
>>
File: 1469020793559.png (153KB, 1254x1138px) Image search: [Google]
1469020793559.png
153KB, 1254x1138px
Real life design question:

I want each user registering to my website to be part of a group.

How should the sign up process work?

So far I'm thinking...

Step 1: create a group
/api/group/new

Step 2: add user to group
/api/group/id/user/new

Step 3: make this user admin and lock it

From here all other users must be invited.

Any alternatives/caveats?
>>
>>55801517
Aka you got shitty vps you dont know how to configure.
>>
>>55801656
You should have install script that would create first user and group for you.
>>
http://www.nickkolenda.com/user-experience/

have fun, you will learn something
>>
>>55784853
Relational SQL DDBB all the way. 45 years of try and tested tech don't go away just like that.
>>
>>55801656
I think user creation should come first, and then force them to create/join a group before advancing any further.

Don't tightly couple user existence on group membership. You never know what changes you'll make in the future that this sort of structure could negatively affect.
>>
>>55784853
This unless you have a real reason to use Mongo or NoSQL, spoiler you don't, you should use MySQL or Postgres. Oracle if you absolutely need muh enterprise.
>>
>>55801916
Pretty much.

So I played around with the path to the mysql socket file just to test things.

Then I read that you canjust search of rall the socket files on the server. SO I did that.

It found the gibberish path I entered in the mysql conf socket variable, and a bunch of other sockets. There's no real mysql socket file though.
I chaned the path back to what it was before. Now it complains the socket is missing EVEN WHEN I WANT TO RESTART MYSQL.

This shit is cursed.
>>
What's easier to learn, react or angular 2?
>>
>>55802107
>i hate it because its new and intimidating
the mantra of /g/
>>
>>55777400
$index + (page * records-per-page)

just... wow
>>
I want a line of code that will dynamically select an element from a form on error.

The form can be ANY form.
I have the form ID. I know nothing about the element other than its type.

What is wrong with this line of code:
alert(jq(parentForm).find(":input:submit").id);


also, I'm using a jquery .submit(), and for testing, there's an alert. Why is it on failed submits, every subsequent submit alerts +1 times?

jq(document).on("click", function(event){
var currItem = event.target;
if(jq(currItem).attr("data-change-content") != "undefined"){
//alert(jq(currItem).attr("data-change-content"));
switch(jq(currItem).attr("data-change-content")){
case "change_stylesheet":
break;
case "change_display":
if(jq(currItem).attr("data-toggle-this") != "undefined"){
//alert("Will toggle: "+jq(currItem).attr("data-toggle-this"));
jq(jq(currItem).attr("data-toggle-this")).slideToggle("slow", "swing");
}
if(jq(currItem).attr("data-hide-this") != "undefined"){
//alert("Will hide: "+jq(currItem).attr("data-hide-this"));
jq(jq(currItem).attr("data-hide-this")).slideUp("slow", "swing");
}
break;
case "ajax":
//preventDefault();
//alert("AJAXes soemthing");
var parentForm = jq(currItem).attr("data-ajax-this");
alert("This AJAXes: "+parentForm);
jq(parentForm).submit(function(event){
event.preventDefault();
//alert("submitted at: " + event.typeof);
alert(jq(parentForm).find(":input:submit").id);
})
break;
default:
//do nothing;
//alert("nothing");
}
}else{
//alert("Does not change anything");
}


For reference, I wanted to automatically focus on the submit button for testing purposes, but I noticed I couldn't.
apparently, the id is undefined (it's not. in this case, it was loginSubmitBtn).
However, on alerting, every subsequent submit pops THAT alert up +1 times. Why?
>>
Could we actually make a MEME stack?

MongoDB
Ember
Meteor
Erlang

Create a viral marketing campaign and charge $200/hour for consulting.
>>
>>55802403
React is just a view framework, it's not really that complicated. Angular is a full MVC framework with a lot of ins and outs to learn about.
>>
>>55802610
I got cancer from this.
>>
>>55802403

They have different purposes.

React and the V in MVC. It's just a front-end framework.

Angular is a JavaScript application framework which I would stay the fuck away from. The added complexity has nothing little to show for itself. It's also slow as hell if you're doing anything serious with it.

Go with React and use something like BackBone if you really need a JS framework.
>>
File: cat detects faggotry.jpg (117KB, 435x750px) Image search: [Google]
cat detects faggotry.jpg
117KB, 435x750px
>>55802610

>that code
>>
>>55802671
>>55802725
Except the fact that it pops up the alert box multiple times and doesn't find the button as a subelement of the form, it does work.

so what is so cancerous about it?
and how do I go about fixing those 2 known errors so when it actually submits it doesn't try to submit (x) times..?
>>
>>55802649
Python
Ember
Powershell
ECMAscript

The rarest of frameworks
>>
>>55802657
>>55802707
I've actually been learning react and I have no idea what's going on. I suppose I need to learn the MVC pattern first before I delve into these frameworks.
>>
>>55802775

>what is so cancerous about it

>not using dollar
>jq(jq(currItem).attr("data-toggle-this")).slideToggle("slow", "swing");
>leaving in commented code
>not closing the click listener
>!= and not !==
>>
>>55802610
did you try stepping through your code?
>>
>>55802610
>alert(jq(parentForm).find(":input:submit").id);

fucking why

just $(parentForm + " input[type=submit]").id;
>>
>>55802839
>not using dollar
in case I need to add multiple libraries...
>jq(jq(currItem).attr("data-toggle-this")).slideToggle("slow", "swing");
what?
>leaving in commented code
it'd take me longer to remove it for this comment. I'm not minimizing just so you don't have to look at comments
>not closing the click listener
didn't copy the whole thing. Missed it.

>!= and not !==
I use them both depending on purpose.

God, and I thought it was me. Nah, just a faggot on the internet.

>>55802867
>did you try stepping through your code?
I'll look through it again, but I think I'll just create a submit function.
Now that I think of it, it's probably because it's IN the click event...
I did a test on ("form").on("submit"), and it only happens once...
I'll finish later maybe
>>
>>55802947
you're even more retarded than the person you're replying to
just thought you should know
>>
>>55802947
alert("Submit button at: "+jq(parentForm+" input[type=submit]").id);
still shows undefined.

I think I'll just try making a separate submit function
>>
>>55802790
Fortran
Angular
Polymer
>>
>>55802790
>not being a full gay stack developer
Gentoo
Apache
Yii 2
>>
>>55802488
Figured it out already. Thx anyway.
>>
File: weowTape.png (6KB, 919x107px) Image search: [Google]
weowTape.png
6KB, 919x107px
Anyone have any ideas for simulating a line of tape memory?

I'm trying to make a visual indicator for what's going on in memory (in this case, literally just an array that can loop around itself to represent memory tape) as a program runs, but I can't seem to figure out a good looking and clear way to display exactly in which direction the tape is going.

Pic related is what I thought might work, but even with sizing each cell differently it's a little too hard to tell what direction the "tape" is moving in.
>>
>>55803537
Are you trying to accurately represent reading and writing to tape memory? Or are you just doing it as a loading icon or something? If the latter, just make a gif or css animation for each animation you want to display, and show it at the appropriate time.
>>
>>55803699
The former - it's meant to be a visual representation to help with understanding (and potentially debugging, I guess) what goes on in "memory" as a brainfuck program runs through my interpreter.
>>
Tempted to switch to Flask. Django is super useful especially when it comes to security and testing, but I feel like it like to fight against you when you try to modify the intent of some of its functionality
>>
So what I need is basically go through all the links on a website and see inside them (And at the same time check if inside the links are other links and repeat the process) trying to find specific words, is there any plug-in or snippet that does this?
>>
>>55803828
Yeah, google.com
>>
>>55803891
Automatically and efficiently* Also the sites where I need to do it are not even indexed by google
>>
How much would you charge for a website that generates pages based on user created content (posts) and has a unique functionality?
>>
>>55804134
Depends, what meme stack will you use?
>>
>>55804164
If you mean the tools used, right now I'm making a demo but they want a price for some reason and I haven't worked with a price before.

Just using php and mysql for the demo at the moment, but might change the database later on.

Also, it'll be generating html, css and javascript (if necessary).
>>
Been learning Express and Mongo, and I got a basic idea of how the backend is made with these two frameworks. Do PHP/SQL work similarly?
>>
>>55804496
They do the same thing generally speaking, but the implementation is very different.
>>
So I need a chat box system that is persistent, and tied to the page its on. The site just generates new pages with random filenames, so right now Im thinking Ill just embed an IRC client and make it open a room with the same random name as the page. Dunno how well that's gonna work though.
>>
>>55804739
W E B S O C K E T S

E

B

S

O

C

K

E

T

S
>>
File: pikachu.png (68KB, 1026x913px) Image search: [Google]
pikachu.png
68KB, 1026x913px
Visual Studio Code is amazing for debugging Node. Fuck Sublime yo.
>>
>>55804496
Like very vaguely and generally, yes.
>>
>>55802610
reminder that this is the quality of code that jquery usage promotes
>>
>>55805042
VSCode is amazing for its git integration. too
>>
>>55805093
Haven't even tried it yet desu. Can't wait.
>>
>>55805093
I want to give it a try with the recent updates. Now that it has tabs it should be way more tolerable. I didn't really like it's old workflow.
>>
>>55805042
but does it debug PHP?
>>
>>55802471
>i love it because its new and not mature
Mantra of hipsters. Anyway nosql is seriously overrated and RDBS are more suitable for most usecases.
>>
>>55803020
Pretty sure jquery wrapper doesnt have property id. Try .prop('id') instead.
>>
>>55805084
That is quality of code that noobness of programmer produces. Happens in every language.
>>
>>55802610
You are adding submit handler on click, of course you get more alerts. Also learn jq data. In fact just learn jquery and javascript because that shit is horrible.
>>
>>55804134
Set yourself hour rate and try to guess time it takes to do it. Also overpricing than underpricing makes you appear better when dealing with normies.
>>
Is there anything worse than being paired with someone who is not only unwilling to compromise but also unable to see that he's nowhere near as good as he thinks he is? It's driving me up the wall senpai.
>>
>>55806031
>Is there anything worse than being paired with someone who is not only unwilling to compromise but also unable to see that he's nowhere near as good as he thinks he is?

Nope, your partner must be fucking miserable.
>>
>>55808088
HAHAHAHAH OMG THE CLASSIC 4CHAN-A-ROO, YOU'RE HILARIOUS
>>
How do I make a sexy menu like this one? (on desktop, the mobile version looks basic)
https://www.ispot.tv/
>>
Why do you people get so triggered by noSQL databases?
>>
WHERE MY CYCLEBROS AT
>>
Do event listeners stack or does calling addEventListener overwrite it?
>>
>>55812444
Stack, it is after all _add_EventListener.
>>
>>55812633
Makes sense, thanks dude
>>
>>55810929
I don't, they're great in the very specific niche that they have, I just get triggered when hipster startup devs use them just to be cool when the should really be using a relational database.

That and because mongo in particular is objectively shit and only popular because of the aggressive MEME stack marketing and the decision to pack in tons of Features(TM) instead of fixing the gaping performance problems.
>>
>>55809289
You talking about the main nav menu? Looks fairly straightforward. Seems to be a typical dropdown but the menu is set to be the full page width and animated to slide down.
>>
Is there a good way to make nginx detect if one instance of an app is down, and if so either restart it or stop routing to it?
>>
I don't know if my question falls exactly into the webdev category but I'll try anyway.
I'm using nw js for a projet, which is quite complex but to cut it short I need to be able to display an HTML page (so graphists / designers can easily modify it) with some videos animations etc... and link all that to physical sensors.
Problem is there's no official support for javascript for these, and the node.js module I found on github doesn't work well with the specific hardware I need to use.
Fully supported languages are C/c++ java c# python ruby and a couple of others I'd rather not use. I though about making a node.js module in C/C++ to use the maker's libraries to use it but I have no idea if that'd really work for 'real time" communication.
The hardware is there to act as buttons / shit like that so it needs to be reactive, and I don't know how to communicate very small amounts of data in a very reactive way from thoses languages to something that you could run easily on node.js

help?
>>
>>55814208
What kind of sensors? If they're some kind of IoT thing, often they have a REST API of some kind you can interact with.
>>
>>55814548
right now it's phidgets RFID sensors, mostly because that's what was used on the older project.
there's no official support for phidgets on JS though, complete list of supported languages are here:
http://www.phidgets.com/docs/Programming_Resources


it's not really IoT, nothing's gonna be over network, it's just that graphists/ designers / whatever are going to have to change the visual aspect of this and the easiest way of doing it without redoing all the code behind it seemed to be html, with a webapp or something around it
>>
What is the nicest flatfile cms for a very simple website+ little blog?
>>
>>55814653
https://www.npmjs.com/package/phidgets
Is this the npm module you tried? Looks like it should work, but I can't really say without knowing the specific setup.

If that doesn't work, You'd probably have to either write it with C/C++. ('real time' shouldn't be a problem) or find a REST API for it and talk to it though that.

>>55814754
Github pages officially supports Jekyll.
>>
>>55814867
yeah it's that one and it doesn't work with multiple RFID readers, somehow it treats them all as one even though they have different serial numbers (when one reads a tag, the js will be notified that all readers detected it).

my problem with doing it in C(++) is how to communicate between the two parts of it, the webpage and the C(++) code. I checked out C++ modules for node.js but I'm not sure you can have then send events when they see a change in the tags.
as for the REST API, phidgets isn't well documented so I didn't find much


actually your answer just made me think of something
I know you can return something at the end of your C++ module function for node.js, and I only need the two to communicate when it needs to change page so I guess that could work
(the project is a huge blank book, rfid tags to detect page positions, video projector to display content on the pages, change page when a physical page is turned)
>>

#!/sbin/sh
#
# /system/addon.d/70-gapps.sh
#
. /tmp/backuptool.functions

list_files() {
cat <<EOF
lib/libjni_latinimegoogle.so
priv-app/Phonesky/Phonesky.apk
EOF
}

# Backup/Restore using /sdcard if the installed GApps size plus a buffer for other addon.d backups (204800=200MB) is larger than /tmp
installed_gapps_size_kb=$(grep "^installed_gapps_size_kb" /tmp/gapps.prop | cut -d= -f2)
if [ ! "$installed_gapps_size_kb" ]; then
installed_gapps_size_kb=$(cd /system; du -ak $(list_files) | awk '{ i+=$1 } END { print i }')
echo "installed_gapps_size_kb=$installed_gapps_size_kb" >> /tmp/gapps.prop
fi

free_tmp_size_kb=$(grep "^free_tmp_size_kb" /tmp/gapps.prop | cut -d= -f2)
if [ ! "$free_tmp_size_kb" ]; then
free_tmp_size_kb=$(df -k /tmp | tail -n 1 | awk '{ print $4 }')
echo "free_tmp_size_kb=$free_tmp_size_kb" >> /tmp/gapps.prop
fi

buffer_size_kb=204800
if [ $((installed_gapps_size_kb + buffer_size_kb)) -ge "$free_tmp_size_kb" ]; then
C=/sdcard/tmp-gapps
fi

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file "$S"/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file "$S"/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)

;;
post-restore)
# Recreate required symlinks (from GApps Installer)

# Remove any empty folders we may have created during the removal process
for i in /system/app /system/priv-app /system/vendor/pittpatt /system/usr/srec; do
find $i -type d | xargs rmdir -p --ignore-fail-on-non-empty;
done;
# Fix ownership/permissions and clean up after backup and restore from /sdcard
for i in $(list_files); do
busybox chown root.root "/system/$i"
busybox chmod 644 "/system/$i"
busybox chmod 755 $(busybox dirname "/system/$i")
done
;;
esac

>>
>>55815060
This isn't really web-dev stuff, but I hope you guys can help me out with this. I edited a back-up script I found online but I'm not really sure if it's gonna work.

Should I have that gapps.prop file, or will it be created by the script itself?

Should I use


#!/sbin/sh
#
# /system/addon.d/70-gapps.sh
#
. /tmp/backuptool.functions

list_files() {
cat <<EOF
priv-app/Phonesky/Phonesky.apk
lib/libjni_latinimegoogle.so
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/$FILE
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/$FILE $R
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac



instead? I don't see any dependencies, but I'm not really sure if it's gonna work on newer android versions, since it's a script from 2012 or so.
>>
>>55814867
The problem is that i already have a host and use its services loke email etc, wanted something self hosted
>>
Jquery vs AngularJS
>>
>>55815229
You can self-host jekyll, it uses flat files.
>>
>>55777188
here one cheap hosting:
https://hostsailor.com
>>
What would be the best/most convenient way to generate backgrounds similar to the wallpaper of this site be?

http://www.reactjsprogram.com/React-Fundamentals-Project/index.html#/?_k=xb4vex

I'm sick of solid colour/simple gradient div backgrounds in my projects
>>
I need to finish my anime hoarder application.
Testing it by downloading everything horriblesubs releases on nyaa, jesus christ its so much shit.

func fetchAndUploadAll() {
feeds := getAllFeeds()
for _, feed := range feeds {
id := fmt.Sprint(feed.ID)
fetchFeedItemsByID(id)
feeditems := getFeedItemsByFeedIDNotProcessed(id)
for _, item := range feeditems {
var folder string
if feed.Type == "shana" {
folder = getAnimeFolder(item.Title)
}
if feed.Type == "nyaa" {
folder = getAnimeFolder(item.Title)
}
if feed.Type == "showrss" {
folder = getSeriesFolder(item.Title)
}
uploadTorrent(item.Torrent_URL, folder)
setFeedItemProcessed(item.ID)
}
}
}

.
>>
>>55816165
> 8 spaces indentation
>>
>>55815922
Just look up free use patterns on Google. You can then spend like 2 minutes in Photoshop and apply a quick color filter or some shit.
The only problem you might have is coming across possible shit compressed/artifacted images that will look like shit when blown up to size.
>>
Is this:
var Cock = function(width, length) {
this.width = width;
this.length = length;
}

Cock.prototype = {
constructor: Cock,
method1: function() {
return 1
},
method2: function() {
return 2
},
// etc
}

the same as:
var Cock = function(width, length) {
this.width = width;
this.length = length;
}

Cock.prototype.method1 = function() {
return 1
}

Cock.prototype.method2 = function() {
return 2
}
// etc

? The first is easier to write but the problem is overriding the default object's prototype, would specifying Cock in prototype.constructor handle that?
>>
>>55816246
Cool, thanks for the help
>>
>>55816280
Just use the ES2015 class syntax

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
>>
>>55816346
I agree it's cleaner, but in the long term I feel like it'd become a hassle to manage, they're not real classes and it's misleading
>>
Redpill me on MongoDB
>>
>>55816280
Yes.
>>
>>55816849
Its a meme and the only people who use it are those doing tutorials for the MEAN stack, which is a product of the MongoDB marketing rather than anything anyone uses for production. There are better noSQL databases out there like CouchDB and RethinkDB.
>>
>>55817158
RethinkDB looks good.
>>
>>55816400
Try Typescript then.
Anyway, you should just suck it up and start using it because that's what the standard is going at right now.
>>
>>55815922
That particular background is an svg, so try messing about in illustrator.
>>
I am taking over the running of a company, and their old website (wordpress) has google analytics code in it, how do I access the information?
>>
>>55820130
login into their analytics page on their google account.
>>
>>55820166

That is going to be an issue, I don't even know if they have one. If they have the analytics code in the html, but they never set up a google account to link it too, will it not have collected any info?
>>
>>55820243
you get a code to copy into the page, you can only get it with logging into the account on the analytics page and setting up the site.

what did they put in? someone elses code?
>>
>>55820271

I am taking over from people who have now left and are difficult to get a hold of, all I have is the wordpress login and thats prettymuch it.
>>
>>55820368
ask the company for the account. if they don't have it then those who left are still in control of it and can do whatever they want with it.
escalate this issue to your manager.
>>
>>55820402

I am the manager now, we have taken over the company, it was only a 3 man business before.

I was hoping that I could enter the code from the HTML somewhere and do a "I forgot my username" and work from there.

There are no records or anything, its a mess.
>>
>>55820448
no, you can't.
what an awful thing that would be. You could look up everyones email address by knowing their analytics code.

consider suing the guys who left.
>>
>>55820448

$12.50/hr ($2,250/month) and I'll give you 24-hour support, maintenance and create any number of web applications you want. :)


i'm so depressed
>>
>>55790964
lol
>>
Where can I host free dynamic websites for portfolio purposes?
>>
>>55823513
Depends on what you mean by 'dynamic'. You can host static sites with as much javascript as your little heart desires for free on github pages, and if you need a backend, you can host that somewhere else.

You can get a shared hosting server with LAMP stack and CGI for like $10/yr.

If you want to use something like node or go, there are options like heroku and openshift that have a limited free tier. AWS has a 1 year free trial.

Most useful is probably a digitalocean VPS where you can run whatever you want for like $5/month

Beyond that, you can check the stuff in the OP, but some of it might be outdated.
>>
>>55823686
>LAMP stack and CGI for like $10/yr
LOL wat? I'm paying Namecheap $50 a year for hosting + domain and until now I thought that was dirt cheap...
>>
Common reasons why a php file isn't getting what it needs from post? I made one pair of HTML and PHP pages, and the one gets data from the other totally fine, but I copied and pasted those, renamed them and changed some stuff up, and now Im getting errors from the PHP getting dick all from the HTML. Tested out what its doing with the data by coding it in manually, and that worked fine.

Im a total noob with this stuff, if you couldn't tell.
>>
>>55826029
we can't tell you what you fucked up in your code if you don't post it you fucking idiot

do you expect us to guess what you wrote?
>>
>>55826029
Look at the request and make sure it's actually sending the data you want in the first place.
>>
>>55825699
$10-$15/year is enough for a cheap VPS + domain.
>>
>>55826029
If it were me I'd check that I targeted the right php file and didn't forget any to put quotes in all the appropriate places.
>>
I know this is more about math than programming but I am trying to convert a value exponentially in js, for example I have a value from 0 to 1 and I want from 0 to 0.25 to receive 0 to 0.5 values and from 0.25 to 1 to receive 0.5 to 1 values what could I use to do this
>>
So, I went through a Thinkster guide to React. Now what lol? It was same when I learned Angular, I can't make anything useful just with a frontend framework.

It's good to have it on a resume, right?

Should I learn React native? I didn't even know that React could be used for mobile applications, that's kinda cool.

I think I should start learning Node.
>>
Is there a way to program websites in Python without knowing CSS? CSS is fucking garbage
>>
>>55828448
Just learn it or at least know the basics and use one of those bloat CSS frameworks.
>>
How do I get a datalist's option to return an id of an item in the database instead of the whole name? The value shows the name, but I want the ID to be handled in the back-end and the names of the items to be shown on the interface. Is there a way around this or not?
>>
>>55829027
Here is what I have:
<input list="gamelist" placeholder="Type in game name" name="gamename" required />
<datalist id="gamelist">
<?php
foreach(main::dbq()->query('SELECT * FROM `gamedb`') as $row) {
echo "<option value=\"".trim($row['gname'])."\" data-coll=\"".$row['id']."\"></option>";
}
?>
</datalist><br />

This gives me a gamename of the game's name and not its ID. But having the ID in the value does not show the game's name in the dropdown that datalist has. Any idea what I can do?
>>
>tfw failed my PHP couse at colleage

Got a bug I couldn't fix and didn't submit the final project, worth 40% of the final score.
>>
>>55829642
What was the final project about?
>>
>>55829642
Flipping burgers can't be that bad, can it?
>>
>>55829709
crud app for registering curses and students for a mock university. Got de DB with the entities, the access methods, the HTML forms, but for some reason I couldn't wire everything together without spawning 5 bugs for every line of code I wrote.

>>55829711
I already do much more complex things in python, but in the fucking project I spent 80% debugging stupid shit instead of actually programming. I guess I'm just new to PHP or it just plainly sucks.
>>
>>55829739
lol
>>
>>55829784
Kill yourself.
>>
>>55829812
rude
>>
What's your current bug /wdg/? Mine is not recognizing a class that I have already included right above the code that calls a function from that class.

How weird is that?
>>
>>55829983
paste it
>>
>>55829983
My current bug is not having any motivation to work
>>
File: sikretfunctions.png (128KB, 1024x588px) Image search: [Google]
sikretfunctions.png
128KB, 1024x588px
>>55830000
wew just realized my mistake when making a small picture about it. I forgot the question mark in <?php

Here it is.

>>55830066
I feel you, try watching some motivating chinese cartoons, lain is pretty nice.
>>
What to do with my React knowledge?
>>
>>55830082
Make some UI and sell them.
>>
>>55830129
Any examples? What kind of UI can I sell exactly? First time I hear of this.
>>
>>55830158
If I remember correctly, there used to be a lot of sites that sold wordpress themes and I remember seeing people sell UI alongside with their graphics. I'm not sure if it was just the graphics they sold or both the code and the graphics.
>>
how the fuck do I make components in one div seamless? I have one h1 and one p with different backgroung colors and there is white space between them.
>>
>>55830248
*{margin:0px;padding:0px}
?
>>
>>55830270
well that was easy.

another total retard noobie question, what autorefresh addon /g/entlemen recommends for Chrome? I mean I can set it to monitor for changes in file and then it reloads if file changes. Would save tons of F5's.
>>
>>55830309
Not sure about that, never bothered on using one. But there are some programs that display the page you're working on as you make changes. I remember seeing some on-page editors that do that, but I don't know if you can save them into final html files.

Like firebug for firefox (not sure if chrome has it,) there are other similar ones too. Maybe look for CSS editor or HTML editor in the addon search bar.
>>
Someone should probably think about making a new thread sometime soon. Preferably without fucking up the youtube links this time.
>>
With PHP's PDO, can you query a prepared statement to check something?

Like, I want to do a simple query that takes a value and checks if it exists in the database. I don't want to fetch anything, just a boolean true or false or integer 0 or 1 to check it in the if statement.

Which PDO function does this? I don't know how to query when I do PDO's prepare and use the bindValue function on it. I think only PDO's execute function works on that. query() just gives an error.
>>
>>55829081
I don't know what the fuck you're trying to ask. If you're trying to get the ID of that particular game, wouldn't you just use the value returned at
$row['id']
?
>>
>>55831147
https://secure.php.net/manual/en/pdostatement.fetchcolumn.php
>>
>>55831178
Yeah, but how am I going to get that via POST after submission? The $_POST['gamename'] just gives the game's name and not the id. I want the game's name to display for the user as they type but I want to get the game's id.

I mean, I can just check it in the background, but would be easier if I can just get simple integer values.
>>
>>55831147
>I want to do a simple query that takes a value and checks if it exists in the database
https://stackoverflow.com/questions/11974613/pdo-php-check-if-row-exist
>>
>>55831215
so set the id as value, not the name?
the value is what gets posted back, if you want the id, then set the id as value.
>>
>>55831225
Well the closest thing I can get to right now without javascript is something like using the $row['gname'] like
<option>".$row['gname']."</option>

But then, when I use the $row['id'] in the value, when I type the characters required to complete the name, and select the entire name, it replaces it with its id instead of the completing the name.
>>
I have users who now want to be grouped together into teams.

Question: how the fuck can I keep my API RESTful... what should the HTTP calls be?

PATCH { add_user : 123 } to /company/company_id

or

POST { user_id : 123 } to /company/company_id/add_user

or

POST {user_id: 123, group_id: 345 } to /add_user_to_company

Or am I completely off? Because my controllers look ugly as fuck
>>
>>55831279
okay, now I get it what you want.
you can't do that without javascript.

either have a hidden value that you change with JS when someone changes the value or scrap the datalist and use a custom autocomplete input that sets values based on the id instead.
>>
>>55831202
Nice, that works. If the item exists, then the if statement takes it as true.

But don't know if >>55831223 will be safer, I'll look into it soon. Thank you.
>>
>>55831333
Oh yeah, I used an autocomplete for something similar when checking for older browsers.

I guess there's no way around it other than javascript. Thanks!
>>
>>55831323

Rule of thumb is you should follow a
/things/:thing_id
pattern

// Add a new user:
POST {user_id: 123} /companies/:company_id/users

// Show users:
GET /companies/:company_id/users

// Update a user:
PUT {foo: bar, bas: balls} /companies/:company_id/users/:user_id

// Delete a user:
DELETE /companies/:company_id/users/:user_id
// (most likely just flag them removed in the db, never delete anything)


For groups:
(assumes groups don't span multiple companies)

// Get all groups:
GET /companies/:company_id/groups

// Get info about a particular group:
GET /companies/:company_id/groups/:group_id

// Add a user to a group
POST {user_id: 123} /companies/:company_id/groups/:group_id


Other verbs should follow the same pattern (or something different, just make sure it's internally consistent)

Also, obviously make sure you handle authentication properly to protect sensitive info.
>>
>>55831521

Thanks that gave me a lot of clarity. Nested routes now make complete sense.

[+50 points]
>>
>>55831521
>most likely just flag them removed in the db, never delete anything
Is this for legal reasons?
>>
>>55831820

In my jurisdiction you have to store some records (e.g. transactions) for at least 6 years. Other records you must delete within 3 months if they're not being used.

Depends on what the data holds and where you live.
>>
Hello /wdg/ red pill me on NoSQL
>>
>>55831899
Its good for some stuff, not so good for some other stuff.
>>
>>55832549
Thanks /wdg/ this is exactly the kind of answer I was looking for
>>
>>55832582
Also NoSQL != MongoDB. Mongo is volatile and inconsistent as all fuck with its data. Some good NoSQL databases are CouchDB and RethinkDB.
>>
>>55832582
>>55832818
And Riak.
Thread posts: 325
Thread images: 19


[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.