« first day (2387 days earlier)      last day (2563 days later) » 
00:00 - 16:0016:00 - 00:00

4:17 PM
hi guys
someone help me with angularjs routes and webpack?
 
You are welcome to ask but: Very few people on right now and even on busy day angular is not widely used (among us regulars.. it's widely used in the world).
webpack is widely known here, as is routing in general.
 
well
i trying to use angularjs routes with webpack and oclazyload
i a specific state i need to load specific resources
and prevent load all scripts in one bundle.js file
(function () {
    'use strict';

    angular.module('app.empresas').config(config);

    function config($stateProvider) {
        $stateProvider
            .state('app.empresas', {
                url: '/empresas?Filter',
                views: {
                    'main@': {
                        template: require('./empresas/empresas.html'),
                        controller: "AppController as App"
                    }
                },
                Params: {
                    title: 'Empresas',
in app.empresas state i try to load empresas.factory.js and empresas.controller.js
but when i try to execute i recieve this error:
Uncaught SyntaxError: Unexpected token <
bundle.js:144 Error: Loading chunk 0 failed.
    at HTMLScriptElement.onScriptComplete (bundle.js:98)
__webpack_require__.oe @ bundle.js:144
1.bundle.js:1 Uncaught SyntaxError: Unexpected token <
bundle.js:144 Error: Loading chunk 1 failed.
    at HTMLScriptElement.onScriptComplete (bundle.js:98)
__webpack_require__.oe @ bundle.js:144
bundle.js:98 Uncaught (in promise) Error: Loading chunk 0 failed.
    at HTMLScriptElement.onScriptComplete (bundle.js:98)
 
is that error in the browser?
 
yes
 
use the network tab of the dev tools to see if it's getting html instead of js for one of those script fetches
 
4:27 PM
i dont recieve any record in network panel
filter by xhr
 
not xhr
don't filter. just look. it'll be one of the early ones.
probably
 
without filter i get this
 
click on 1.bundle and check it. or check them all
what browser is that, btw?
 
error 404
scripts located in /build folder
 
ok. so yea. your scripts aren't being served. i bundle.js is correct, though
yea, it says /build.. that's a webpack config option.. umm.. rootUrl?
 
4:30 PM
@50l3r If it's a 404 then it must contain your default 404 page, which is html, and thus isn't valid js (surprise?)
The SyntaxError on < is mostly caused by those kinds of things
 
path of 0.bundle and 1.bundle are incorrect
 
publicPath, that's it
 
how can i correct the path?
 
look up that option, "publicPath" in webpack docs. If you can't figure it out, then give me your webpack.config.
 
one sec
 
4:31 PM
take your time
 
wow, fixed
but i got another error
paths are correct
Error: [$controller:ctrlreg] The controller with the name 'EmpresasController' is not registered.
Possibly unhandled rejection: Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.
 
if that's a simple webpack config issue, I can't recognize it, since i don't know angular.
 
this is my webpack.config.js
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
    entry: './app/main/core/core.module.js',
    output: {
        path: __dirname + '/build',
        publicPath: '/build/',
        filename: 'bundle.js',
    },
    devtool: 'eval-source-map',
    module: {
        rules: [
            {
                test: /\.html$/,
                use: [{
                    loader: 'html-loader',
                    options: {
                        minimize: true
 
nothing looks wrong with that webpack.config.
I don't see anything that would lead me to think the issue is there.
 
Hi, let's say we have an array: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] how can I reduce this array's length by calculating averages like [1.5, 3.5, 5.5, 7.5, 9.5] is there a simple method to reduce length like n -> m?
 
4:38 PM
though.. for all i know.. angular needs some plugin or some junk. no idea.
 
fixed renaming this line
 
is it always pairs you want to average?
 
 $ocLazyLoad.load({
       name: 'app.empresas'
 });
i can to load all entire folder?
 resolve: ['$q', '$ocLazyLoad', function ($q, $ocLazyLoad) {
    var deferred = $q.defer();

    require.ensure([], function () {
        var mod = importAll(require.context('./empresas/', true, /\.empresas\.js$/));
        $ocLazyLoad.load({
            name: 'app.empresas'
        });
        deferred.resolve(mod);
    });

    return deferred.promise;
}]
to load all js files in a folder in specific view
 
require.context inside require.ensure?
are you sure about that?
 
nope
im new in webpack
 
4:46 PM
well, unless you can prove it does anything, remove that require.ensure
is that trying to lazy load items from the /empresas directory?
or load them all at once?
 
only load all /empresas folder in case i visit /empresas state
Load css, views, controllers, vendor files...etc.
 
well, require.context is loading all js files in /empresas and I'm not sure it it'll wait until you use it. i think it loads it right away.
not sure on that.
 
resolve: ['$q', '$ocLazyLoad', function ($q, $ocLazyLoad) {
    var deferred = $q.defer();

    var mod = importAll(require.context('./empresas/', true, /\.empresas\.*$/));
    $ocLazyLoad.load({
        name: 'app.empresas'
    });
    deferred.resolve(mod);

    return deferred.promise;
}]
solved
Much thanks @Luggage
 
np. That only gets the bundle when you demand it?
 
i trying to be my app more faster
cheking...
yeah
 
4:54 PM
cool.
 
one more question
when i recieve a error like this:
ReferenceError: swal is not defined
    at eval (eval at <anonymous> (bundle.js:903), <anonymous>:99:17)
how can i know what script causes the error?
in my webpack i use devtool: 'eval-source-map',
 
got me. i need to fix my sourcemaps, too. if even possible.
this post seems to suggest thatthe file names are not working in eval-source-map in chrome: github.com/webpack/webpack/issues/2145#issuecomment-294361203
 
jaja
 
@50l3r try: devtool: '#cheap-module-source-map'
 
great :D
ReferenceError: swal is not defined
    at app.controller.js:99
 
5:16 PM
@Luggage progress?
 
i'm about to refresh my example to be more minimal, but it's clearly a bug.
 
5:32 PM
@Luggage wtf
 
indeed.
I couldn't find any that seemed related.
 
this also "works"
 
I can fix my code, of course, but that's not the point.
 
render() {
        let buttonProps; // cx not imported
        // let buttonProps = {}; // cx imported

        return <button {...buttonProps}>
            <span className={cx('class1', { class2: true })} />
        </button>;
    }
weird af
 
yea, that also types it as "object" instead of "any"
 
5:36 PM
hmm
pretty bad
 
5:49 PM
Hi @Mosho, I'm searching for a method to shrink (or expand) the length of an array while maintaining the balance of data inside the array.
 
@Luggage I just checked and it's a type error in typescript@next
 
You can think of like image resizing. But I'm talking about a simple 1D array. Please help me if you know a method/library.
 
meaning that it won't silently fail but complain instead?
 
yeah
still bad for the released version
> error TS2698: Spread types may only be created from object types.
 
should i close that issue since it'll be 'fixed'? is @next like the next minor release or major version?
 
5:51 PM
it's nightly
so very close to master
> typescript@2.4.0-dev.20170429
next minor
 
but no guarantee it'll go out soon, then?
ohh, ok
 
still weird behavior for 2.3.2
leave the issue open
maybe they'll do a 2.3.3
 
i'll mention what you said about @next, though
 
sure
 
i still get it silently ommiting the line with @next
 
5:55 PM
no error?
yeah, tsc without some arguments won't give up on errors
still bad behavior then
 
yea.. the TS2698 error is nice, but the omitting an unrelated import is the bug. So.. nothing to mention.
it's my understanding that any TS type errors shouldn't prevent valid JS from just getting passed through to output.
 
6:15 PM
@FlorianMargaine 4-5 years
Or never
Luckily I think I have too much work and copy will have to be the house husband
 
@FlorianMargaine I think Luggage is!
 
might be.
buncha kids around here
 
@Luggage how old are you?
 
37
 
omg I always thought you were in your 20s
 
6:19 PM
mentally
 
@Luggage when are you having kids?
 
probably never
 
coughs loudly
But after me, @dystroy is probably the oldest
 
@Zirak I thought you were a teenage girl
that or a goat
 
@BadgerCat Why not both?
 
6:26 PM
everybody on the internet is a teenage girl
 
@Luggage damn man born in the 70's?
old af dude! :p
 
Just barely, yes. november of '79
so i't not like I remember the 70's
 
@BadgerCat I gave you these in confidence!
 
i wasn't even a real human until the 90s
 
6:29 PM
yeah just messing with you, I was born in 82
so I knew your bday had to be just barely in the 70's
 
holy shit mobile plans are expensive in ontario
 
@Luggage what day?
 
tuesday
 
5th?
 
i was joking. 8th.
 
6:47 PM
@Mosho how did you get that type error. I tried --strict
 
just tsc
 
i never get it on 2.3.2 or @next.
~/src/ts23issue $ tsc -v
Version 2.4.0-dev.20170429
~/src/ts23issue $ tsc
~/src/ts23issue $
ohh.. installed @types/classnames which makes the problem 'go away', too..
 
Hi, how can I reload the charts when using ng2-charts. I want to be able to update x axis and run the animation.
 
turning strict on also causes the import to be present.
specifically --noImplicitAny
 
7:17 PM
@Luggage free?
 
what's up?
 
@Luggage re: Dev talk :D
 
start talking.
 
Hangouts?
 
@Luggage I had the problem with it
 
7:30 PM
I was mistaken. It was noImplicitAny that did that.
 
7:59 PM
lets say that you are receiving some response that include '\n\n', is there any way out of the box to tell to console.log to output those and not threat them as double new line?
 
your could .replace() newlines with something else
 
good idea, thanks
 
8:31 PM
@Mosho haha, someone else ran into it: github.com/Microsoft/TypeScript/issues/15472
 
8:44 PM
lol
I believe it'll get addressed soon
 
The 1 out of 100 times that a bug really is someone else's fault.
!!afk games
 
9:24 PM
lol I did this 2 years ago
should have kept at it :X
 
> built from the ground-up for high performance
"Do you mean to imply I don't write performant code?"
These kinds of staple descriptors...
 
> Descendant and child combinators are unsupported
u wot
 
awesome
there's a bug I don't reproduce when running my program with strace
 
Hi guys :)
 
9:46 PM
@FlorianMargaine A friend of mine recently had a bug that you would've loved, but I can't remember what exactly it was...helped him debug and find it, it was something insane like a default buffer size or default window on some network operations, so the payload sizes in Wireshark and strace and all those looked ok but they were actually wack
 
ha
the best kind of bug
MTU?
 
youtube.com/watch?v=tk_d3hYRAYQ the lasers work MUCH better than ir
 
Wes
Help Vampire here.

I'm a professional software developer for years but in static typed languages. Whats the recommended stack to get starting in JS development now? Every time I look its changed. I have a toy project I want to do. Npm + gulp + bower + ??? or something else.

What is a decient editor for javascript. I currently use atom as my text editor of choice but I'm not sure it is any good when refactoring in JS (I'm used to IDE's)
 
VSCode w/ TypeScript
both of those are negotiable.
 
Did we have this command?
!!editors
 
9:56 PM
@Zirak That didn't make much sense. Use the !!/help command to learn more.
 
!!learn editors "https://gist.github.com/Zirak/9999e97e01a7bd0a76f6"
 
@Zirak Command editors learned
 
I spent probably 3?4 hours total on that can counter.
all so I don't have to count cans to return them for $$
I love over engineering problems.
 
Wes
Wow
 
@FlorianMargaine Maaaaybe? It was something insane that we never heard of before...shit, I'll have to ask him
 
Wes
9:58 PM
I saw atom on that list. Maybe it will be good enough.
 
It was also before vscode was announced
 
Wes
Doubt I can use VS
:'(
 
I personally don't like it, but it's fairly popular
So's atom
 
@Wes VSCode is free.
 
Wes
wow since when does vs work on linux
 
9:59 PM
it's not Visual Studio
 
@rlemon it chooches!
 
Wes
okay trying that
 
@Luggage I'm putting you on the vscode recommender's list, anyone else?
 
I tried vscode for a couple of days
went back to emacs
 
Wes
so appart from that dev stack. I want unit tests and some framework don't care if its the most appropiate framework for my project or not.
 
10:01 PM
I know ssube uses it. half-sure @Loktar does
 
I stayed a bit longer on atom, actually, kept me going for a couple of weeks
maybe a full month
 
Wes
gulp + bower + mocha + react is that a good place to start
 
@FlorianMargaine It doesn't handle giant files well, especially not ones with huge lines in it. Neither does Brackets
 
drop bower, go npm
 
@Zirak meh, I don't care much about this specific use case
 
Wes
10:02 PM
Okay so I don't know any of these technologies. Problem is I end up dropping into pure JS (client side)
 
@Wes As the Cheshire cat said, it doesn't matter which way you go. You'll get somewhere if you only walk long enough
 
a wise cat
also a stupid one, getting in a deadpit is probably avoidable by asking for advices
 
@FlorianMargaine I was in a weird phase in life. What bothered me about atom (maybe it's better now?) is that splits felt like a 2nd-class citizen. You couldn't for instance open up a split and easily open a file you have in another split
The concept of "things which are open now" wasn't global, it was per-split. That was annoying
 
@Zirak yes, that was a hassle for me too
I'm used to emacs' C-x {0..3} convenience
 
And it had an air of...I dunno...clunkiness to it. Like everything was padded and stuffy.
 
10:06 PM
what mostly made me go away was all the errors though
I was getting huge JS stack traces on the whole screen several times a day
 
Wes
so used create-react-app
 
@FlorianMargaine One thing which I really, really miss outside of emacs is the kill-ring. Clipboard managers outside the fancy DEs are a luxury, but C-y M-y is smooooth
 
yeah I use vscode at home
sublime at work still though
I miss ctrl+shift+v in vscode though
such a habit in st
 
@Loktar What does that do?
 
paste with formatting
 
10:11 PM
@Zirak err... TIL M-y, and not really understanding what it does (trying a bit in emacs is.. confusing, and C-h k description isn't super helpful)
 
@FlorianMargaine Duuuuude you've been missing out
C-w and M-w add the killed/marked area to the kill-ring. C-y pops the top of the kill-ring, and you can use M-y after that to pop some more
 
oooh
is it going through the history of previous kills?
niiice
 
So you can reach something which was previously previously killed
Super useful, you're no longer afraid of C-wing anything
 
yeah, I've been wanting that now and then and was afr.. yeah, that
thanks, that's super nice
 
enjoy
If you're using helm there's helm-show-kill-ring (or something like it) which, well, yeah.
I think there's also an ivy/counsel version but I'm not sure
But there's also the vanilla browse-kill-ring
 
10:16 PM
I'm using helm these days, thanks
 
Wes
can't launch vscode from terminal. I'm used to doing something like atom ./blah or atom ..
 
I like you
 
what OS?
 
Wes
Mint
 
it's been a while.. but i half-reacall it giving me a commadn ti run to make the symbolic link.
but that's OSX.
 
Wes
10:20 PM
yeah that looks right but not for here
 
yea, vscode on OSX has a command to install the shell command, but seems linux does not..
according to the docs. try it. ctrl-shift-p nd see if thre is a 'shell command' thing in there
 
Wes
did that alredy
 
ohh, ok.
surprising that a linux package wouldn't put it in your path.
 
well, you have to start a binary, so worst case you can add an alias
fun
 
Wes
so I guess I just need to put an alias for /usr/share/code/code --unity-launch
sorry about the bad code paste
 
10:27 PM
@Wes I think running /usr/share/code/code should be enough
also, code is in my PATH on my machine
 
lmao these flags
you guys reading these?
 
I can't see flags.
 
Wes
no, but i got a ping by florian. hey florian \o
:B
 
@Wes wrong wes
:P
 
Wes
:D
 
10:28 PM
@wes Double ping!
 
Wes
@FlorianMargaine thats works thanks
 
Wes
hey lemon, loktar
 
Wes
Okay how do I change my name here
 
@Loktar friggin profound
 
hey @Wes
 
Wes
10:34 PM
@Wes sorry I don't know how to not conflict with your name
 
blame your unoriginal parents
 
Wes
no prob for me @Wes
 
here's a fun code challenge: codewars.com/kata/57680d0128ed87c94f000bfd
 
10:50 PM
@Zirak did I show you this?
[ralt@zap laap]$ ./bin/foo
foo on thread laap event loop 0
laap event loop 1
foo on thread laap event loop 2
bar on thread bar on thread laap evenbar on thread

bar on thread bar on thread laap evenbar on thread

bar on thread bar on thread laap evenbar on thread

laap event loop 29
baz on thread laap event loop 29
baz on thread laap event loop 30
baz on thread laap event loop 30
[ralt@zap laap]$ cat t/laap.lisp
(in-package #:laap-test)

(def-suite laap :description "Baz")
(in-suite laap)

(defun main (&rest args)
 
11:43 PM
@rlemon do you know any good realtors in the area?
 
planning to move to canada?
 
I'm moving (back) to canada on wednesday
 
11:58 PM
oh 😃 didn't know you ever lived there
 
00:00 - 16:0016:00 - 00:00

« first day (2387 days earlier)      last day (2563 days later) »