« first day (1907 days earlier)      last day (3048 days later) » 

3:00 PM
Do you import them in the files they're needed, then just import the single app? I was thinking of making a decorator like @App.Model that registers a model on the app and does startup tasks or something
 
you import where you need something
if you don't need it in that file, don't import it.
it sounds logical, because it is :p
 
Hm... I guess what I am after is similar to a Blueprint in flask, if that makes sense, where it's like a modular app that can be registered on the main app then imported into the main app and registered
 
crl
it's like nodejs, you are using it no?
 
export default new Blueprint('users', {
  controller: function () {
  }
});
// ... then in my main application
let users = require('./users/index.js');
let app = new App({});
app.register('/users', users);
 
I've been doing almost exclusively JS in the past year. I've never used Node. >:D
 
3:06 PM
how to install jquery in node help
 
npm install cheerio
 
@corvid why new Bluebird
 
crl
is there a npm install vanilla cheerio looks like jquery
 
user3119231
no, vanilla is out.
 
@BenjaminGruenbaum are you sure you are not tooooo much bluebird? :P
 
3:07 PM
@BenjaminGruenbaum Bluebird? Blueprint (this isn't javascript but it's what I am trying to emulate)
 
@rlemon Hai bby
 
@MadaraUchiha also, mongo does sharding in a much easier way. No joke, if your use case actually requires that sort of scale - mongo is a viable alternative.
@corvid oh lol
@AwalGarg was just closing issues in the tracker lol
 
:P
 
~test
 
MongoDB :|
 
3:09 PM
I hate mongo, but there are viable use cases for anything :P
 
Did you guys see the new "developer story" ? Do you like that ?
 
crl
it's not too bad
 
So I've been beating my head against a wall for almost an hour. Turns out, some idiot on the back end didn't properly set the dropdown values, so my comparisons weren't working right.
 
@crl The point bothering me is this: if SO starts to look like a job search place, my colleagues will be less happy to see me on it. Right now it looks like I'm training, and helping. That's OK. If it looks like I'm mainly showing off for recruiters, concerns might be raised
 
ugh, why do I always string.test(regexp)
I always hit the error then correct it
I don't think I'll ever learn
~test
 
crl
3:14 PM
@DenysSéguret sorry was replying on mongo, what's link for 'developer story'? meta.stackoverflow.com/questions/313960/…?
String.prototype.test= function(re){return re.test(this)}
 
-7
Q: Introducing the Developer Story

bluefeet TL;DR; We're replacing CVs with something you can use even if you aren't currently looking for a job. Update (Jan 4): added an FAQ section to address some common questions & concerns We've had a lot of announcements lately about changes to Stack Overflow, including the addition...

I didn't downvote, I'm not sure it's a bad move, I'd just like they don't confuse SO too much with a social network
 
Well, the community sure is divided on this update.
 
@MadaraUchiha mongo's tooling is... ok. It's not great. Postgres in general has great tooling, but I have no idea about the JSON side, so you might be right.
 
postgres is the best
you probably should be using postgres
 
I feel like I'm never going to use Dev Story because making my own web page would be better for this purpose, and would show I know something about web dev / design.
 
3:19 PM
Wouldn't it be easier to sell the site to LinkedIn, instead of morphing into it step by step? — Normal 21 hours ago
 
@FlorianMargaine Haha, my thoughts about SO Careers from the get go.
 
Steam's stupid trade holding bullshit is annoying
 
You hate my role? what did I do?
 
StackBook or FaceOverflow. which would it be?
 
@Luggage Cheif Spelling Officer
 
3:21 PM
because SO is moving closer and closer to Facebook
 
ohh, that.
 
crl
if Lug spell bad I wonder how bad I spell then
 
@rlemon Is ~test a new thing or something?
 
crl
@rlemon nooo
 
@Trasiva fucking with my own bot
but I'm not a very good developer
so it isn't going well :D
 
3:23 PM
@rlemon Ah, gotcha.
I find liberal amounts of alcohol can actually help with that
 
~test
hello world
and she works. :D
 
libertarian amounts of alchohol
 
hoo rah
 
crl
~help
 
I don't report on invalid commands
 
3:25 PM
~test
 
hello world
there is only one command, test
 
crl
~test
 
user3119231
~test
 
hello world
 
crl
3:26 PM
~~test
 
@rlemon now you can't speak anymore because your bot is blocking you
 
not blocking
 
holy shit, a coffee stack exchange: coffee.stackexchange.com
 
Okay so I really don't get this thing with mongodb... Why can't you update nested arrays? How can you make any denormalized "relational" data like that?
 
you can't send the exact same message more than once in a row
so you can stack ~test but the chat system filters it out
 
3:27 PM
~test
 
hello world
 
hey I made a bot too!
but it is headles
 
I basically wanted to mess around and get headless working
so that is what I did
decided now that I'm here I can mess around some
 
@AwalGarg CODE?
 
Pretty cool sprite/pixel art tool: aseprite.org
 
3:28 PM
@rlemon did you make cap work headlessly or wrote a new headless bot?
 
I have to do some headless stuff so I'll use yours as ref.
 
@pootis good question
 
@AwalGarg cap can work headless. I did test it
problem: my remote server doesn't wanna compile phantomjs
 
@corvid because that's updating the middle of a binary object
 
once I solve that I'm moving cap to the cloud
 
3:29 PM
@rlemon It's a binary isn't it?
 
crl
> pixel perfect // hehe
 
if you need to update a nested array independent of the external object, then don't nest it
 
@rlemon but it is still "browser running headlessly", not "cap running headlessly" :(
 
@BenFortune you have to build from source. right now gcc5 is crapping out on qt
@AwalGarg semantics
and not important (really)
 
crl
yea rob's bot is with phantom
 
3:30 PM
I'm not sure if I should separate my login page from everything else, or just make it look like a separate page with CSS. Thoughts?
 
Oh right, my bad.
 
I could just "fade in" the page once login is successful, or I could keep them separate pages and load the other when successful. Can't decide either way.
 
make each step of the login its own page
 
>> google something
 
@rlemon Says on the issue tracker you can build it with docker. github.com/ariya/phantomjs/issues/12948
 
3:31 PM
@AwalGarg BOT: AwalGarg's bot written with Rx streams and other hipster tech. Also zirak and towc are smelly.
 
crl
Does the chat really need some JS code? the present-users list is served in html and the rest just need the connection to the websocket
 
^ this is running purely headlessly
 
I want to type my username -> new page to type my password -> new page to submit
 
Haha
 
3:31 PM
@crl how are you going to read from the socket without code?
 
@AwalGarg this on github?
actual headless auth would be neat
 
@rlemon half on github, half on my PC
I am pushing, sec
 
crl
@jarvis Rx as rx.js?
 
got the auth bit on github?
 
@Loktar Do you use your steam controller regularly at all? I can't for the life of me get used to it
 
3:32 PM
@Cereal I hate it
 
crl
@ssube just from a server-side websocket client (nodejs)
 
It's so unnatural.
 
I really like it for mouse based games
But I can't aim for shit in anything else
 
I tried it with sims, just awful :(
 
crl
>>source bitch
 
3:33 PM
!!s/it with//
 
@rlemon I tried sims, just awful :( (source)
 
But I keep using it, because as far as I can tell ,it's the only way to turn on my steam link
 
Yup, I'm gonna fake the page. Have everything on one page and just use some CSS trickery.
 
@Cereal You, @Loktar, and I tonight? The final showdown?
 
@rlemon @pootis github.com/awalGarg/sochatbot clone, npm install, run with the following node flags:
 
3:34 PM
@Trasiva I'll be on, lol
 
node --use_strict --es_staging --harmony_destructuring --harmony_default_parameters --harmony_rest_parameters ./src/main.js
 
crl
@AwalGarg needs node 5.3?
 
@crl yes
Must be 5.3.0, else won't work
 
forked
will look at the code later
my back hurts :(
 
@Cereal Now that the holidays are over...I can actually play.
 
3:35 PM
remember to edit the config.json ofcourse
 
@rlemon I fucked mine up too.
 
@rlemon same
 
@AwalGarg I probably won't run it as is, I'll rip it apart and make my own :D it's how I learn.
so fuck yo config
:D
 
@AwalGarg
`api.urbandictionary.com/v0/define?term=${
		encodeURIComponent(args.trim())
	}`).then(res => res.json()).then(function format (result) {
this pains me
 
@BenFortune Absolutely; pitch in wherever you want!
 
3:36 PM
what about it?
 
Line break in string interpolation
 
ugly as shit to read
 
@Cereal put the encodeURIComponent in a tagged template.
 
@AwalGarg do that ^
 
@Jhawins Not sure how the number is so high; I'm skeptical how accurate that is
 
user1596138
3:37 PM
@ndugger Hmm
 
@ndugger My teamspeak module got like 4k downloads in the first week. Now it's on like 30 lol
 
I'd have if I wrote it, I copied from zirak's chatbot code and just quickly converted to use ES6
 
!!weather Coralville, IA
 
@Trasiva [object Event]
 
:(
 
3:38 PM
@corvid Thanks! I'm hoping to hit your issue today.
 
@ndugger Whenever you update a module, a bunch of sites download it to provide mirrors.
 
@ssube Ah... that would make sense, then
 
Depending on the keywords/day/moonphase, it's like 150 per update in my experience
 
@Jhawins So what were you in IC for last month?
 
@ndugger would it be okay if I added a PR? I like the way your framework works and want to use it myself, but want to add something. Also, can add documentation for a few things
 
user1596138
3:39 PM
@Trasiva No but I drove through on the 1st and the 18th
 
@corvid Absolutely, as I told Ben, feel free to pitch in wherever. It's open source for a reason
 
@Jhawins You pinged me here telling me you were in town, lol and then never responded.
 
if I'm the only developer that touches it, it will have issues... lol
 
!!youtube spoonman
 
user1596138
3:40 PM
@Trasiva family lives in Indiana, I go down I80 about 400 miles on my way there and go through IC
 
cool, it would be cool to add a blackbeard run command that started up database, redis, and started live reloading/hot code push on dev
 
@ndugger Needs moar rethinkdb support
 
@Jhawins Gross
 
user1596138
So I was just passing through. I would've tried to do lunch but I was pressed for time both ways
 
ugh, this repo is a fucking mess now :( I don't even wanna upload it to github :(
code got away from me
 
crl
3:42 PM
I'll write a bot using chat's websocket since noone except me consider it good
 
@BenFortune Ugh, I really don't feel like switching out the ORM just yet. I might have to soon, though
 
...
@crl how do you think cap / other bots work now?
 
@crl mine uses it
 
I'll have to rewrite my @Model annotation to fit whichever ORM is used
 
websockets bruh
 
3:42 PM
which is fine
 
@ndugger Why might you have to?
 
Hi All
 
crl
@rlemon I mean from server-side
not using phantom
 
mine uses it server side
 
the only problem is auth
 
3:43 PM
@BenFortune because the Model annotation does some shitty stuff to enable caching on the Model queries that are specific to the method names of that ORM.
 
and Awal got that working so it seems
 
crl
yea checking your sources
 
Any idea how facebook web app chat notification comes?
 
@Sivakumar Websockets.
 
@corvid vs just running things in setup or start?
 
3:44 PM
I don't have facebook, but do you mean the desktop notifications?
 
@ndugger I'm not entirely sure how to do that tbh (yeah I am a noob). gulp and then node dist/app.js? I feel like I am doing it wrong
 
what?
 
@Sivakumar Web Sockets now, used to request server ever x secs. before and used iframes for legacy browsers
 
crl
github.com/awalGarg/sochatbot/blob/master/sechatapi/… why no map, well hmm nvm, still ugly
 
@pootis that is called "long polling"
 
3:46 PM
The gulp stuff doesn't work for me, since it doesn't transpile the module. I have to use the runtime stuff.
 
if you were curious
 
@BenFortune But how & where that notification is rendering in the browser?
 
@BenFortune my gulpfile doesn't work for you?
 
@Sivakumar do you mean teh desktop notifications?
be more specific
 
Is there a danger with using port 80 with node?
 
3:47 PM
@ndugger Oh wait. It's start and not run? So just npm run blackbeard start?
 
@SterlingArcher you need to be root
some people don't like that
 
so proxy with nginx
 
@rlemon Yes. Its desktop notification.
 
crazy easy to do
!!tell Sivakumar mdn Notification
 
3:47 PM
@Sivakumar Notification
 
@rlemon @SterlingArcher or haproxy instead of nginx
it's a little easier IMO
 
user3119231
HTML 5 POWER
 
really?
 
@corvid No, I don't have a command to run the services. Is that what you're wanting to do? The setup script file is a real mess, so good luck lol
 
3:47 PM
it's like 7 lines of nginx config
done and done
 
I need to refactor that whole file
 
I've never used a proxy before. My old node server used port 80 because I developed on root (not smart in indsight)
 
listen appname 0.0.0.0:80
    mode http
    server lamp1 10.0.0.1:80 check
    server lamp2 10.0.0.2:80 check
 
Isn't nginx like apache?
 
location / {
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_http_version 1.1;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_pass localhost:3000;
}
 
3:48 PM
@SterlingArcher efficient apache
 
^^ simple nginx reverse proxy that'll work with websockets
 
upstream app_sourceundead {
        server localhost:7001;
}
server {
        listen 80;
        server_name www.sourceundead.com sourceundead.com;
        location / {
                root /var/www/sourceundead.com;
                index index.html index.htm;

                proxy_pass app_sourceundead;
                proxy_redirect off;
        }
}
 
@CapricaSix Thank you. So combination of websockets & web notification API... we can achieve right?
 
haproxy just does proxying, doesn't care what's in it, etc
 
So why do I want a webserver when node is already a webserver?
Or am I totally off here
 
3:49 PM
no fucking with headers, no location, just the proxy
@SterlingArcher node is an application server, you need a balancer/web server in front of it
 
@ndugger yeah, basically just start up a dev server with live reloading so it's easy to develop in
 
@SterlingArcher nginx is a better proxy and also serves static files better
 
Can't we implement the same (i.e same desktop notifictions) with service workers?
 
if node goes down, how do you show an error page?
 
Ohhh I didn't know that
 
3:50 PM
the balancer handles that
 
crl
github.com/awalGarg/sochatbot/blob/master/lib/common.js#L72 Why do you need to do cors browser request if you're running it from node?
 
Is that what a load balancer is? Just a backup webserver?
 
@SterlingArcher no, the balancer decides which application the request goes to
 
I'm the worst sysadmin im sorry
 
@crl it is meant to run at both places. but browser support is a bit buggy right now, investigating.
 
crl
3:51 PM
ew that bot can work either on browser or on node, .. ok ^
 
@corvid Well, you can add a new bin command/file, or just edit the setup.js file and add a new case to that switch
 
with haproxy, the proxy actually pings the app every so often to make sure it's running, and shows an error page if not
 
aanways, @SterlingArcher that config I posted is all you need. run node on port 7001 and put that config in sites-enabled for nginx, restart the server and you're done
 
it's just a layer in front of app/web servers and dishes out requests. like a receptionist for your website
 
3:51 PM
@ssube @rlemon thanks, I'll do that!
 
either haproxy or nginx will work fine
 
So we can do it with websockets & web notification API right?
can we implement the same (i.e same desktop notifictions) with service workers?
 
haproxy has some nice proxy-specific features, but can't really serve up fancy pages or index directories or anything
 
@Sivakumar no clue man -- now you're asking about a future implementation you wanna make.
 
@ndugger No, it doesn't transpile the npm installed module (blackbeard)
 
3:52 PM
Google says I should install nginx as root. Is sudo account enough?
 
also, I don't think you can emulate desktop notifications with any other API
 
@BenFortune did you grab from github, or from npm? Because you shouldn't have to transpile blackbeard in order to use it from npm
 
seems like a security risk .
 
@SterlingArcher yes, sudo runs things as root
 
the npm version has the dist code that's already been transpiled
 
3:53 PM
sudo runs things as root (unless another user is specified)
 
installing things (packages) always has to be done as root
 
@rlemon Oh ok.. I understand. Thank you :-)
 
Ahh so when it says run as root it doesn't literally mean "login to the root account"
got it
 
not telling you to RTFM, but man pages in general and nginx man page and docs are surprisingly easy to follow for all this....
 
3:54 PM
@SterlingArcher root is just the default name given to the user with superuser level access
sudo literally means superuser do
 
@SterlingArcher you never directly log in to root. Usually you use sudo. There are some cases where you switch users with sudo su.
 
@AwalGarg I am R'ingTFM, sorry I have questions about stuff I don't wanna ruin ;)
 
@ssube why not just su?
 
sudo su
!!afk vapenomics
 
@rlemon y
 
crl
3:56 PM
sudo sudo su
 
@KendallFrey because sudo su runs su as root, so you don't need root's password
 
You seem to be busy, but my question is longer to read than to answer... Wait, I'm asking if I should ask, that's dumb.


In a canvas-based app, images are moved and resized with the cursor, and can be rotated by 90° increments. When an image is rotated, we must compute the edges of the rotated bounding box to detect if the cursor is on them. However, the original non-rotated dimensions are passed to the canvas context function, since the context will rotate the image for us. Which of these implementations makes more sense:
 
if you are allowed sudo all, then you can become root without any pw
 
we set the root PW to a random value on our servers and nobody knows it
 
3:57 PM
sudo god - err - user 'god' does not exist
 
crl
setting the password to a random value? ew
 
@JacqueGoupil use a tree, store rotation at each node, when processing an event just work your way down
 
you can just disable password login.
 
@crl a very long, very random password when the image was created
 
@JacqueGoupil To me the obvious answer is to apply the reverse transform to the mouse cursor, to convert it from screen coordinates to world coordinates
 
3:58 PM
SSH is by key and nobody knows the root pw
so you ssh in with a key pair, then sudo su to get a root shell
 
@ssube that depends on your configuration files. By default linux does not require root's password, and distros meddle with it. Wiser distros like Arch Linux - they don't. And thus, su is enough to get to a root shell without typing out root's password (even if it exists).
 
crl
ok
 
but yeah, sudo ftw. su is old and crap
 
I'm still sick today, but well enough to work from home, and I really want to order pizza.
 

« first day (1907 days earlier)      last day (3048 days later) »