« first day (1537 days earlier)      last day (3636 days later) » 

13:00
yay
@iSaumya I get the expected behavior.
What are you seeing?
Days: 0 Hours: 8 Minutes: 57 Seconds: 45
Days: 0 Hours: 8 Minutes: 57 Seconds: 44
Days: 0 Hours: 8 Minutes: 57 Seconds: 43
8 hours 57 minutes and 43 seconds is the right time for my machine.
oh
Sorry
what does this mean?
"test": "node_modules/.bin/mocha --ui tdd"
I've misplaced things
13:03
@SuperUberDuper That this will be run when you call npm test
does it automatically test stuff in the /test folder?
Days: 0 Hours: 16 Minutes: 56 Seconds: 43 I got expected outcome as well
@SuperUberDuper That's mocha's default, yes.
ok
@SecondRikudo what about nested folders in test?
@SuperUberDuper IIRC it won't test them without an appropariate flag.
Yeah, add --recursive to the run arguments
13:06
ok
(: HELLO :)
What is --ui and tdd
@SuperUberDuper How familiar are you with mocha?
posted on December 31, 2014

Recently the news broke that Microsoft may be working on another browser instead of IE. After reviewing the available evidence I’ve come to the conclusion that, although Microsoft is making a few adjustments, and a name change for IE might be a good idea, the new browser will essentially be IE12. Still, I think we web developers should support the “new browser” narrative, even

I suggest you read this ^
It's not too long and is very easy to read
13:09
This is a basic question, but I'm a self proclaimed server noob:

if I have a node app running at "/", and I want another node app to run at "/community", how do I handle this?
@NickDugger What's stopping you?
Just run both
They'll run in completely two different processes and won't interfere with one another
I think my question is more about handling the routing
@NickDugger I do that with reverse proxy with nginx
do I just run the second app in a directory of /community?
oh, ok
I bind each node app to a different port
13:11
so I should look into nginx?
Then using nginx I reverse proxy to localhost:port
I separate my apps to subdomains
could I do similar, but handle them as routes (directories) instead of subdomains?
(server noob)
upstream ghost_stream  {
        server 127.0.0.1:2368;
}

server {
        listen 80;
        server_name blog.madara.ninja;

        location / {
                root /srv/node;
                try_files $uri @node;
        }

        location @node {
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_pass ghost_stream;
        }
}
This is how I do my blog ^
@NickDugger yes, again with nginx, using different location blocks
alright, fantastic, thanks
See in this example location / on the server block will try the static path ($uri) then delegate to @node
Using multiple location blocks you can delegate to different node apps (location /community {)
13:14
alright
makes sense
If you have HTTPS support, it's better handled in nginx as well (rather than using the https module)
bookmarking this chat permalink lol
BTW nginx is just an example, you can use apache just the same
I just prefer nginx :)
I've heard only good things about nginx
And rightfully so
It has a learning curve, but once you get past it, it's one amazing-ass tool.
13:17
Everything good has a learning curve.
who was it that kept regexing "-ass " to " ass-"? That would work here lol
13:34
sory guys again I'm disturbing you can anyone plz tell me why these following code is not working
(function ($){
	var countdown;
    var calcNewYear = setInterval(function(){
        date_future = new Date('January 01, 2015');
        date_now = new Date();

        seconds = Math.floor((date_future - (date_now))/1000);
        minutes = Math.floor(seconds/60);
        hours = Math.floor(minutes/60);
        days = Math.floor(hours/24);

        hours = hours-(days*24);
        minutes = minutes-(days*24*60)-(hours*60);
        seconds = seconds-(days*24*60*60)-(hours*60*60)-(minutes*60);

		countdown = days + " Days " + hours + " Hours " + minutes + " Minutes " + seconds + " Seconds";
I've also tried to declare the var countdown before starting the function, but still getiing the undefined result.
any help guys?
@SecondRikudo any help?
actually I'm trying something like this:
(function ($){
	var countdown;
    var calcNewYear = setInterval(function(){
        date_future = new Date('January 01, 2015');
        date_now = new Date();

        seconds = Math.floor((date_future - (date_now))/1000);
        minutes = Math.floor(seconds/60);
        hours = Math.floor(minutes/60);
        days = Math.floor(hours/24);

        hours = hours-(days*24);
        minutes = minutes-(days*24*60)-(hours*60);
        seconds = seconds-(days*24*60*60)-(hours*60*60)-(minutes*60);

		countdown = days + " Days " + hours + " Hours " + minutes + " Minutes " + seconds + " Seconds";
you're only replacing the element once
actually as I'm adding html
I want its countdown var to change
but not add the whole html
So I tried to make the variable global
but still showing undefined
Here's a thought, put the console.log inside the interval ?
I've made a jsfiddle
so that u can see the issue
u guys see the issue? inside jsfiddle?
that same undefined issue I'm facing
while I want to place the countdown variable value at the place of undefined.
13:47
Try listening - YOU HAVE TO DO STUFF INSIDE THE INTERVAL
@SecondRikudo will you please see and help?
@iSaumya Listen to @adeneo.
@adeneo this might looks good in the jsfiddle
but the senario is different in case of real page
in my page
if I put the .after() before interval
it just keep adding one <p> tag every second
because he uses a html, not an after
That's because that's what after() does, it's the wrong method
13:49
unless the page crashes
so what function should I call?
tell me
> The user has been kicked and cannot return for 1 minute.
for the record, @iSaumya, we don't owe you anything. Asking users helping you to "tell you" is rude.
I want to add this specific html after some specific html classes
when I searched on google I've found .after() and .insertafter() to use
@iSaumya Take that message, exactly like it is, and google it.
do u guys suggest me to use anything else?
"I want to add this specific html after some specific html classes"
13:53
I did
thats where I get informed about .after() and .insertafter()
@iSaumya - You can't use those methods in a loop, as they keep insterting the element and doesn't overwrite it. You should be using html
@adeneo ok but how can I use .html() to add html after cetain classes?
as I know .html() works this way
$( "div.demo-container" )
  .html( "<p>All new content. <em>You bet!</em></p>" );
@iSaumya Add an element once after the element you want, and edit (.html()) that element repeatedly.
<shamelessplug> Concatenating html in strings? Why not try $.HTMLBuilder? github.com/ndugger/jQuery.HTMLBuilder.js </shamelessplug>
@NickDugger I... kinda hate you for writing that :P
13:58
lol
I translated it to a non jQuery version afterwards
It's not that
The only place I'd ever want to use an HTML string is if I have some sort of server-side rendering.
Anything else would use DOM nodes, heck, even jQuery wrapped DOM nodes
But still nodes
You wrote a glorified JSON to XML (or rather HTML in this case) converter
Hey, still better than concatenating stringy html in your js files, lol
Which I kind of don't get its usecase (unless, again, you get this format from the server you don't control).
@NickDugger Exactly what I'm saying, if you do that, you want to change, and if you change, you want to change to the proper way (which is using DOM nodes anyway) :P
Q: Why does this modify rows
14:04
Q: because
@FlorianMargaine Well I cant change the html the way you have showed me. So I've done this instead: jsfiddle.net/tx8413jc
var rows = [];
  for(var i = 1; i < this.table.rows.length; i++) {
    rows.push(this.table.rows[i]);
  }
for(var i = 1; i < this.table.rows.length; i++) {
    this.table.rows[i].innerHTML = rows[i-1].innerHTML; // this line modifies `rows`
  }
does that work?
@iSaumya You are misunderstanding how things work.
You're basically doing this:
Ohhh
14:05
@Cereal it's 2 references to the same DOM object
nevermind
var a = 1;
console.log(a); // Expect it to be 2
a = 2;
use .cloneNode
Yes, I just realized. Thank you
@FlorianMargaine yes it is working fine...
@SecondRikudo why this: jsfiddle.net/tx8413jc is still wrong?
14:08
@iSaumya Because you set countdown to nothing
Then you schedule a function to run sometimes in the future to set countdown to something else
And then immediately, without waiting for that function to run, add countdown to your HTML (while it's still set to nothing)
var countdown = days + " Days " + hours + " Hours " + minutes + " Minutes " + seconds + " Seconds";
And then while the variable changes correctly (because the function changes it), you do nothing to reflect that change in your document.
@iSaumya That only happens after you already write it to your HTML
Which is why everyone here are telling you
Do it inside the setInterval function
i did it inside setinterval
No, you did not.
(function ($){
    $( ".header" ).after( '<br /><p class="ism-notific" id="ism"></p>' );
    var calcNewYear = setInterval(function(){
        date_future = new Date('January 01, 2015');
        date_now = new Date();

        seconds = Math.floor((date_future - (date_now))/1000);
        minutes = Math.floor(seconds/60);
        hours = Math.floor(minutes/60);
        days = Math.floor(hours/24);

        hours = hours-(days*24);
        minutes = minutes-(days*24*60)-(hours*60);
        seconds = seconds-(days*24*60*60)-(hours*60*60)-(minutes*60);
14:11
Changing the variable in JavaScript will not change anything in your HTML.
@iSaumya That's not the same code as the one in your fiddle.
That code is correct and it works fine ^
oh! Then I might forgot to save the fiddle code
Extrmly sorry
@iSaumya LGTM
:)
Thats why I was thinking why u are saying it is wrong
14:13
Wish you all homies a very happy and prosperous NEW YEAR! See you all in 2015 :D
I completely forget to update my fiddle
:P
LOL
Thank you guys for all your helps
This version is slightly better
In this version, you save the p into a variable once, and then use that, this means that you don't need to ask the document for the same element every second, but instead remember it.
@SecondRikudo amazing
I'm updating my script.
@SecondRikudo but i do have a <br /> before adding <p/>
will that still remain in apprend?
@iSaumya Why?
Why do you have a <br>?
14:19
because my theme <p/> has display inline block
I cant change my theme as I'm implementhing this on a wordpress theme
@iSaumya That is extremely idiotic
so I need to add br
Use a <div> then
Not a <p>
well, I'm using p because the current design for the p under the header element is exactly what I want
So I dont have to add cny more css
@iSaumya That is the wrong reason.
"I don't have to write any more CSS"
If you have .header p { bla bla bla}
Just have .header p, #my-div { bla bla bla }
14:22
cant I simply add a <br> ?
@iSaumya You shouldn't simply add a <br>
Don't contribute to the crap that's already going on.
inline-block <p>s are already an abomination
Thats a well said
ok will do div then. Anyways whats wrong with br?
why u hate it?
@iSaumya <br> is a line break in text.
14:23
not all p
this is
a <br>
the ps under .header
That's what it should be used for
I got it
ok
To break text, where it semantically makes sense to break it.
14:24
will do div
It should not be used as a visual tool.
ha ha ha :D well said
The distance between what you have and that ^ is not big
That
ROLF
Great :D :D :D
@SecondRikudo in your code, append added out <p> tag inside the p tag we currently have
is there any chance you could get a free windows server 2012 r2 developer license ?
14:36
Through a school, maybe
        we have this
        <div class="header">
        <p>already here</p>
        </div>
     what ur code did:

    <div class="header">
    <p>already here
    <p>my p here</p>
    </p>
    </div>
what we need:
<div class="header">
<p>already here</p>
<p>my p</p>
</div>
Microsoft do nothing for there children @Cereal
i mean there developers...
@SecondRikudo do you get that?
@iSaumya i think we all got it :-)
oh ok
14:37
@iSaumya No, that's not what my code does.
You're welcome to take a look ^
Your HTML source is most likely malformed
I'm investigating
@SecondRikudo :
	input: function (tag, type, meta) {
		return $.construct({
			tag: tag,
			attr: {
				type: type,
				id: "field" + meta.dbFieldName,
				placeholder: meta.displayName,
				"data-field": meta.dbFieldName,
				"data-line": meta.ordinal,
				"data-type": meta.type,
				"data-word-count": meta.wordPrice || 0,
				"data-optional": Number(meta.optional)
			}
		});
	}
This is one of the use cases that I'm using at work
I get data from api calls, and convert them into DOM
@NickDugger But you can do that with "pure" jQuery too.
return $("<" + tag + "/>", { stuff with type and meta });
Yes, but this is faster. it does all of that "pure" jquery stuff in the function. all you have to do is pass an object. Otherwise you'll get all sorts of $("<input>").attr({ type: "text" }); or something
jQuery is very good at creating DOM nodes from various data formats.
14:47
It's just a shortcut
I never claimed that it's spectacular lol
:P
Well, if you wanted "fast" you would have used document.createElement and not jQuery
But that's none of my business :P
tell that to my coworkers, please...
I didn't have a choice
Bring them to me.
What browser IE support do you require?
When I converted my script to regular js, I did utilize documentFragments, though
ie8
@NickDugger Ah, well, that makes sense then.
14:48
trust me, they don;t believe that I can support ie8 without jQuery...
I would have used jQuery too if I had to support IE8
It's not that it's impossible to do without jQuery, it's just that in that case, I think that jQuery is worth it.
github.com/ndugger/HTMLBuilder.js/blob/master/htmlbuilder.js is the better verion of my HTMLBuilder (no jQuery)
I'd say that it rivals rlemon's fragment builder... it basically does the same thing, but mine is better because he's not here to defend his
4
@NickDugger I like your logic
14:53
@NickDugger if you're already using Array.isArray, go all the way and use collection methods (forEach, map) instead of those ugly-ass for loops.
for loops are not ugly :(
@NickDugger it doesn't work on IE8 though
doesn't need to
@FlorianMargaine No one cares about IE8
At least no one important.
6 mins ago, by Nick Dugger
ie8
14:54
20 secs ago, by Second Rikudo
At least no one important.
Game, Set and Match.
oh, that's cheap :)
I like that.
how is this gif related to the conversation?
@FlorianMargaine Wrong room.
14:57
See the HTML/CSS/Web Design room
You're welcome!
yeah, the room still sucks
(off topic): Any opinion on putting an ssl private key in source control. With a strong passphrase, of course.
@Luggage Yeah, don't.
your private key security becomes the passphrase instead of a 2048 bytes protection...
You reduce entropy by a lot when you do that
Unless your passphrase is around 400 characters long
And is completely random
15:04
it was going to be "password".
j/k :)
Removed space from room name
hm.. ok.. My only motivation was that my infrastructure guy only has backups of the VM. I prefer the configs and instructiosn to create new productions machines from scratch instead fo relying on runnign backups
i'll ahve to ask him for some separate secure storage, then.
@Luggage if the repo is internal only, it'd be ok though
It is. corporate SVN server. Active directory auth, only accesible internall or over VPN.
but most of IT has read access.
Why do everyone seem to adore Active Directory so much? :|
15:09
because we are a MS shop.
and it's our goal to use one password everywhere.
Is there any alternative that performs the same or similar functions?
this machine in question is a linux nginx 'load balancer'...
Alternative to active directory? sure. but i'm not going to convince xerox to change just because I have no love for AD.
(implicit in that question was "...and if so, what are they?")
it's also accessible as an LDAP directory, of course. I can use it from any environment.
Migrating a large windows shop off of AD gets me nothing and I don't see a benefit. It's not really a concern of mine.
@Luggage go for it then
@TomW LDAP in general, but ubuntu had something...
15:16
yea, LDAP seems to be universal and most of my integration to AD is through that protocol.
though both LDAp and AD are a mess. Every directory has it's own structure with different keys.
aha, Landscape looks like it has an equivalent to Windows Group Policy as well
I was wondering how you were meant to do that sort of thing in a nix world
you could just deploy a package
in a custom repository, of course
15:19
and PUSH that package?
then connect to all machines in ssh and run sudo apt-get upgrade -y
well, you could automate that with a simple script and ssh.. but..
yea, that.
@AwalGarg ^ OH FUCKING HELL
NO SHIT THEY BLOCKING GITHUB ~!
wait, what?
Who is 'they'?
Govt. of India
15:21
wtf
AAARRRGHHHH seriously somebody hire me, i don't wanna live in here anymore
Why isn't wikipedia on the list?
@E.Sundin Wikipedia requires source :P otherwise the stuff is removed or countered the source is removed
@phenomnomnominal how's 2015?!
because wikipedia didn't host any ISIS content, of course
15:24
Right. So the people in the Indian government who are responsible for regulating access to the internet have no comprehension whatsoever of how the internet works.
Why is India blocking code pasting sites, and gists?
@NickDugger because you are not da love charger
@NickDugger apparently those sites hosted material connected to ISIS.
India never seems like the... "brightest" place on earth...
@FlorianMargaine Oh savior of the universes, you will allow us to have pasties still
@NickDugger It surely isn't.
15:25
in PHP, 44 mins ago, by Paul Crovella
India's government has apparently asked ISPs to block access to github. Happy new year, and good luck to everyone working with teams over there.
India has a lot of... jquery "developers"
more information ^
Goodbye Room.
I will miss you all :'(, I am pretty sure one day before any of us could act they will ban Stackoverflow too.
@NickDugger India has alot of telephone "support"
lol, that too
15:27
> China blocked the code repository service last year, but the forces behind the country’s ‘Great Firewall’ recanted and made GitHub available such is its importance for tech companies and pretty much anyone who codes or uses code.
if you remove the source of copy pastes... things go wrong
India should block jquery.com
Love that site. Almost makes me want to use firefox. Almost
They made that Developer-focused browser a little while ago
Is it sad that when I see/hear "India", I automatically imagine a bunch of jQuery enthusiasts, copy/pasting snippets from "top 25 jQuery plugins" lists?
@FlorianMargaine I am a JavaScript programmer, what's a "64-bit integer"?????? There is no such thing as a long long?????
Math.log2(Number.MAX_SAFE_INTEGER)
53
user1596138
15:50
Err, not appropriate right now :P
user1596138
Good morning all
user1596138
LOL @SouthernCalifornia dying over 6" of snow
user1596138
user1596138
16:06
@NickDugger It's mildly offensive, but not sad :P
I have an angular question: Does $http support a POST call with also an object provided to generate URL parameters?
I can't find anything in the docs about it and was wondering if anyone had to do something similar
16:24
morning
@MikeNolan URL parameters?
@SomeKittens Yeah, like url query params. example.com/foo?bar=baz&thing=otherthing
Why do you need GET params on a POST request?
Because I didn't write the API :\
The API takes an authentication token in the url but the rest of the params in the body of the POST
AFAIK, you'll need to do that manually
Okay, I figured as much.
16:29
posted on December 31, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Slow descent into madness continues into a New Year.

16:40
goooood morning happy new years to some of you
16:50
@Shmiddty same to you.
oh dear :-x butter fingers
user1596138
....guys :(
user1596138
I have if (value !== "performer") {.. When the value is "venue" I get "unexpected token v" and that doesn't make any sense to me.
@Jhawins Yep, even funnier here.
What happens when the value is other values?
user1596138
Always the first character as unexpected
Happy new years
user1596138
16:53
Wait a minute...
@paqogomez Welcome. Don't star random things.
meh, ok... sorry guys
user1596138
Nevermind. I'm using an interesting framework and it's making debugging difficult. It wasn't that line
Have we officially complained about that hat?
user1596138
The star one?
16:56
The one that encourages random starring of messages.
yes
user1596138
Yeah, if it were a secret hat it would be fine.
user1596138
That's my opinion :P

« first day (1537 days earlier)      last day (3636 days later) »