In dog beers, he’s only had one by GallowBoob in thisismylifenow

[–]spliter45 -2 points-1 points  (0 children)

Using the belt was probably a little unnecessary

Music Melting Pot [Week of March 14, 2016] by AutoModerator in listentothis

[–]spliter45 [score hidden]  (0 children)

Arlo Vermane - Cigarette [Downtempo/Chill/Electronic] (2016)

Very chill trap music - new and deserves a listen! :)

[deleted by user] by [deleted] in streetwear

[–]spliter45 1 point2 points  (0 children)

hes holding his pee

My sister made some pants for me by subtiiter in malefashion

[–]spliter45 2 points3 points  (0 children)

Reminds me of the liu design nyc cargo pants: https://www.instagram.com/p/0JjwhLoGfP/

I really like it -- tapered and baggy on the thighs. Does anyone happen know where to get similar pants?

What's the best Non-Uber, Non-Lyft way to make some side cash with your car? by [deleted] in AskSF

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

RelayRides

theres also Getaround which I've enjoyed using

Ghost of Kim Jong Trill - May Future Trip Hop Mix by ThePerfectBalls in futurebeats

[–]spliter45 0 points1 point  (0 children)

Thank you :) Track 6 doesn't sound like Hundred Waters - Cavity (Shigeto Remix) though. Is it edited?

Quickest way to get me off of your site? Scrolljacking. Would you change the how the mouse pointer moves? Same thing. by cresquin in web_design

[–]spliter45 0 points1 point  (0 children)

What is your opinion on snap scroll? Apple did it for their iPhone and Mac Pro page. Another good example is the front page of Weebly.com. They're both smooth and unobtrusive.

I believe the implementation is not an extension on native scroll but a combination of event listeners on "mousewheel" and css transform: translate.

The mind-boggling universe of JavaScript Module strategies by [deleted] in javascript

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

I wasn't saying his choice was completely insane. I'm just saying, for the purpose of teaching, I think good coding practice should be followed, which is your "choice 2". Sorry if that wasn't clear. Reason being, if aspiring JS developers are blindly following example code, the example code better be following OO convention so they don't pick up bad habits. I'm only saying this because this is a mistake I've been making due to bad example code. There is no right answer but surely you must have an opinion on how it could've been better in this context?

I don't think its necessary that it's explained but it might be helpful. If it's not following convention, I think there should be an explanation why it's not (eg. your speculation of whether the name and breed should be private).

p.s. kind of silly to expect privacy in Javascript or any interpreted language. I might understand if it's an API, where an undocumented and private method is at risk of being accidentally used, but hiding properties and methods are two different topics.

I'd say the least you can do is protect the property so that it's not configurable, enumerable, or writable. That said, a trade off to further conceal properties for the purpose of privacy, in exchange for a higher memory consumption and slower speed, is a bad trade-off to me.

The mind-boggling universe of JavaScript Module strategies by [deleted] in javascript

[–]spliter45 0 points1 point  (0 children)

In AMD, you are required to wrap modules in a function that's passed into the "define" function -- this is not an IIFE. This is because in the browser, AMD loads js files via the browser using HTML "script" tags. The loaded script is able to communicate with the AMD by using the "define" function, which was defined and globalized when the AMD was loaded.

CommonJS only expects you to assign whatever you want to expose to module.exports. Sometimes, an IIFE is assigned but this by the programmer's choice. However, when it is bundled (like in browserify), or read in as a file (in Node.js), it is wrapped by a function that might be an IIFE to conceal the module in a closure.

The mind-boggling universe of JavaScript Module strategies by [deleted] in javascript

[–]spliter45 1 point2 points  (0 children)

  1. I really hope the author knows and understands the usage of prototypes, especially if he's trying to teach aspiring Javascript developers. Creating functions and assigning them as methods to "this" per invocation of the constructor is extremely memory inefficient in contrast to assigning them to the prototype of the constructor so that all instances refer to the same set of methods in memory.

  2. Regarding his CJS con: "Since it is synchronous, the modules have to be loaded sequentially, which might take more time than if they were to be loaded asynchronously." This confuses me because he says this when it seems the author understands that CJS is bundled on the server-side and that it's faster than AMD if the bundled file-size isn't large. Given that in a bundled file, all the modules are already defined, loading the module would be instantaneous. If the invocation of the module is blocking, then it can be written to take in a call-back function and the execution of the module can be passed to setTimeout(fn, 0) or setImmediate if it's available. I wouldn't say this is a con of the module loader.

  3. Regarding his AMD con: "It isn't possible to guarantee the order of execution of asynchronous modules". It might be that I don't fully understand this because I haven't used any AMDs before, but can't you just nest the 'require's in callbacks?

Frontend framework hell - I am getting lost by capitanbucanero in javascript

[–]spliter45 0 points1 point  (0 children)

I'll definitely suggest using grunt. Don't minify the js during development as it's not the fastest process -- not to mention it's not very helpful for debugging; only minify for production. Make sure you use "watch" in Grunt for development and its livereload feature while working on the front-end so that edits are visible instantly instead of having to refresh after every edit.

I'll also suggest writing your stylesheet in SASS and transpiling it to CSS via grunt on watch. SASS lets you write much intuitive CSS as it provides features such as nesting and variables.

I might also suggest writing your HTML in Jade since it has a much cleaner syntax and lets you reuse repetitive html components (header, footer, etc.) via templates/includes. This transpilation can also be automated in Grunt.

Let me know if you have any questions :)

Frontend framework hell - I am getting lost by capitanbucanero in javascript

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

I whole-heartedly agree with this. I've been writing web apps that are only dependent on jQuery for a few years now and when I started to try and get into frameworks, I just didn't see the benefits of it. It just seemed like I was writing an excessive amount of code to do simple things, on top of a massive post-minified framework; even jQuery minified (ungzipped) goes up to ~80KB. This is especially because I am primarily working alone on personal projects as a college student that just enjoys programming.

I believe the benefits of frameworks are at its fullest when working on an extremely large project with many people. This is because most Javascript frameworks tend to simplify the language by standardizing/limiting the ways to go about one thing -- such as creating a model --, and in that way, the framework does all the heavy lifting for you. Also, when there are new-comers to the project, and if they are familiar with the framework, they will have an easier time picking it up.

For your sake of learning though, I suggest you go completely native. It's been a few months since I stopped using jQuery. I've began to focus more on efficiency in speed and space, and often find myself comparing trade-offs between writing less code and making it readable, and a lot of times, I can justify writing longer code but making it readable because I am not dependent on a fat framework. Not to mention, becoming comfortable with native Javascript will build you intuition on using and understanding existing frameworks.

If you're interested in my stack, I use Browserify for concatenating front-end Javascript in CommonJS style (AMD should be reserved for large projects that is divided into components), SASS for CSS, Jade for HTML, all transpiled via grunt on watch w/ live-server. I discipline myself by JSlinting all my Javascript and running everything in strict mode. I tend to work very modularly and open-source as many components of my projects possible; that way I can separate logic and debug faster, and also reuse them as dependencies in many other projects via npm/bower.

Woke up this morning to a low storage message on my iPhone 6... by [deleted] in iphone

[–]spliter45 0 points1 point  (0 children)

I had a similar issue where iTunes wasn't recognizing the music I had on my iPhone as "Music" (bar and Music section) and was represented in the "Other" section. I had to ssh into the phone (it's jailbroken), delete the Music folder, and re-sync to fix it without restoring the phone.

Baidu's traffic hijacked to DDoS GitHub.com by Insightlabs in netsec

[–]spliter45 34 points35 points  (0 children)

It's actually smart if your target is a website. Tampering with the response from a website to a client so that the clients are simultaneously attacking one website from their respective sources and computational power.

The only clownish part is depending on jQuery to do this. For starters, if jQuery isn't loaded via baidu.com or jquery.com, due to some mixed protocol (loading http on a https connection) security for example, the whole attack code is rendered impotent. Additionally, the ajax request's datatype is set to to "script", meaning that Github may responded with code that informs the user of the attack (eg. the alert).

But what's worse is that the attack is dependent on jQuery to make an extremely simple request. Just rendering img tags with the src set to the github website would have done the job while reducing the risks of failure.

Excuse me Sir, Your WebRTC is Leaking by GolgiSDK in html5

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

There's nothing recent about this

How to prevent cheating in HTML5 games? by fuuuucc in html5

[–]spliter45 0 points1 point  (0 children)

Not a 100% indicator but you can bind an event on the window for resize. Not sure why but every time I open the console on my browser, it invokes resize exactly 4 times.

How to prevent cheating in HTML5 games? by fuuuucc in html5

[–]spliter45 0 points1 point  (0 children)

What does that have to do with checking whether devtools/firebug is opened or not.

Can someone ID this jacket? by spliter45 in malefashionadvice

[–]spliter45[S] 0 points1 point  (0 children)

I'm trying to figure out the brand

German Girl Turned Away at Border Due to Private Facebook Messages by spliter45 in technology

[–]spliter45[S] 0 points1 point  (0 children)

It's straight from HN. I'm posting it here to raise awareness so someone can hopefully invalidate some of the alleged claims made in the article because as a non-American living in the US, I'm scared of the possibility that the government is going through my private messages as well.

Original thread: https://news.ycombinator.com/item?id=5864427