« first day (2319 days earlier)      last day (2628 days later) » 

3:02 PM
I'm needing to add CA before the $ symbol for items from Canada, but it's so ugly, I'm considering using 🍁 instead
 
In angular2, is it possible to do routing with HASH?

I'm trying to create a sub route for a tab component in a user profile page.

for example:
localhost/user/foo#tab1
localhost/user/foo#tab2
localhost/user/foo#tab3
 
@rolu It's going to do that for browsers that don't support the History API automatically.
Why do you need to worry about it yourself? It's something that Angular handles for you.
 
He wants to do both.
hash routing just for the page-specific part, like the tab.
 
we'll I want to lazy load each tab contents. @Luggage thanks i wasnt clear enough
 
3:07 PM
1 message moved to Trash can
@rolu Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
I have the user profile routes set up like this:

const routes: Routes = [
    {
        path: '',
        component: userProfileComponent,
        children: [
            {
                path: '',
                component: ProfileAllVideos
            },
            {
                path: 'all-showcase',
                component: ProfileAllShowCase
            },
            {
                path: 'showcase',
                component: ProfileShowCase
            },
            {
                path: 'about',
 
🍁$10.00
 
I know I can add a fragment to each tab el:

<a [routerLink]="['all-showcase']" fragment=>All Showcase</a>

which will add a hash "all-showcase" to the url
 
@Luggage Perfect, right?
 
Any experts on git here? I am learning git and wanted to vet something around detached head with someone to see if I understood it. Not necessarily in here though but I was given this room name as a tip on people that knew the internals of git :)
 
3:16 PM
Ask away. I get git.
 
OK, I read that a "problem" with a detached head is that might end up losing changesets later, if a gc occurs. The way I see it, if I do a single commit, changing one file, I get a few new git objects, a new blob object, a new tree object referring to the blob, and a new commit object referring to the tree. Right now only HEAD refers to this new commit.
However, if I later checkout master, the objects still exists on disk, but neither HEAD nor anything in refs refer to them, so a gc at this point might clean them up.
If I explicitly create a branch referring to my new commit, a reference exists, and thus gc won't clean it up. Is this about right?
 
Yes.
 
Thanks! That means I understood the git internals about objects :) I'm coming from mercurial and the way branching and things work is different :)
 
You are typically only on a detached head temporarily, though.
 
Yep, and unless a gc has occured, I can also checkout the same commit again, which again, temporarily, points HEAD to it.
 
3:19 PM
Like if you checkout a random commit as part of a 'git bisect' or if you reset master to another commit and are about to make a new branch at your present location
 
So if I have the history 1-->2-->3-->4-->5-->6 (master), I can reset master back to 4, which means I'm now at a detached head (at 6), and I can now create a new branch at 6? Is that what you mean?
 
true, but you'd typically resolve the situation on the spot, not like tomorrow.
 
No
When you git checkout master && git reset 4 you aren't in detached head mode.
reset moves the master pointer back to commit 4
 
i think you are.
right
 
When you git checkout 4 you're in detached head mode.
 
3:22 PM
if you put master back to 4 but HEAD -> 6, then that's a detached head, too
 
Yes, I understand that, I'm not trying to learn how I can actively use the detached head state, I'm trying to learn git internals because at work I will probably be the go-to guy when people get stumped. So I can't limit myself to learning the command line only.
I'll test the 1-->...6 example :)
 
Also, if you have a tag on 4 (say release/four) and you checkout the tag with git checkout release/four you're in detached head mode.
 
just branch anything you want to keep before leaving your seat. no problems.
and yes.. ^ a detached head doesn't always mean you can lose something, sometimes you are pointed to something in history.
 
@LasseV.Karlsen The warning is about changes and commits you make while in detached head mode.
 
Yep, it just means that HEAD refers to it but no other named object
 
3:24 PM
@LasseV.Karlsen Yes,
 
More interesting question, please. :)
 
And that means that if you make a commit now, you'll create an unreachable commit
 
but you can just branch..
 
By unreachable you mean "without knowing its hash", still assuming a gc hasn't cleaned it up.
 
Unreachable commits are still reachable if you remember their hash, or if you use git reflog
 
3:25 PM
Yep
 
And if you invoke git gc, it will be removed.
 
if you have to use reflog, punch whoever fucked up.
 
Of course, you can still, while on an unreachable commit, just git branch foo, and the commit becomes reachable.
@Luggage I had to use reflog exactly once. And I did punch myself.
 
git reset 2 got rid of everything after in the log, I wasn't in a detached head, I was back at that changeset and the following changesets were dangling (did not appear in the log).
 
perfect. the system works.
 
3:26 PM
@LasseV.Karlsen Right
git reset moves the pointer of the branch you're on back to the commit you say
but it doesn't change the working directory
 
git reset (hash of previous tip) got me back.
 
So all the changes between 2 and 6 are now in the working directory, waiting to be added and committed
 
Exactly, the working folder still contained the file from the previous tip.
 
git reset --hard will also reset the working directory.
 
can someone tell me how to make a callback inside a callback function : jsfiddle.net/j57bkdaq/1
 
3:27 PM
git reset --hard created unreachable commits
 
ok, we're just masturbating to reset at this point.
 
Now, 3, 4, 5 and 6 are unreachable.
 
At work everybody comes from TFS so I'm foreseeing a pleasant future of merge problems :P
 
hahah, TFS. Their minds are screwed.
 
If you want them back, you have two options
If you've already pushed master when the tip was at 6, you can git pull and get those commits back, no problem
If you haven't, you have to use git reflog to find the hashes again.
And reset master back to the hash for 6.
If you push, reset, commit and try to push again, it will fail because the branches diverge
 
3:29 PM
git reset --hard didn't remove anything from the objects, I reset --hard back to 2, then back up to 4 (I only went to 4 in my test here), and everything was kept.
 
@LasseV.Karlsen Right
reset doesn't remove anything.
 
--hard did modify my working folder though, brought it back to the stage of 2
 
It changes the pointer (and optionally, the working directory) to the specified commit
The previous commits still exist
But if you run git gc they'll be gone.
 
Yep
OK, thanks guys, this was helpful!
 
Anytime
Also, have your coworkers complete this:
 
3:31 PM
let your users only ever push fast-forward commit and most problems are reversable without getting too crazy
 
no git push -f allowed for people that don't know what they are doing
 
@MadaraUchiha Thanks, bookmarked and I'll go through it myself :)
 
Currently reading through Pro Git.
 
3:33 PM
You may need so use some controlled substances to get your users to forget all about TFS.
Tabula Rasa
 
I don't think anything ever will make them forget that, I think we're well into damage control territory by now.
However, most came from SourceSafe before that so at least we're moving forward.
Now if I can only wrench the stone tablets out of their hands....
 
Jesus. I dropped source safe for CVS in 2004.
 
So, to those who suggested that my problem is related to console, you are of course right
 
And even that was too long.
 
But this type was new to me
 
3:36 PM
I'm always right
 
I'm surprised MS still has console.log bugs in Edge.
 
@Luggage I got the women in school question wrong (I said 5)
 
The signature of IE/Edge console.log is different, so it failed when called with multiple arguments
This results in TypeError: invalid calling object in that case
 
I use console-polyfill that makes those issues go away.
oh.
 
@Luggage We use "a" console polyfill, that doesn't cover this
 
3:37 PM
IE/Edge has the worst dev tools possible, not accounting for Safari, whose dev tools don't even count as dev tools
 
@ndugger The problem only appears while the DevTools are closed, so, in that case the tools are awesome ;P
Because opening them is already the fix!
Magic
 
yea.. same bug as old IEs. a console.log before the dev tools were open would silently fail
and you'll never see an error.
 
It didn't used to be silent
it used to just break the whole site
 
it was. That was the problem. You'd open the console and see nothing
right
 
It's interesting to note that the number of people in poverty hasn't really changed since 1975, just the percentage of people. (Since population has grown substantially)
 
3:39 PM
I lived below the poverty line while working for a startup company. I slept on an air mattress and couldn't afford any furniture
It went on for a year before I decided that the abuse wasn't worth it
 
the % has gone up according to that
 
This is the type of poverty where an air matress is but the fevered dream of a madman.
 
I don't think you understand how poor I was, and I lived in a bad area in a really shitty apartment that got broken into regularly
 
Ah. That's just the US, not the whole world.
 
they probably took one look at the air mattress and then laughed and went on their way
 
3:42 PM
@Luggage Which is what I remembered. That console.log is replaced when you open the DevTools in newer versions, that was new to me
/s/console\.log/alert/g
 
@MadaraUchiha Very nice and visual git tutorial, thanks for that link!
 
Back to reliable debugging methods!
 
@Luggage I slept on air mattresses for about a year
 
mornin
 
o/
 
3:45 PM
I wonder if they're considering debt as income
But nobody really answered my question. What is your motivation for staying alive?
 
my family
 
@Shmiddty Dying is a PITA
 
and expensive
 
@FlorianMargaine that's a good reason
 
3:50 PM
I'm scared of death.
 
@Luggage He's more scared of you than you are of it.
 
I don't really have any motivation for living
 
Death, Death of Rats and Luggage
 
Being dead would be boring. I can at least do stuff while alive
 
It's not boring
 
3:53 PM
@ndugger well, if there isn't an afterlife then it isn't boring, it's nothing
 
Are you dead?
nothing sounds boring
 
if there is an afterlife, it's probably not boring
 
Not at the moment
 
@ndugger nothing can't be boring
 
I'd find a way
 
3:54 PM
you'll just get null reference errors
 
You were dead for about 13.7 billion years. How did you find it?
 
boring
 
your mom is boring
 
Can confirm, his mom is boring.
 
The fuck, when did this happen?
 
3:58 PM
So I've been thinking about making a game
 
@BenFortune oh, wtf
 
@BenFortune It's optional
 
Everyone thinks about making a game. :)
 
You don't have to buy the commercial license.
 
> Nodemailer is available under a more restrictive license without a fee, so you are free to test Nodemailer before actually buying anything.
 
4:00 PM
use createJS for gaming
 
> European Union Public Licence
 
@Shmiddty I'm not familiar with the european union licence they cited.
 
nodemailer is suitable for marketing email?
 
the UK can't use that license.
 
@Luggage lol
 
4:01 PM
@Luggage Sure we can
 
Also fuck you, I'm still bitter
So basically, if I don't want to go with GPL then I have to buy it?
 
@BenFortune Correct.
 
that says commercial use is ok.
ohh.. it's full gpl? not just include source of that library?
 
Yeah, full GPLv2 apparently
Or at least equivalent
 
4:03 PM
@jacobian maybe
 
are jsx comments on codepen not working?
I'm doing {/* this is a comment */}
 
so we need to have vps to install nodemailer right?
 
@jacobian Not really, you can use it on anything that supports Node.
 
nevermind, it accepts normal comments.
 
You know that "Never allow this page to create alerts again" checkbox? How do I allow alerts again after I clicked that? ...in Edge
 
4:08 PM
reinstall windows
 
@OliverSalzburg edge GPO i think
 
well I still use that default email service in cpanel. so yeah I'll look into it later then.
 
oops.. i just realized that the code I wrote, I wrote earlier, too. It's all duplicate work.
 
user2620028
@Luggage right? i even made a couple lines of code for one at one point
 
@KarelG I need a GPO to revert my click on "Prevent this page from showing additional messages"?
 
4:14 PM
 
@BenFortune That's not it
 
I didn't even check sorry lol
 
hi
 
Love how I get this when I press F1 in edge
 
4:16 PM
@BenFortune I just randomly clicked the "Should I trust this site?" link you get when you click the lock next to the URL. That performs a Bing search for "should i trust this web site"
 
hahaha
 
@OliverSalzburg edge manages most advanced rules through GPO and registries ...
 
Something along those lines anyway
 
you have to search through it
it's far easier at firefox, which is stored in the browser's config
 
@KarelG It doesn't seem very advanced to me and overly specific
But I'll check for it
 
4:17 PM
@OliverSalzburg Clear browsing data, notifications permissions
 
ah ya know MS
 
That being said, the GPO would probably only set a registry key anyway :P
@BenFortune I have Edge set to clear all on exit
 
well, that's why i said to check them
 
Touche
 
hmm
 
4:21 PM
0
A: Browser dialogs (Alert, Confirm, & Prompt) not longer working in Internet Explorer & Firefox on a specific Windows install

asusfanI had this problem using a Windows 8 tablet running IE 10 and solved it by Enabling 'Allow websites to prompt for information using scripted windows' option under Internet Options -> Security Tab -> Custom Level

This also sounds good, but the menu is gone in Edge :P
 
13 mins ago, by Luggage
reinstall windows
:)
 
Okay, either I broke my test code or Edge even blocks alerts in InPrivate sessions now
The former. Outside of InPrivate everything is still fucked though :(
 
        this.data.data.push(data);
best piece of code I wrote in years
 
I'm getting "Uncaught Error: Objects are not valid as a React child (found: object with keys {AssetList, EPRID}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of Anchor."
 
@BrianJ Pretty straight forward
 
4:26 PM
Hey JS ! Community out there what do you think of my answer on JS Namespaces ?
5
A: How do I declare a namespace in JavaScript?

Divyanshu RawatThe Module pattern was originally defined as a way to provide both private and public encapsulation for classes in conventional software engineering. When working with the Module pattern, we may find it useful to define a simple template that we use for getting started with it. Here's one that c...

 
This problem still blows my mind though. When DevTools are open, everything is awesome. DevTools are closed and one specific console.info call is breaking everything. Throws TypeError: Invalid calling object. When I copy the same call to the start of my application, it doesn't throw
wtf
It only happens when I'm invoking console.info through a reference
var info=window.console.info;info("",""); // throws
window.console.info("",""); // doesn't throw
 
var info=window.console.info.bind(console)?
 
@BenFortune That works much better
Shockingly!
 
not so shocking
ECMAscript: "Context, all the things!"
 
@jAndy That's why I put a sarcastic exclamation mark at the end of it
You can tell it's a sarcastic exclamation mark because it gives you that dirty look if you get real close to your display
 
4:37 PM
oh!! I didn't see the sarcastic color of the exclamation mark.. but now that you mentioned it...
 
Also, thanks @BenFortune, you have always been my favorite
Oh, and if you want to get your alert()s back after you've disabled them on one site in Edge, it helps to go back to that same site for testing :P
 
@BenFortune yeah it seems that my data binding source needs to be an array and it's being passed an object :)
on a side note, any idea how to get the dropdown from this searchinput to display top instead of bottom? grommet.github.io/docs/search-input
when I hit search on the input the suggestions dropdown but are cutoff..so would prefer them to drop up if that's a thing
 
5:01 PM
@OliverSalzburg Is that... sarcasm?
 
5:15 PM
@BenFortune Partially. I actually am thankful, but I would have to check the current ranking to see who the real favorite is
 
5:26 PM
Anyone here good with animations jQuery?
I have a fancy idea, not sure if something like that isn't already made though
 
user2620028
it is already made
 
-.-
 
It was made in 2013 and we were tired of it in 2014. :)
 
Well, guess there is no point in explaining my idea then
 
user2620028
i mean you could, and then we could show you who already made it more than likely
 
5:35 PM
Joking aside, animations made with jquery aren't too popular around here. I don't want to speak for everyone, though.
 
well, animation in general
Pretty hard to explain it tho
Lemme paint it :3
 
user2620028
i doubt that will help us understand it haha
 
I am pretty sure it will xD
ok I suck at drawing
basicly, I want to add a fancy animation for the navbar where it kind of "drops" from above the page
idk if this is a good explanation xD The top stays at the same place while the bottom drops down 90*
 
I think you might be able to do that with css-only.
 
Oh, any ideas how if I might ask?
 
5:41 PM
Lay out the bar in the final position, then have it animate from a rotate(90) to 0.
 
yeh but that would make it 2d
 
user2620028
@Omnitored daneden.github.io/animate.css some css animation examples
 
I mean that at the beginning the bottom is further away from you
 
user2620028
your website is 3d?
 
No, but I want the animation to look like it
 
5:42 PM
ohh, I see. you mean flip forward, not flop don on it's side?
 
yeh
 
user2620028
yeah the 2d image didn't help convey the 3d effect
 
You can "skew" in a css tranform.. so you can maybe fake the 3d with that
 
imagine holding a paper sheet forward, then the end of the sheet that is further away from you drops 90* down while the place you hold stays in same position
 
right. skew.
 
5:43 PM
kind of like th FlipInX on the github animate.css you sent @HatterisMad
just the other way
 
user2620028
then read the source and find out how they did it and then modify it
 
okay, thanks :3
 
they use transform: perspective() and rotate3d()
 
uh,
so
I have an answer with 500 votes now
503
A: How to find the sum of an array of numbers

Florian MargaineIn Lisp, this'd be exactly the job for reduce. You'd see this kind of code: (reduce #'+ '(1 2 3)) ; 6 Fortunately, in JavaScript, we also have reduce! Unfortunately, + is an operator, not a function. But we can make it pretty! Here, look: var sum = [1, 2, 3].reduce(add, 0); function add(a, b...

 
Yes, no IE8 support, jQuery 2+ doesn't work in IE8 either. Let's not be hamstrung by a really crappy browser. This Answer is beautiful. Thank Florian. — augurone Jun 13 '14 at 1:22
what a wonderful comment
 
5:55 PM
a lullaby to my ears
 
That's really cool though, and a great answer
 
Could use less Lisp evangelism.
 
My best answer has 31 votes :(
 
it should have been haskell
 
@Luggage could totally use more
 

« first day (2319 days earlier)      last day (2628 days later) »