« first day (631 days earlier)      last day (3157 days later) » 

4:00 PM
@mikedidthis That lampshade hat is high fashion mate.
 
fancy dress ei?
 
content: "D"
 
has anyone worked with serve-static ?
#node / npm
 
@DarkAshelin Yeah
 
@SecondRikudo it serves to put folders/files public/accessible, right?
I can't get it to work
 
4:01 PM
Yes
 
What errors you getting ?
 
we had an old version of express3 working, but now with the change to express4 we can't get it to work
 
Codez?
 
express + app.use(express.static(__dirname + '/public')); FTW
 
no specific error on the ServeStatic, but a 400 not found for the files that I'm trying to access
 
4:02 PM
That ^ btw
 
@rlemon that's express3
express.static no longer exists in express4
 
express made some changes for file downloads/uploads from 3 to 4 if I'm not mistaken
 
^ that
 
They excluded it from their library, but I think multer will do that for you just the same
 
4:02 PM
@DarkAshelin for starters, I wouldn't make a static file server with node
 
app.use('/assets/' + module_name, express.static(public_path)); this is our old code
 
nginx/apache ftw
 
get to the nginx
 
now with the new update, it's supposedly reduced to this:
var serveStatic = require('serve-static');
serveStatic(public_path);
but doesn't seem to be working
 
var connect = require('connect')
var serveStatic = require('serve-static')

var app = connect()

app.use(serveStatic('public/ftp', {'index': ['default.html', 'default.htm']}))
you still have to app.use if you are using connect (express)
 
4:04 PM
@rlemon Why public/ftp?
 
try adding the index.html to the url, could just be that
 
@SecondRikudo copy pasta from docs
 
@DarkAshelin serveStatic returns a function
 
@rlemon Oh no ..
 
A function pass to app.use
 
You're not a .. copy pasterino are you
 
@Neil there is no index.html
 
Although if you were born of Twitch that would explain some things.
 
Canadian passports are the shizniz
 
@DarkAshelin Or whatever the index page would be I meant
 
4:06 PM
s/ passport//
 
@Neil none
 
Anyway @DarkAshelin
 
its just separate controller files
 
You want app.use(serveStatic(public_path));
 
@SecondRikudo tried, no change
though I must add that I'm not 100% sure the public_path is correct, though I see no reason why it should be wrong
 
4:08 PM
@DarkAshelin Can you make a runnable case?
 
@SecondRikudo what do u mean? like a fiddle?
 
@BasementKeyboardHero nice
 
@DarkAshelin No like a brief case with robotic legs maybe pneumatically powered that can run under its own power
obviously
 
fuck me
 
4:09 PM
@SecondRikudo I uhm... don't understand nearly enough node to make a runnable I think
 
@SecondRikudo CTRL+SHIFT+T reopens windows and their tabs ..
 
@Sippy Yes, and CTRL+SHIFT+W closes all tabs in the active window.
 
@SecondRikudo You mean it opens them
 
Yeah so open a new one and CTRL+SHIFT+T and it'll just create the tabs you lost
 
4:10 PM
@Neil I wish.
@Sippy I know
But it still made me want to bash the screen.
 
Ah
 
Not going to test this theory
 
@SecondRikudo is there any way for me to know which of the 2 is wrong? the path or the function
 
@DarkAshelin Let me set up a small-scale test case
 
@SecondRikudo I fell for it :D
 
4:12 PM
ctrl + alt + left arrow
Do it everyone! *snicker*
 
@SecondRikudo alright thx, if you set up the main structure I may be able to reproduce my issue
 
@DarkAshelin I got it working with just this
var express = require('express');
var serveStatic = require('serve-static');

var app = express();

app.use(serveStatic('.'));

app.listen(8080);
I ask for files in the directory and I get them.
What kind of errors do you get?
 
this is my full function:
'use strict';

var template = require("../controllers/templates.js");
var serveStatic = require('serve-static');

module.exports = function(app) {

    app.use(serveStatic("/public"));

    // Homepage
    app.get('/srv/contactboek/t/index', template.template_index);

    // Medewerker detail page
    app.get('/srv/contactboek/t/medewerker', template.template_medewerker);
};
 
@DarkAshelin /public?
 
just testing paths
 
4:15 PM
Are you sure you don't mean ./public?
As in, public that's found in the current directory?
And not public that's found directly on / of the machine?
 
current directory = root, or directive on this file in which the function is?
anyway I even tried relative paths, which should always work right?
for my testcase
 
If I had a weakness, it's explaining to a user how a certain concept simply doesn't make sense
 
@Neil Alt+F4 for hacks
 
@DarkAshelin Where is this public directory found?
Relative to that file
 
@TylerH It's supposed to reorientate your screen
 
4:16 PM
@BoltClock double points if you can reference the spec in the explanation
 
../public is the relative path
 
Only works in windows 8 though I think
Great way of pranking your coworkers
 
@DarkAshelin So one directory above the current script?
 
@SecondRikudo yes
 
@TylerH "It doesn't make sense because even the spec doesn't mention it whatsoever"
Ehh, I could go with that. What part of the spec deals with using clear with absolutely-positioned elements? None. Therefore, you can't clear absposed elements
 
4:18 PM
@DarkAshelin okay, I confirmed that if you're using a relative path, it needs to be relative to the script that's calling it
(I.e. the script that's calling that function you exported)
 
so app.use(serveStatic("../public")); ?
ooooor
 
@BoltClock I don't really get clear
probably because I don't ever use float
 
well you see var template = require("../controllers/templates.js"); on top of my file
 
@TylerH What do you mean?
 
@DarkAshelin Is public on the same level as controllers?
 
4:20 PM
I wrote my relative path according to that
@SecondRikudo yes
 
So yeah, ../public
 
but it doesn't work..
 
I don't like putting anything that is a direct dependency of another thing in a sibling or parent folder as a general rule
 
@DarkAshelin What do you get instead?
 
we can exclude that the path is wrong?
I get a File Not Found
 
4:20 PM
@BoltClock I mean I haven't really ever tried to learn about clear. I know it is supposed to reset float or w/e but I don't know expertly what that means
 
@DarkAshelin you're exporting a function out of this module
Who's calling that function?
 
I don't know this
 
@DarkAshelin I have this:
// index.js
var express = require('express');
var app = express();

require('./foo/bar')(app);
// foo/bar.js
var serveStatic = require('serve-static');

module.exports = function(app) {
    app.use(serveStatic('.'));

    app.listen(8080);
};
That '.' is not relative to foo, it's relative to the index.js file.
 
no matches found for my filename
 
4:23 PM
@TylerH it just means that whatever you have the clear on, it'll be after (vertically) any floated elements before it with what it's clearing
 
so I'm not requiring it anywhere
 
^ great video
that guy is my current idol
 
@SecondRikudo but the file is being loaded because if I use the app.get lines my routing shows 400 too
if var template = require("../controllers/templates.js"); is a relative path, won't app.use(serveStatic("../public")); be good too?
 
@DarkAshelin No
require is evaluated differently
 
4:25 PM
@ZachSaucier and it wouldn't normally be after those floated elements because they're floated and, as such, moved from the normal document flow?
 
Because it's outside the function.
@DarkAshelin the way I usually do it, is have a single index.js file which is the bootstrapper for all the routes and the such
 
@TylerH Ever tried putting an image next to some text in Word and found that the image was tall enough that part of the second paragraph starts next to the float?
 
@SecondRikudo trying to find where this function is called, but not much luck so far
 
If you want the second p to start beneath the floating image, you apply clearance
 
4:27 PM
@BoltClock Haha I actually avoid images in Word like the plague
 
var express = require('express');
var app = express();

app.use(require('./foo/bar'));

app.listen(8080);
This is what I normally do
lots of app.use calls all in the same place
I don't call app.use anywhere else in the app.
Also, by the way
app.get('/srv/contactboek/t/index', template.template_index);
I'm pretty sure that's invalid
if app is a valid express app.
Or rather, you'd have to access localhost:8080/srv/contactboek/t/index which I don't think is what you want.
 
@SecondRikudo no that one works
there's a lot of proxypasses
 
> Is this supposed to be funny? All I see here is a dangerously underweight gentleman that desperately needs help.
 
Yey for crapware
 
4:30 PM
@DarkAshelin are you sure that it's those that are called?
Maybe someone else is registering template.template_index?
Because app.get doesn't seem reasonable to me.
 
I am registering them in a separate file
'use strict';

module.exports = {

    /**
     * Public home page action
     */
    template_index: function (req, res) {
        return res.render(
            'contactboek/views/template/index',
            {
                title: "template index"
            }
        );
    },

    /**
     * Medewerker detail page action
     */
    template_medewerker: function (req, res) {
        return res.render(
            'contactboek/views/template/medewerker',
            {
                title: "template medewerker"
removing the code in either of the 2 files causes it to break
so it is using both
 
That's not what I mean
Look for usages on template_index
Is someone else placing it in app.use?
 
@TylerH jsfiddle.net/BoltClock/vk3b3gd3 Uncomment the last bit and observe
 
Sim
can anyone confirm if i did coding right jsfiddle.net/wjx40ob9
thanks
 
Granted it's a use case that's suited to word processing and not web layouts, but that was the original purpose of float after all
 
Sim
4:34 PM
@ZachSaucier quick question do you own this chat?
 
@Sim yes.
 
@BoltClock yeah, as I recall float was intended only for wrapping text around images. Then people started using it in layouts
 
Sim
@ZachSaucier i was curious since your always here
 
@Sim I own all of the StackExchange network, actually
 
lol
 
4:35 PM
@Sim not sure can't wait 30000.
 
@TylerH yeah because it was pretty much the only way at the time without people crapping on you for using tables
Or absolute positioning
 
Sim
@mikedidthis how u been man
 
All hail king @ZachSaucier
 
     \o/

/o/  /o\  \o\
 
Sim
4:36 PM
@mikedidthis change it to 2 seconds jsfiddle.net/wjx40ob9/1
 
We have aquired @Sim's location shall we charge up the flux capacitor ? @ZachSaucier
 
@Sim then yes, if that is what you want to achieve?
 
@mikedidthis what .. the ...
 
     \o/
/o/  /ω\  \o\
2
@ZachSaucier ^
 
4:37 PM
lol
 
Sim
@mikedidthis its working i know that part just wanted 2 make sure if i did it right i know its stupid question but just asked im not expert just learning along
 
@Sim rarely is there a right way.
 
@mikedidthis There are plenty of wrong ways though
 
totally
 
@SecondRikudo no
 
4:40 PM
@TylerH Remember this?
 
Hmmmmm...
What IDE are you using?
 
@BoltClock vaguely
 
@SecondRikudo we found out that the old express.static does still work, however the problem is that it needs to be executed before this function, otherwhise it's loaded too late. where we really need to execute the express.static would be inside our bootstrap but since this bootstrap is generic for the entire site we can't do this
requires some more thinking about
 
@DarkAshelin Wait, what do you mean it's generic for the entire site?
 
I guess
everything is bad
 
4:42 PM
You telling me you have multiple express app instances running around?
 
yes!
 
Holy crappy crap.
 
probably more than 10
also more than 10 different node apps
I don't know
 
I'm sure this was structured at some point
 
4:44 PM
5 hours ago, by mikedidthis
@DarkAshelin I <3 you but some of the stuff you say is scary.
 
unonebox pls, ty
 
10 express apps
I think I just had 10 strokes...
 
every morning, all devs here open 10+ terminal tabs to run nodemon in each app, before they can start developing
 
Sim
has anyone used turdownforwhat.js?
 
@DarkAshelin ewwwwwww
 
4:46 PM
@DarkAshelin I underestimated the crappiness of the place you work in.
Come work for us
 
and I repeat, for some reason this company is viewed highly by other devs
and having it on your CV means a lot
 
Great, it means you have better chances being accepted at my company
 
Our code isn't magnificent but we don't have 10 node apps
 
ur hiring?
 
4:48 PM
Yeah
 
link
 
I was told to collect CVs even if the job isn't listed on that page
So if you want, feel free.
 
@SecondRikudo allows remote work?
 
@DarkAshelin Don't think we do, no.
I'll ask, regardless.
 
:( forget it then
I'm not going to move
 
4:50 PM
Oh, don't you dare move from Belgium to Israel
 
hehe
would I have to wear a burka?
 
you've nothing to look for in this hell hole.
 
@DarkAshelin Yes.
 
Ah, no, you're confusing me with Patty.
 
@Sippy what if I don't?
will I get stoned?
 
4:51 PM
They KEEL u
 
Here you need an umbrella for all the rockets :D
 
Lol
 
4:51 PM
@SecondRikudo strong-ass umbrella
 
@DarkAshelin Oh yeah
 
morning
 
I heard a story about a guy who fired a Javelin missile at a terrorist during a firefight in Afghanistan, on the subject of rockets.
All that remained were his flipflops.
 
And cos Javelin missiles cost $85k that guy got demoted hard :D
That is a cool umbrella ..
 
4:53 PM
blinks
 
@SecondRikudo This is why Japan is fucking awesome.
 
@Sippy I had a better one under my belt
 
Sim
i tried using youtube iframe but its not showing button to full screen jsfiddle.net/yjrt81L0
 
brb watching Windows 10 event
dis gon b gud
 
@DarkAshelin I think your best bet at this would be to do something on nginx/apache's level
 
5:01 PM
try that one
 
I did it dirty in the bootstrap settings now, people will fix it later
 
XD
There are enough people
 
posted on January 21, 2015 by kbironneau

/* by railwaylabs */

 
Sim
@sippy do you have to know why it wouldn't do for width less then 300?
 
@Sim No idea.
 
Sim
5:05 PM
@Sippy they have it at 305 but full screen button does show up nthitz.github.io/turndownforwhatjs
 
object-fit:cover - medium.com/@chrisnager/…
> object-fit has fairly decent support in the latest browsers and there’s a polyfill for older browsers (IE8+).
/rant
 
@mikedidthis GO ON MIKE
 
@mikedidthis :d
@SecondRikudo INTERNET IS BACK ON!!!
AOT tonight braaaaaaaaaaaaaa
 
@SecondRikudo SOOOOOOOOOOOOO excited :D
episode 1
letsgooooo
and downloading rest tonight to watch at work
 
5:16 PM
@KeyboardWarrior Not really an anime to watch at work though
 
@secondrikudo and I am actually watching subbed now :D
@SecondRikudo I need my fix man... I have an addictive personality -.-
 
@mikedidthis i dont know why object-fit is getting so little traction with the browser vendors. its been part of opera for quite a while now: dev.opera.com/articles/css3-object-fit-object-position
 
if anything, I like the blue gradient background behind the logo on top
 
WaaS
Windows as a Service
love it
 
5:44 PM
@KeyboardWarrior well?
 
@SecondRikudo only on episode one, seems good so fat
far*
 
FAT FAT FAT FAT FAT
@KeyboardWarrior did you wipe away a tear?
 

« first day (631 days earlier)      last day (3157 days later) »