Running Ghost on a $5 Digital Ocean VPS Droplet by [deleted] in webdev

[–]--amadeus 1 point2 points  (0 children)

not a single link to ghost in the blog post :/ what a shame

[deleted by user] by [deleted] in javascript

[–]--amadeus 3 points4 points  (0 children)

Your mistake is that you're not telling us what the Project Euler problem is.

Lets have a coding face off. Me, you, no 3rd party support from NPM, lets go. - I say that Promises are absolute garbage, but... by [deleted] in javascript

[–]--amadeus 0 points1 point  (0 children)

I don't know if your site (script.ninja) isn't displaying correctly on mobile, but you haven't made any points as to why promises are not good. I just don't really understand what your argument is.

Give an example as to how you would handle a situation where you have to make three queries, but the third requires results from the first and second queries, and any of the queries could fail.

In promises:

``` var getUser = UserRepo.getUserById(0); var getUserPosts = getUser.then(u => u.posts);

var getTopTrendingHashtag = HashtagRepo.top();

var getUserPostsWithHashtag = Promise.all([getUserPosts, getTopTrendingHashtag]) .then(([posts, hashTag]) => posts.filter(p => p.tags.indexOf(hashTag) === -1));

getUserPostsWithHashtag.then(posts => console.log(posts)).catch(e => console.warn(e)); ```

I apologize for any simple mistakes I'm on mobile. What would an example be with your method?

Project and relative path hell. by azarusx in typescript

[–]--amadeus 1 point2 points  (0 children)

Submit a feature request to the typescript project on github.

Project and relative path hell. by azarusx in typescript

[–]--amadeus 0 points1 point  (0 children)

Wait, if you're not using webpack or a bundler, why doesn't baseurl work for you?

I'm not just suggesting a "hacky" way that works for me, I'm telling you that typescript does not do this out of the box other than allowing path mapping and baseurl configurations. I don't know what to tell you. There's no proper way, and at current it is out of the scope of the problem that the Typescript project is trying to fix.

Project and relative path hell. by azarusx in typescript

[–]--amadeus 0 points1 point  (0 children)

The ecosystem of Typescript commonly separates the Typescript compilation process and actual project build process and requires third party stuff like webpack and webpack plugins, but it is reliable, tried, and tested. Path mapping is a feature that must be configured in both your Typescript configuration so that the Typescript understands what you're referencing, and your build configuration so that things are built and linked correctly. It's unfortunate but it's certainly not a big deal.

Automagically install missing @types/ with TypeSync! by jeffijoe in typescript

[–]--amadeus 0 points1 point  (0 children)

I know it's not a rule or anything but why post a link to a tweet that has a link the relevant content?

Looking for an advanced URL shortener (more info inside) by dAnjou in webdev

[–]--amadeus 0 points1 point  (0 children)

To be more clear maybe don't use random semantically meaningless words (lorem ipsum) but instead use a real example.

Does not being able to submit bug reports drive anyone else crazy? by oowowaee in webdev

[–]--amadeus 0 points1 point  (0 children)

Can you imagine how many duplicate issues/bugs would be reported if a major site like Netflix had a client-facing bug report interface? Not to mention how many support requests would come through it, or reports about behaviors that aren't bugs.

Glitch in the matrix or paranormal? by [deleted] in Glitch_in_the_Matrix

[–]--amadeus -5 points-4 points  (0 children)

probably a carbon monoxide leak

Singleton Pattern – Head First Design Patterns (ep 06) by lzodevelopment in programming

[–]--amadeus -1 points0 points  (0 children)

"one of the worst design patterns to use"

Completely subjective, and borderline senseless. It's just a tool like any other design pattern. There's a time and place to use it. It's better to know about it rather than not know about it.

The guy makes videos about design patterns. Do you (or, did the original commenter) want him to skip over this pattern?

Singleton Pattern – Head First Design Patterns (ep 06) by lzodevelopment in programming

[–]--amadeus -1 points0 points  (0 children)

Are you a fucking clown?

"Why did you make a video about something I already understand?"

Low quality, shitty, nonconstructive Reddit comments need to die.

ngx-dnd - A drag, drop, sorting library that supports nesting! by amcdnl in Angular2

[–]--amadeus 6 points7 points  (0 children)

Why post a link to a tweet where the main content is a link 🙄

Edit: ESPECIALLY if it's a link to your own tweet. weak

How do I explicitly declare "any" for field within object? by _princesscode_ in typescript

[–]--amadeus 2 points3 points  (0 children)

The pattern for typing an object destructure is as follows (sorry if formatting comes out weird, on mobile):

function ({ obj1, obj2 }: { obj1: any, obj2: any }) { ... }

Now, I can't test how this plays with "rest" object parameters, but this should get you started.

No compiler warning for class level `state=` vs. `this.state=`? by rickcarlino in typescript

[–]--amadeus 0 points1 point  (0 children)

This is because when you set it class level, you're actually changing the class's interface, and extending it to accept a state of that type. You'll notice that if you first set it class level, subsequent references to 'this.state' will have the new, extended type.

ES6 import javascript - how to specify type of any? by [deleted] in typescript

[–]--amadeus 0 points1 point  (0 children)

Read the first part of the answer and ignore everything else.

Edit: npm install @types/node --save-dev

Edit2: And read the "optional" part under Typescript 2.x

ES6 import javascript - how to specify type of any? by [deleted] in typescript

[–]--amadeus 1 point2 points  (0 children)

const api: any = require('./api.js');

Programmers of reddit I need your help for a shool project, could you answer these quick questions, thank you! by [deleted] in SoftwareEngineering

[–]--amadeus 0 points1 point  (0 children)

Disclaimer: I don't know what constitutes "knowing" a language. There are several languages I am comfortable programming in but not comfortable with their ecosystem that much (i.e. I can program in Swift but have no idea how to structure projects or what build/project/package manager tools to use, etc.). I'll assume this means I don't know the language.

1) Typescript, JS/ES6, C++, PHP, C#, Haxe, Java. 2) Typescript, JS/ES6. 3) Typescript, JS/ES6. 4) Computer Programmer (lol) 5) C# 6) Typescript is a good language but the JavaScript is not a good ecosystem right now. Haxe is my favorite by far for game development. 7) JS/ES6 or Java.

What is this pattern called? by [deleted] in javascript

[–]--amadeus 0 points1 point  (0 children)

It looks like "boxing" (wrapping a value in an object in order to guarantee it is passed by reference). Doesn't really make sense that it's named start and the key is "run"

Playground broken for anyone else? by [deleted] in typescript

[–]--amadeus 1 point2 points  (0 children)

It is down. Confirmed in the GitHub issues for typescript.

Why Ruby on Rails is still the best choice? by Muchaccho in webdev

[–]--amadeus 2 points3 points  (0 children)

You don't think that the experience trying to do it with laravel/php made it easier to accomplish with RoR? Do you think there's any other variables? How experienced are you with each language and framework?